ID:271011
 
IS there a way i can temporarily disable the movment of my character(like so they cannot use the arrow keys), but still can move when called by walk()?
and how?
For the love of god, use the forum's search function.
In response to Kaioken
Kaioken wrote:
For the love of god, use the forum's search function.

wow you can at least help the poor guy...

client
North()
East()
South()
West()


i think you'll need returns there, not sure as of now, no, I'm not going to test it, but you can.
In response to Animay3
Animay3 wrote:
Kaioken wrote:
For the love of god, use the forum's search function.

wow you can at least help the poor guy...

The "poor guy" can at least SEARCH before making a new topic; there are tons of topics on this and he could of found the answer there. Even merely searching for "disable movement" would probably bring up a few relevant topics with solutions.
That might initially seem harsh, but think about the poor guy[s] that need to answer the same question over and over all the time. >_>

And by the way, your code isn't even what he wants. :P
In response to Kaioken
Kaioken wrote:
Animay3 wrote:
Kaioken wrote:
For the love of god, use the forum's search function.

wow you can at least help the poor guy...

The "poor guy" can at least SEARCH before making a new topic; there are tons of topics on this and he could of found the answer there. Even merely searching for "disable movement" would probably bring up a few relevant topics with solutions.
That might initially seem harsh, but think about the poor guy[s] that need to answer the same question over and over all the time. >_>

And by the way, your code isn't even what he wants. :P

oh well, just trying to help em', but your right he should've searched, but i always forget to search because when i do massive topics spam it haha, oh well, and that code i posted i found from a different topic concerning this, so....
In response to Animay3
Well, ideally, people (including you :P) should search before making new topics, because there are already topics that concern that question, so no need to make a new one. Also, it's faster than waiting until people reply to your new topic, too.

Don't worry about helping him wrong, though. You're not THAT off, apparently you just misunderstood what he wants - that code disables all moving by the movement commands permanently - I gather he wants to temporairly disable them, when he wants, not all the time.
OK, the answer...for that case, you would add a variable to the mob (or client, but you will probably wanna use the mob) and set it when you want to disable movement, then override the Move() proc and stop it if that var is set to the blocked value.Example code:
mob/var/move_allowed = 1
client
Move(loc,dir)
if(!src.mob.move_allowed) return 0 //halt and return that movement failed
return ..() //do the default
//to disable movement, set the mob's move_allowed var to 0
In response to Kaioken
I don't think you CAN disable movement without being able to use the walk() proc...