ID:262324
 
Code:
verb
Pause()
alert(" ","Pause","Continue","Exit")
if("Continue")
//What do I put here to make it do nothing?
if("Exit")
alert("Are you sure you want to exit?","Exit","Yes","Cancel")
if("Yes")
src.client.mob = new/mob/player
for(var/mob/Head/O in world)
del O
for(var/mob/Tails/T in world)
del T
for(var/mob/characters/S in world)
del S
if("Cancel")
//What do I put here to make it loop?


Problem description:
I cannot find away to make this do nothing if you click on Cancle or Continue. Can any body help out?
uhh return?

-Ryan
In response to Ryne Rekab
Ryne Rekab wrote:
uhh return?

-Ryan

I tried that and it went on as if I hit the opposite choice in both instances.
Put switch() around the alert, an indent everything under it.
In response to Hell Ramen
Hell Ramen wrote:
Put switch() around the alert, an indent everything under it.

Thanks I forgot about the switch proc. Everything is perfect.
alert() returns the value that was selected by the player. Since it's a function (a proc that returns something), calling it all alone on a line like that is useless. Instead, you need to do something like this:

var/my_alert_result_variable = alert(...)


Then, if you want to know what the player selected, check the value of the variable that you set alert to, you can do something like this:

if(my_alert_result_variable == "Yes")