ID:266270
 
I think this is what I use for. If the usr's var equals 1 then it doesnt let them move else they can move wherever they want, I have tried several stuff, but it no wor :(. Any help would be apprieciated!
Air _King wrote:
I think this is what I use for. If the usr's var equals 1 then it doesnt let them move else they can move wherever they want, I have tried several stuff, but it no wor :(. Any help would be apprieciated!

Well, returning 0 in Move() doesn't do the moving. Returning 1 does. So, you'll want to see if the "locked" var returns TRUE, then Move() will return 0, preventing movement.

Let's write some pseudo-code (English "code" to be translated to DM)
when try to move
if player is locked
prevent from moving
otherwise
allow them to move

This isn't very complicated pseudo-code, but it's pseudo-code nonetheless. Now, we just translate it to DM. One thing we can't make in pseudo-code is vars. We'll add that in.
mob/var/locked = 0 //set a player's locked var to 1 to prevent movement

mob/Move() //when try to move
if(locked) //if player is locked
return 0 //prevent from moving
else //otherwise
return 1 //allow them to move

As an alternative to returning 1 in the else clause, you could return ..().

Now, for a test verb for locking movement. Maybe a GM ability?
mob/verb/lock_movement(mob/M as mob in world)
if(M.client) //if they're a PC
M.locked = TRUE //TRUE = 1
else
return //cancel out of the proc