ID:264486
 
Code:
mob
verb
Spar(mob/M in world)
set name ="Spar"
if(!src.SP)
for(M in oview(src))
var/spar=alert(M,"[src] would like to spar with you would you like to spar with them?","Spar","Yes","No")
if(spar=="Yes")
if(!src.firstspar)
src << "<font size=2 color=white> I see you have learned how to Spar! sparring is an Excellent way to train your combos and elements, but beware you can still die if you let your hp get to low! This form of training is not to be abused if you are caught abusing it you will be banned!"
src.firstspar = 1
M << "<font size=2 color=white> I see you have learned how to Spar! sparring is an Excellent way to train your combos and elements, but beware you can still die if you let your hp get to low! This form of training is not to be abused if you are caught abusing it you will be banned!"
M.firstspar=1
src.SP=1
M.SP=1
src.bond+=1
src.maxwoundhealth+=rand(15,19)
M.maxwoundhealth+=rand(15,19)
if(src.hp<=0)
src.hp=1
src<<"You should heal up before continuing.."
if(M.hp<=0)
M.hp=1
M<<"You should heal up before continuing...."
src<<" [M] has agreed to Spar!"
src.SP=1
M.SP=1
src.bond+=1
maxwoundhealth+=rand(15,19)
if(src.hp<=0)
src.hp=1
src<<"You should heal up before continuing.."
if(spar=="No")
src<<"[M] doesn't want to spar with you!"


else
src <<"You stop sparring"
M <<" [src] dosent want to spar anymore."
src.SP=0
M.SP=0


Problem description:
when a player uses the verb it should ask if you want to spar, however instead of this it just starts and the player your sparring with gets no confirmation or anything. could someone please help me to fix this up please?
... What's for() being used for?

Other than that, it works the way you want it to. Although I suggest completely redoing that code. I can tell that so much of it will not work the way you want it to.
In response to Demon_F0rce
ill redo it then thanks
mob
verb
Spar(mob/M in oview(1,src))
if(!src.SP)
switch(alert(M,"[src] would like to spar with you would you like to spar with them?","Spar","Yes","No"))
if("Yes")
if(!src.firstspar)
src << "<font size=2 color=white> I see you have learned how to Spar! sparring is an Excellent way to train your combos and elements, but beware you can still die if you let your hp get to low! This form of training is not to be abused if you are caught abusing it you will be banned!"
src.firstspar = 1
M << "<font size=2 color=white> I see you have learned how to Spar! sparring is an Excellent way to train your combos and elements, but beware you can still die if you let your hp get to low! This form of training is not to be abused if you are caught abusing it you will be banned!"
M.firstspar=1
src.SP=1
M.SP=1
src.bond+=1
src.maxwoundhealth+=rand(15,19)
M.maxwoundhealth+=rand(15,19)
if(src.hp<=0)
src.hp=1
src<<"You should heal up before continuing.."
if(M.hp<=0)
M.hp=1
M<<"You should heal up before continuing...."
src<<" [M] has agreed to Spar!"
src.SP=1
M.SP=1
src.bond+=1
maxwoundhealth+=rand(15,19)
if(src.hp<=0)
src.hp=1
src<<"You should heal up before continuing.."
if("No")
src<<"[M] doesn't want to spar with you!"
else
src <<"You stop sparring"
M <<" [src] dosent want to spar anymore."
src.SP=0
M.SP=0