Home   Help Search Login Register  

Author Topic: Why Doesn't this Weapon Respawn script work  (Read 1512 times)

0 Members and 1 Guest are viewing this topic.

vedder

  • Guest
Why Doesn't this Weapon Respawn script work
« on: 21 Sep 2002, 08:49:01 »
Hello,
I'm currently working on a multiplayer mission where when you die you respawn with a number of defined weapons. Using the default weapon respawn script i found on these forums I was able to get it to work, but after so long it would replace your current weapons even when you are alive. Having 4 magazines and then being stripped of them in a middle of a firefight is not my idea of fun ;)

So I modified the script using what little knowledge I have of scripting but it doesnt seem to work. If you can spot the error in my ways Id appreciate it. Thanks.

Here's the script all butchered up by me:


_soldier = _this select 0
_class = _this select 1

#main
? (gameend) : goto "over"
? (gamerun) : goto "running"

#running
?(_class == "W1"): goto "W1"
?(_class == "E1"): goto "E1"
exit

#W1
?(_soldier == "setdamage 0"): goto "main"
?(_soldier == "setdamage 1"): goto "W"
 

#W
~20

removeallweapons _soldier


_soldier addmagazine "HKMSG90mag"
_soldier addmagazine "HKP8mag"
_soldier addmagazine "HKP8mag"
_soldier addweapon "NVGoggles"
_soldier addweapon "HKMSG90"
_soldier addweapon "HKP8"
_soldier addweapon "binocular"
_soldier selectweapon "HKP8"
goto "main"
exit

#E1
?(_soldier == "setdamage 0"): goto "main"
?(_soldier == "setdamage 1"): goto "E"


#E
~20

removeallweapons _soldier

_soldier addmagazine "HKMSG90mag"
_soldier addmagazine "HKSOCOMmag"
_soldier addmagazine "HKSOCOMmag"
_soldier addweapon "NVGoggles"
_soldier addweapon "HKMSG90"
_soldier addweapon "HKSOCOM"
_soldier addweapon "binocular"
_soldier selectweapon "HKSOCOM"
goto "main"

#over
exit


vedder

  • Guest
Re:Why Doesn't this Weapon Respawn script work
« Reply #1 on: 21 Sep 2002, 12:06:15 »
Whoops never midn this thread, I managed to find a better way to do it.

http://www.flashpoint1985.com/cgi-bin/ikonboard301/ikonboard.cgi?s=3d8c30fd4b94ffff;act=ST;f=7;t=5995