OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Evan Scown on 18 Jun 2006, 14:11:08

Title: User Control Disableing
Post by: Evan Scown on 18 Jun 2006, 14:11:08
OK I've worked out how to disable a users control completely but how do I partly disable it so that the user can still look around, just not move?
Title: Re: User Control Disableing
Post by: myke13021 on 18 Jun 2006, 15:18:56
afaik you can't partly disable user input such as prevent him from walking, but you can simulate it with a script

hold.sqs

Code: [Select]
; prevent script to run on anything else than players machine
?! (local player): exit

; get players actual position
_pos = getpos player

;now loop for holding player on position
#loop
player setpos _pos

; check if walking is still disabled
? enablewalking: goto "end"
goto "loop"

;exit script
#end
exit

just call this script as soon you want to have the player nailed down. For some reason it won't let the player to turn around so he can't see what happens behind him. Maybe someone else could solve this.

Just make sure you set the variable "enablewalking" to true to give back movement control.