Cold Evil 13 Posted September 20, 2013 I need help with equipment weapons and items so they respawn after you have died. I have tried the following methods: Unit Init line: player addEventHandler ["Respawn", {_this execVM "squadleader.sqf"}]; Unit Init line: this addEventHandler ["Respawn", {_this execVM " squadleader.sqf"}]; Unit Init line: if(local this) then { removeallweapons this; removeheadgear this; removevest this; removebackpack this; removeUniform this; this unassignItem "NVGoggles"; this removeItem "NVGoggles"; this adduniform "U_B_CombatUniform_mcam"; this addVest "V_PlateCarrier2_rgr"; // ETC… }; The init.sqf file: waitUntil {!isNull player}; waitUntil {player == player}; if(typeOf player == "B_officer_F") then { removeallweapons player; removeheadgear player; removevest player; removebackpack player; removeUniform player; player unassignItem "ItemRadio"; // etc… }; How do I do it? Share this post Link to post Share on other sites
KevsNoTrev 44 Posted September 20, 2013 Simply give this a go - it is much easier than scripting a system. If you have a loadout at spawn then you can script the save loadout instead of having an ammo box with an action to select save. Share this post Link to post Share on other sites
Cold Evil 13 Posted September 20, 2013 I have a heavily restricted VAS on the mission. So if you die i don't what people run around with enemy weapons. Share this post Link to post Share on other sites
Cold Evil 13 Posted September 21, 2013 Is there a way to get a gear reset respawn? I think ive tried everything... Share this post Link to post Share on other sites
EL_LEJI 13 Posted September 22, 2013 (edited) try this in the Unit Init line: null = [this] execVM "squadleader.sqf"; this addeventhandler ["respawn","_this execVM 'squadleader.sqf'"]; And this in the sqf: //_squadleader.sqf waitUntil {!isNull player}; _unit = _this select 0; //_Remove Items removeallassigneditems _unit; removeallcontainers _unit; removeallweapons _unit; //_Gear _unit addUniform "U_B_CombatUniform_mcam"; _unit addvest "V_PlateCarrier2_rgr"; //_Items _unit addweapon "itemcompass"; _unit addweapon "itemmap"; _unit addweapon "itemwatch"; //_Weapons _unit addweapon "arifle_MX_F"; _unit addweapon "hgun_P07_snds_F"; _unit addmagazines ["16Rnd_9x21_Mag", 4]; Edited September 22, 2013 by Thor632 Share this post Link to post Share on other sites
Cold Evil 13 Posted September 22, 2013 (edited) It did not seam to do anything... It did not change anything for me. EquipmentHeliPilot.sqf waitUntil {!isNull player}; _unit = __unit select 0; removeallweapons _unit; removeheadgear _unit; removevest _unit; removebackpack _unit; removeUniform _unit; _unit unassignItem "ItemRadio"; _unit removeItem "ItemRadio"; _unit unassignItem "NVGoggles"; _unit removeItem "NVGoggles"; _unit adduniform "U_B_HeliPilotCoveralls"; _unit addVest "V_TacVest_oli"; _unit addHeadgear "H_PilotHelmetHeli_B"; _unit addMagazine ["16Rnd_9x21_Mag", 16]; _unit addMagazine ["16Rnd_9x21_Mag", 16]; _unit addMagazine ["16Rnd_9x21_Mag", 16]; _unit addMagazine ["SmokeShellBlue", 30]; _unit addMagazine ["SmokeShellBlue", 30]; _unit addMagazine ["SmokeShellBlue", 30]; _unit addMagazine ["SmokeShellGreen", 30]; _unit addMagazine ["SmokeShellGreen", 30]; _unit addMagazine ["SmokeShellGreen", 30]; _unit addWeapon "hgun_P07_F"; Unit init: null = [this] execVM "EquipmentHeliPilot.sqf"; this addeventhandler ["respawn","_this execVM 'EquipmentHeliPilot.sqf'"]; EDIT Never mind!!! I see my error... When i replaced "this" to "_unit" with i forgot to change "__unit" to "_this". The script seams to work thx! Edited September 22, 2013 by Cold Evil Share this post Link to post Share on other sites