OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Killzone on 27 May 2004, 21:20:22

Title: under arrest
Post by: Killzone on 27 May 2004, 21:20:22
I am trying a script where if I shoot a civillian and then an MP comes to where I am standing and arrest me and takes away my weapon (no problems so far)

I am trying to figure out how do I make it so that the MP will not shoot me unless I am trying to escape. If I get lets say 15 feet or further from him he will shoot me.  My problem is he takes my weapons then shoot me. I am not very good at scripting but here is my crude script

~1
police sidechat" WHAT THE HELL ARE YOU DOING!!!"
~1
police domove getpos soldier
~1
? sean distance police <8

~2
police sidechat "you are under arrest. I am taking your weapons"
~2
removeallweapons soldier
~1
? sean distance police <15
police sidechat "Please stay where you are"
police domove getpos soldier
police dotarget soldier
police dofire soldier


thanks for the help
Title: Re:under arrest
Post by: Clue on 27 May 2004, 21:43:23
I'm a beginner at scripting myself, but I think this might help solve your problem:

~1
police sidechat" WHAT THE HELL ARE YOU DOING!!!"
~1

#loop1
police domove getpos sean
? sean distance police <8 : goto "takegun"
~0.5
goto "loop1"

#takegun
~2
police sidechat "you are under arrest. I am taking your weapons"
~2
removeallweapons sean
~1

#loop2
? sean distance police > 15 : goto "warning"
~0.5
goto "loop2"

#warning
police sidechat "Please stay where you are"
police domove getpos sean
police dotarget sean
police dofire sean

exit

 See if that helps.   :)
Title: Re:under arrest
Post by: Killzone on 28 May 2004, 04:43:03
Perfect thank you.  ;D