ID:143347
 
Code:
if (istype(M,/mob/player))
switch(alert("Are you sure you want to challenge [M]?","Arena Challenge","Yes","No"))
if("Yes")
usr.challenge = 1
M.challenged = 1
for(M)
switch(alert("[usr] is challenging you, do you want to accept?","Arena Challenge","Yes","No"))
if("Yes")
M.loc = locate(291,37,1)
M.arena = 1
M.challenged = 0
usr.loc=locate(284,37,1)
usr.challenge = 0
usr.arena = 1


This is a simple problem I think, when I challenge someone, the alert comes to me, while it should go to the mob. Help please

put some 'else'es in there. and maybe some other 'if's... like:

else if("No")


stuff like that...
In response to Jman9901
i have an if no but the problem is that instead of the other player getting the alert i get it
for example
if i challenge someone i get to answer for them so wether they like it or not if i say yes its as if they accept
In response to Kreamz
hm... instead of making it a switch alert, try just making it a regular alert...
In response to Jman9901
then i would get an error
alert() has a first argument that's the mob to send the alert to. If it's not specified, it defaults to 'usr'. Add "m, " to the front of your alert call, without quotes.
In response to Kreamz
Click here.

Thats an arena demo, it should help you out.
In response to Scizzees
mob
verb
Arena(mob/M in world)
switch(alert("Are you sure you want to challenge [M]?","Arena Challenge","Yes","No"))
if("Yes")
usr.challenge = 1
M.challenged = 1
for(M)
switch(alert("M,[usr] is challenging you, do you want to accept?","Arena Challenge","Yes","No"))
if("Yes")
M.loc = locate(291,37,1)
M.arena = 1
M.challenged = 0
usr.loc=locate(284,37,1)
usr.challenge = 0
usr.arena = 1
return
if("No")
M<<"Chicken"
return

In response to Productions
Code:
mob
verb
Arena(mob/M in world)
switch(alert("Are you sure you want to challenge [M]?","Arena Challenge","Yes","No"))
if("Yes")
usr.challenge = 1
M.challenged = 1
for(M)
switch(alert("M,[usr] is challenging you, do you want to accept?","Arena Challenge","Yes","No"))
if("Yes")
M.loc = locate(291,37,1)
M.arena = 1
M.challenged = 0
usr.loc=locate(284,37,1)
usr.challenge = 0
usr.arena = 1
return
if("No")
M<<"Chicken"
return
In response to Afterschaaf
Nice job reviving a 1.5 year old topic that was already solved.
In response to Afterschaaf
Afterschaaf wrote:
Code:
> mob
> verb
> Arena(mob/M in world)
> switch(alert("Are you sure you want to challenge [M]?","Arena Challenge","Yes","No"))
> if("Yes")
> usr.challenge = 1
> M.challenged = 1
> for(M)
> switch(alert("M,[usr] is challenging you, do you want to accept?","Arena Challenge","Yes","No"))
> if("Yes")
> M.loc = locate(291,37,1)
> M.arena = 1
> M.challenged = 0
> usr.loc=locate(284,37,1)
> usr.challenge = 0
> usr.arena = 1
> return
> if("No")
> M<<"Chicken"
> return
>


You really are smart, not helping him with the code but to post a code from the WOTS source.
rofl that code looks so close to what i put on help not that long ago, but mine actually worked except the timeout proc.