How can I make an add action script run once, It will add to the action menu when you get within 3 metres of the policeman. But the policeman is scheduled to get killed in a minute. So what do I put in my script to make sure once its run once, it doesent run again. Heres my script:
_unit = _this select 0
_player = _this select 1
?runonce: goto "whenadd"
actionnumber = 0
#whenadd
?(_player distance _unit < 3): goto "action"
~0.3
goto "action"
#action
runonce=true
action = _player Addaction ["Report your problem","thingy.sqs"]
;here I am IDing the action, to a name which is action, so when you use the action in the game OFP will recognise you just used 'action'
~0.3
goto "start"
#start
?report: goto "whathappens"
?(_player distance _unit) < 3: goto "start"
_player RemoveAction (action)
actionnumber = (actionnumber + 1)
goto "action"
#whathappens
titletext["Excuse me officer, can you help?","plain",2]
~5
titletext["Well, I'll try sir.","plain",2]
~5
titletext["Good, I'm in way too deep","plain",2]
;or whateva u want to happen here
goto "nomore"
#nomore
nameofurscript=false
_player removeaction action
actionnumber = (actionnumber + 1)
exit