Home   Help Search Login Register  

Author Topic: Weapons when respawning  (Read 4656 times)

0 Members and 1 Guest are viewing this topic.

Offline toadlife

  • OFPEC Old Skool
  • Former Staff
  • ****
  • Official OFP Editing Center Toad
    • toadlife.net
Re:Weapons when respawning
« Reply #15 on: 06 Mar 2003, 05:17:20 »
Do you have the latest version of the script? The latest version makes the player select their primary weapon (rifle) after respawning.

I updated the script in the ed depot soon after I first submitted it.

If you have the latest version then, perhaps the script needs to be tweaked a little.
"Whenever you want information on the 'net, don't ask a question; just post a wrong answer." -- Cancer Omega.

Akodo

  • Guest
Re:Weapons when respawning
« Reply #16 on: 06 Mar 2003, 16:06:03 »
this is the version I am using..i'm not sure if it is the latest or not..


Quote
;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"



Offline toadlife

  • OFPEC Old Skool
  • Former Staff
  • ****
  • Official OFP Editing Center Toad
    • toadlife.net
Re:Weapons when respawning
« Reply #17 on: 06 Mar 2003, 22:55:54 »
Yeah you have the latest version. THis MAY be a bug with the BAS units. I'll check it out. I've only used it with official units.

It should work...see these lines:

;; wait until unit has his rifle
@weapons _unit select 0 == (_guns select 0)
;; make unit select his rifle.
_unit selectweapon primaryweapon _unit

primaryweapon _unit is allways a rifle, the line below should make the unit slect his rifle. I may be able improve it a bit though.

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