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