Jump to content
Sign in to follow this  
matte54

Gear change at start, works , tho dedicated messes it up.

Recommended Posts

Hey guys, have a problem i've been grinding all weekend.

i have this script going off in a trigger around the start ppl to fire for each local player in opfor

_x = player;

removeAllWeapons _x;
removeUniform _x;
removeHeadgear _x;
removeVest _x;
_x unassignItem "NVGoggles_OPFOR";

_x removeItem "NVGoggles_OPFOR";
_uniArray = ["U_IG_Guerilla1_1", "U_IG_Guerilla2_1", "U_IG_Guerilla2_2", "U_IG_Guerilla3_1", "U_IG_Guerilla3_2", "U_IG_leader", "U_Rangemaster", "U_C_HunterBody_grn"];
_uni = _uniArray select (floor (random (count _uniArray)));
_x addUniform _uni;
_headArray = ["H_Shemag_tan", "H_Shemag_olive", "H_Shemag_khk", "H_Cap_tan_specops_US", "H_Cap_khaki_specops_UK", "H_Cap_oli", "H_Cap_blk_ION", "H_Booniehat_mcamo", "H_Booniehat_grn", "H_Booniehat_dirty", "H_Beret_red" ,"H_Beret_ocamo", "H_BandMask_blk", "H_Bandanna_sgg", "H_Bandanna_camo", "H_Bandanna_gry", ""];
_head = _headArray select (floor (random (count _headArray)));	
_x addHeadgear _head;
_x addVest "V_BandollierB_cbr";
_x addMagazines ["9Rnd_45ACP_Mag", 5];
_x addWeapon "hgun_ACPC2_F";

It's supposed to remove the opfor players gear, and then randomize a "look" for each guerilla player with a random uniform and hat.

It works perfectly in editor and with a client host, but in dedicated the script fires gives each player a random hat, handgun and ammo, but everyone is still in their opfor uniform.

Can anyone explain why?

Share this post


Link to post
Share on other sites

How are you calling it?

If you run it from init line, e.g

[this] call compile preProcessFileLineNumbers "loadout.sqf"

Then change the first line to

// _x = player;
_x = _this select 0;

I'd also recommend you to not use _x since it is a variable used in forEach loops

You can also try

waitUntil {isDedicated || !isNull player}

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  

×