Hello, Im having some issues doing something which should be very simple to do but I must adjust the script below to work via this method.
Basicly what im trying to do is insted of using ["unitname",1] exec "thisscript.sqs"
I want to use [this,1] exec "thisscript.sqs" in each of units INIT however I am stuck on making the following changes to the script below because I get a error like "(PRIME) Error: Unknown Operator Bravo"
Thankyou in advanced.
Original Script
;Universal Weapons Respawn Script v1.02 (December 4, 2002)
;Required Version: 1.85
;by toadlife and Hamdinger
;toadlife@toadlife.net
;intialize like this: ["unitname",0] exec "thisscript.sqs"
; Or this: ["unitname",1] exec "thisscript.sqs"
;
; * "unitname" = The name of the player the script runs on (must be enclosed by quotes!)
; * 0/1 = method of repleneshing weapons
; **if method is 0, the player gets the same weapons he stated out with every time
; **if method is 1, the player gets the same weapons he had when he died
requiredVersion "1.85"
_name = _this select 0
_method = _this select 1
_unit = call format["%1",_name]
?(_method == 0):_guns = weapons _unit;_mags = magazines _unit;_guncount = count weapons _unit;_magcount = count magazines _unit
#checklocal
_unit = call format["%1",_name]
?local _unit:goto "respawnloop"
~(1 + (random 3))
goto "checklocal"
#respawnloop
@!alive _unit
?(_method == 1):_guns = weapons _unit;_mags = magazines _unit;_guncount = count weapons _unit;_magcount = count magazines _unit
@alive call format["%1",_name]
_unit = call format["%1",_name]
_unit removemagazines (magazines _unit select 0)
_unit removeweapon (weapons _unit select 0)
_c = 0
while "_c <= (_magcount - 1)" do {_unit addmagazine (_mags select _c); _c = _c + 1}
_c = 0
while "_c <= (_guncount - 1)" do {_unit addweapon (_guns select _c); _c = _c + 1}
@weapons _unit select 0 == (_guns select 0)
_unit selectweapon primaryweapon _unit
goto "respawnloop"