Jump to content
Sign in to follow this  
Cold Evil

Problem with Respawn and Object Boxes

Recommended Posts

Hi!

I have made 2 scripts one for units to customize the equipment and one for boxes to resupply and have custom items in them.

The respawn script turn people naked for some reason anyone now how to fix that?

INIT: null = [this] execVM "Equipment\AAF_Medic.sqf"; this addeventhandler ["respawn","_this execVM 'Equipment\AAF_Medic.sqf'"];

waitUntil {!isNull player};
_unit = _this select 0;

removeallweapons _unit;
removeheadgear _unit;
removeallitems _unit;
removevest _unit;
removebackpack _unit;
removeUniform _unit;
//_unit unassignItem "ItemRadio";
//_unit removeItem "ItemRadio";
_unit unassignItem "NVGoggles_INDEP";
_unit removeItem "NVGoggles_INDEP";
_unit unassignItem "ItemGPS";
_unit removeItem "ItemGPS";

_unit addUniform "U_I_CombatUniform_shortsleeve";
_unit addVest "V_PlateCarrierIA1_dgtl";
_unit addHeadgear "H_HelmetIA";

_unit addbackpack "X39_MedicBackPack";
//_unit additem "ItemGPS";
//_unit assignItem "ItemGPS";

_unit addMagazine ["9Rnd_45ACP_Mag", 9];
_unit addMagazine ["9Rnd_45ACP_Mag", 9];
_unit addMagazine ["9Rnd_45ACP_Mag", 9];
_unit addMagazine ["9Rnd_45ACP_Mag", 9];
_unit addMagazine ["30Rnd_556x45_Stanag", 30];
_unit addMagazine ["30Rnd_556x45_Stanag", 30];
_unit addMagazine ["30Rnd_556x45_Stanag", 30];
_unit addMagazine ["30Rnd_556x45_Stanag", 30];
_unit addMagazine ["30Rnd_556x45_Stanag", 30];
_unit addMagazine ["30Rnd_556x45_Stanag", 30];
_unit addMagazine ["30Rnd_556x45_Stanag_Tracer_Yellow", 30];
_unit addMagazine ["30Rnd_556x45_Stanag_Tracer_Yellow", 30];

_unit addWeapon "arifle_Mk20_ACO_F";
_unit addWeapon "hgun_ACPC2_F";
//_unit addWeapon "Binocular";

And and no one on server can tanke things from the box. How to fix that?

if (! isServer) exitWith {};

_crate = _this select 0;
while {alive _crate} do
{

//Clere the box
clearWeaponCargoGlobal _crate;
clearMagazineCargo _crate;
clearMagazineCargoGlobal _crate;
clearBackpackCargoGlobal _crate;
clearItemCargoGlobal _crate;

//Add item
_crate addMagazineCargo ["HandGrenade", 30];

sleep 600;
};

Whats wrong with them?

Share this post


Link to post
Share on other sites

think its to do with restrictions on the clothing for different factions - Iceman77 has commented on this on several posts i think

Share this post


Link to post
Share on other sites

With your crate script, try using addMagazineCargoGlobal instead of addMagazineCargo.

_crate addMagazineCargoGlobal ["HandGrenade", 30];

It will then add for all clients and not just the server.

Share this post


Link to post
Share on other sites
Lol i was way out. Guess answering questions at 2am isnt a good idea.

You are completely right. :P

Also ive tried to remove the uniform from the spawn script and hopefully it will work. Cause i can beleve that it has some fishy thing to do with that.

With your crate script, try using addMagazineCargoGlobal instead of addMagazineCargo.

It will then add for all clients and not just the server.

I've changed all the equipment spawning to global. BUT it still don't work.

I have found a way to get the equipment tho and that's by dragging it to the ground and then to the inventory BUT that's not an optimal idea for a multiplayer map.

So i still have problems with the items...

An example of another box:

if (! isServer) exitWith {};
_crate = _this select 0;
while {alive _crate} do
{

//Clere the box
clearWeaponCargoGlobal _crate;
clearMagazineCargoGlobal _crate;
clearBackpackCargoGlobal _crate;
clearItemCargoGlobal _crate;

//Add item
_crate addMagazineCargoGlobal ["9Rnd_45ACP_Mag", 20];
_crate addMagazineCargoGlobal ["30Rnd_556x45_Stanag", 30];
_crate addMagazineCargoGlobal ["30Rnd_556x45_Stanag_Tracer_Yellow", 30];
_crate addMagazineCargoGlobal ["200Rnd_65x39_cased_Box", 15];

sleep 600;
};

Share this post


Link to post
Share on other sites

Could this effect the inventory system?

Box INIT line:

nul = [this] execVM "AmmoBoxes\shell.sqf"; this enablesimulation false; this allowdamage false; this setvectorup [0,0,0]; this setPosATL [getPosATL this select 0, getPosATL this select 1, 0.8];

EDIT: IT did....

this enablesimulation false

broke the damn thing...

Edited by Cold Evil

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×