Home   Help Search Login Register  

Author Topic: Scripted action menus to come back after respawn  (Read 1198 times)

0 Members and 1 Guest are viewing this topic.

DARMARUS

  • Guest
Scripted action menus to come back after respawn
« on: 11 Dec 2002, 01:28:32 »
Hello ive just gottin into basic scripting and i noticed that once u add a action to a unit (for instance like a action called "Take syonide", After u resapwn the action does not come back??)   I used a basic script and exec it thru a trigger
Any can help me??

Offline toadlife

  • OFPEC Old Skool
  • Former Staff
  • ****
  • Official OFP Editing Center Toad
    • toadlife.net
Re:Scripted action menus to come back after respawn
« Reply #1 on: 11 Dec 2002, 19:39:45 »
Take a look at the resoawn script I have in the ed depot...

http://www.ofpec.com/editors/snippet_view.php?id=166


Here is a shortened version of it, that you can stick your code into (requires >= v1.85). If you don't have resistace you will have to use triggers and a different method.......

Also, notice the quotes around "unitname". The name of the unit MUST be in quotes when inititalizing the script.

["unitname"] exec "thisscript.sqs"
Code: [Select]
;Generic Respawn Script
;Required Version: 1.85
;by toadlife
;toadlife@toadlife.net
;intialize like this: ["unitname"] exec "thisscript.sqs"
;            Or this: ["unitname"] exec "thisscript.sqs"


requiredVersion "1.85"
_name = _this select 0

_unit = call format["%1",_name]


#checklocal
_unit = call format["%1",_name]
?local _unit:goto "respawnloop"
~(1 + (random 3))
goto "checklocal"


#respawnloop
@!alive _unit

@alive call format["%1",_name]
_unit = call format["%1",_name]

;Insert whatever code you want to run on the respawned unit here!! Address the unit as "_unit"
; EXAMPLE: _pee = _unit addaction ["Take a Piss","piddle.sqs"]

goto "respawnloop"
"Whenever you want information on the 'net, don't ask a question; just post a wrong answer." -- Cancer Omega.