ID:271731
 
i wanna make buttons on my game, but i was wondering if i could do 1 of these 2 things.

1-make the button at logon of a char

2-make the .quit command, or even the button itself check to see whether or not he has been in a bttle within the last minute (if so, he is opted to do one of the following, wait 1 minute for the battle sign to go away, and logout then, or just to go ahead and close out, and after 1 minute, even if a monster is attacking him and what not, he will then be logged out.
2 is somewhat like the Runescape style right? Well basically to do that, you have to edit the mob/Logout() proc.
mob/Logout()
.=..()//return the value of . at the end, a proc always returns after all the code is done, if you set a value for . whcih is the default return value, it will return that.
if(src.inbattle)
//code
sleep(600)//wait a minute)
del(src)//delete the mob
else
del(src)

Now for the inbattle var, you might want to turn that on whenever someone attacks or is being attacked, and then turn it off when the other person finishes attacking or the person finishes attacking.
In response to Kakashi24142
actually, if the button has the command .quit it wont wait for the 60 seconds, it just closes it out.

i want thewm to have a cancel, and not close option, but also make the button run code before calling .quit
In response to Super Silly Stuart
uh I think Mike H went over this:
mob/verb/quit()
switch(alert(src,"Are you sure you want to quit?","Quit","Yes","No"))
if("Yes")
winset(src,null,"command=.quit")
else return

And also .quit just closes down the screen which calls client.Del() which there in calls mob.Logout(), that's why I edited the Logout() proc, you don't seem to understand the connection between the client and the mob yet.
In response to Kakashi24142
I do know.... but the button command is .quit, and even though yea, it calls it, the .quit command with a button on the interface, doesnt wait a minute, it just goes ahead and makes their client exit out, even though theyre supposed to be waiting for 60 secs, of course theyre char is still there for 60 seconds, but theyre client isnt up anymore.

i dont want the verb to be quit.... i want a button created via the interface with that command in it
In response to Super Silly Stuart
If u dont get what i meen, open dream maker and add an interface file, add the map, and add a button on the right saying quit and put the .quit or w/e it is oin the command.

if u code in sleep(60) once u press the button even though it goes through the logout code, the client closes out, then after 60 seconds is up, the person logs out after.

i want it so their client wont close till AFTER the 60 seconds, instead of closing them out, then 60 seconds after, their character dissappears.
In response to Super Silly Stuart
It doesnt keep the client on the server, it keeps the mob on it >_>
In response to Kakashi24142
yah, i know, i want the guys client to stay up, and not only the mob...thats why i posted this, i knew how to do the other thing.