OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: ZNorQ on 01 Aug 2004, 12:29:00
-
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
-
Hmmm.... Seems there are no answers to this one... :-[
ZNorQ
-
How about trying toadlife's universal weapons script-I think it's called like this.
Been using it for quite some time now, no bugs AFAIK.
I think you can find it here @ OFPEC.
-
While it might not help, I can report that the same goes for the War Games League (WGL) AT launchers/mags - one can fire it off, but it is still listed in the magazines player array result.
Perhaps some comparative research of the JAM AT rounds and the WGL ones can shed light on why this occurs? Also, do the JAM RPG7 launchers behave in the same way?
*EDIT: Uhm... the standard BIS LAW soldier guy "does" the same thing - he never has less than one LAWLauncher magazine listed, even though all three rounds have been fired off.
Yay! Yet another OFP bug we won't have fixed... :-\
-
Well then, lets hope OFP2's fixed the issue...
Don't think I'll get any further with this one, so I'll just close it...
ZNorQ