I'm using a script to remove all weapons and ammo's from a players corpse, and rearm the respawned player with that same equipment.
It seems to work good on everything, with the exception on JAM's AT4 Launcher. Even when I've used up all the rockets, it still gives me 1 more rocket when I respawn.. Soo annoying. I did a test which prints out all magazines..
(Used a repeated radio alpha trigger to execute the code)
hint format["%1", magazines player]
I shot off all AT4 rockets, and called up alpha radio - and what do you know? I still have one AT4 rocket left according to the list - but none in the inventory (gear section in the briefing)...
The 'Killed' #MakeListOfWeaponsAndMags
_vWhoDied = player
_vCarriedWeapons = weapons player
_vCarriedMagazines = magazines player
removeAllWeapons player
#RemoveEventHandlersFromCorpse
player removeAllEventHandlers "killed"
player removeAllEventHandlers "fired"
#WaitForPlayerToRespawn
@(alive player)
#PlayerRespawnedInAir
?(getPos player select 2 >0.5): player setPos [getPos player select 0, getPos player select 1, 0]
#PlayerRespawnedInWater
; * CANT FIND ANY WAY TO SOLVE THIS *
#RestoreWeaponsAndEquipment
removeAllWeapons player
{player addMagazine _x} forEach _vCarriedMagazines
{player addWeapon _x} forEach _vCarriedWeapons
player selectWeapon (primaryWeapon player)
#SetCombatAndAddEventHandler
player setBehaviour "Combat"
_vHandlerKilledID = player addEventHandler ["killed", {_this exec "bat\stdPlayerKilled.sqs"}]
_vHandlerFiredID = player addEventHandler ["fired",{if (_this select 4 == "HEP_M82Mag") then {_this call loadFile "\HEP\FX\m82fx.sqf"}}]
Exit
Anyone know any work-arounds for this?
ZNorQ