ID:270498
 
ok say you have a character with the power to freeze time and you want it to be used as a power it would freeze a player till you use the power again.so my question is how to do it?
You need a var to stop mobs from moving, the following should do fine for what you need:

mob/var                         
AllowMove = 1 //1 means they can move, 0 means they cant move

mob/Move()
if(src.AllowMove == 0) //This stops the mob moving when it is set to 0
return
..()


//Now when they do the attack, just set the mobs AllowMove to 0,
//and he will be unable to move untile it is set to 1 again
mob
var/freeze
var/cast
Move()
if(!src.freeze)
..()
verb
Freeze_Time_In_World()
if(!usr.cast)
for(var/mob/M in world)if(M!=usr)M.freeze=1
usr.cast=1
else
for(var/mob/M in world)if(M!=usr)M.freeze=1
usr.cast=0


Pretty simple stuff here. Just create a freeze variable which toggles each time they click the verb. When a mob moves it checks to see if it's freeze variable is true or not, and if it is then it doesn't do anything, but if it isn't then it continues on with what it's supposed to do. Keep in mind this will work with only one person having this verb. You can also add a check in there to see if the person casting it is frozen or not and if they are then they cannot cast it so people can't undo other people's freezes.
In response to Jester619
thanks it worked
In response to Christy Lehane
Be careful, though. Make sure to build the time-frozen thing into accumulators, etc too. Otherwise, people won't be able to move, but they can still do other things.