Jump to content
Sign in to follow this  
Phal

[SCRIPTING] Random weapons not consistent across clients

Recommended Posts

Hi all,

This issue has been boggling me for several days now and between me and a few buddies we can't seem to figure out what the issue is, and I can't find anything relating to this exact problem on the web.

Anyway, here's the issue:

In this mission the players control civilians, who start with no gear. I want them all to spawn with random gear, and what I have works. The only problem is the weapon given by the script is often different to the weapon other players see, if that makes sense. So for example I get given a NATO MXM 7.62mm, but other players see my character holding a pistol, nothing at all, or a different assault rifle etc.

To run this script, in the initialization of the unit I do:

nul = [this] execVM "Player_Equipment.sqf";

In Player_Equipment.sqf, this is the code:

//---------- Script Start ---------

private ["_unit"];
_unit = _this select 0;

waitUntil {!isNull _unit};

removeAllAssignedItems _unit;
Removeuniform _unit;
Removevest _unit;
Removegoggles _unit;
Removeheadgear _unit;
Removeallweapons _unit;

//------------ Uniform ------------

_uniform = (ceil (random 9));

switch (_uniform ) do 
{
case 0: {
	_unit adduniform "U_C_Commoner1_1";
	};
case 1: {
	_unit adduniform "U_C_Commoner1_1";
	};
case 2: {
	_unit adduniform "U_C_Commoner1_2";
	};
case 3: {
	_unit adduniform "U_C_Commoner1_3";
	};
case 4: {
	_unit adduniform "U_C_Poloshirt_blue";
	};
case 5: {
	_unit adduniform "U_C_Poloshirt_burgundy";
	};
case 6: {
	_unit adduniform "U_C_Poloshirt_redwhite";
	};
case 7: {
	_unit adduniform "U_C_Poloshirt_salmon";
	};
case 8: {
	_unit adduniform "U_C_Poloshirt_stripped";
	};
case 9: {
	_unit adduniform "U_C_Poloshirt_tricolour";
	};
};

//------------ Body Armour ------------

_armour = (ceil (random 9));

switch (_armour ) do 
{
case 0: {
	_unit addvest "V_Chestrig_khk";
	};
case 1: {
	_unit addvest "V_BandollierB_rgr";
	};
case 2: {
	_unit addvest "V_BandollierB_cbr";
	};
case 3: {
	_unit addvest "V_BandollierB_khk";
	};
case 4: {
	_unit addvest "V_TacVest_brn";
	};
case 5: {
	_unit addvest "V_TacVest_oli";
	};
case 6: {
	_unit addvest "V_TacVest_khk";
	};
case 7: {
	_unit addvest "V_ChestrigB_rgr";
	};
case 8: {
	_unit addvest "V_PlateCarrierGL_rgr";
	};
case 9: {
	_unit addvest "V_PlateCarrier1_cbr";
	};
};

//------------ Eyewear ------------

_eyewear = (ceil (random 5));

switch (_eyewear ) do 
{
case 0: {
	_unit addGoggles "G_Shades_Black";
	};
case 1: {
	_unit addGoggles "G_Shades_Blue";
	};
case 2: {
	_unit addGoggles "G_Sport_Blackred";
	};
case 3: {
	_unit addGoggles "G_Tatical_Clear";
	};
};

//------------ Helmet/Hat ------------

_hat = (ceil (random 5));

switch (_hat ) do 
{
case 0: {
	_unit addheadgear "H_Cap_brn_SERO";
	};
case 1: {
	_unit addheadgear "H_Cap_blu";
	};
case 2: {
	_unit addheadgear "H_Cap_red";
	};
case 3: {
	_unit addheadgear "H_Cap_headphones";
	};
};


//------------ Weapon ------------

_weapon = (ceil (random 10));

switch (_weapon ) do 
{
case 0: {
	_unit addMagazines ["30Rnd_65x39_caseless_green",6];
	_unit addweapon "arifle_Khaybar_F";
	};
case 1: {
	_unit addMagazines ["30Rnd_65x39_caseless_green",6];
	_unit addweapon "arifle_Khaybar_C_F";
	};
case 2: {
	_unit addMagazines ["30Rnd_65x39_caseless_mag",6];
	_unit addweapon "arifle_MX_F";
	};
case 3: {
	_unit addMagazines ["30Rnd_65x39_caseless_mag",6];
	_unit addweapon "arifle_MXC_F";
	};
case 4: {
	_unit addMagazines ["20Rnd_762x45_Mag",6];
	_unit addweapon "arifle_MXM_F";
	};
case 5: {
	_unit addMagazines ["30Rnd_65x39_case_mag",6];
	_unit addweapon "arifle_TRG20_F";
	};
case 6: {
	_unit addMagazines ["30Rnd_65x39_case_mag",6];
	_unit addweapon "arifle_TRG21_F";
	};
case 7: {
	_unit addMagazines ["30Rnd_556x45_Stanag",6];
	_unit addweapon "arifle_SDAR_F";
	};
case 8: {
	_unit addMagazines ["20Rnd_762x45_Mag",6];
	_unit addweapon "srifle_EBR_F";
	};
case 9: {
	_unit addMagazines ["16Rnd_9x21_Mag",6];
	_unit addweapon "hgun_P07_F";
	};
case 10: {
	_unit addMagazines ["16Rnd_9x21_Mag",6];
	_unit addweapon "hgun_Rook40_F";
	};

};

//------------ Attachments ------------

_extras = (ceil (random 7));

switch (_extras ) do 
{
case 0: {
	_unit addPrimaryWeaponItem "optic_Holosight";
	};
case 1: {
	_unit addPrimaryWeaponItem "optic_Aco";
	};
case 2: {
	_unit addPrimaryWeaponItem "acc_flashlight";
	};
case 3: {
	_unit addPrimaryWeaponItem "acc_pointer_IR";
	};
case 4: {
	_unit addMagazines ["HandGrenade",2];
	};
case 5: {
	_unit addMagazines ["HandGrenade",1];
	};
};

//------------ Extra Items ------------

_items = (ceil (random 7));

switch (_items ) do 
{
case 0: {
	_unit addItem "FirstAidKit";
	};
case 1: {
	_unit addItem "FirstAidKit";
	_unit addItem "ItemMap";
	_unit assignItem "ItemMap";
	_unit addItem "ItemCompass";
	_unit assignItem "ItemCompass";
	_unit addItem "ItemWatch";
	_unit assignItem "ItemWatch";
	};
case 2: {
	_unit addItem "FirstAidKit";
	_unit addItem "ItemMap";
	_unit assignItem "ItemMap";
	};
case 3: {
	_unit addItem "ItemWatch";
	_unit assignItem "ItemWatch";
	_unit addItem "FirstAidKit";
	_unit addItem "ItemCompass";
	_unit assignItem "ItemCompass";
	};
case 4: {
	_unit addItem "ItemWatch";
	_unit assignItem "ItemWatch";
	_unit addItem "ItemCompass";
	_unit assignItem "ItemCompass";
	};
case 5: {
	_unit addItem "ItemMap";
	_unit assignItem "ItemMap";
	_unit addItem "ItemWatch";
	_unit assignItem "ItemWatch";
	};
case 6: {
	_unit addItem "ItemMap";
	_unit assignItem "ItemMap";
	_unit addItem "ItemCompass";
	_unit assignItem "ItemCompass";
	};
case 7: {
	_unit addItem "FirstAidKit";
	_unit addItem "ItemWatch";
	_unit assignItem "ItemWatch";
	};
};

//------------ Script Done ------------

I'd really like it to work, I've tried all sorts of things like running it on the server and not on each client - In which case only I spawn with weapons and no one else, as I'm the host. I've tried various sleep times and WaitUntil IsNull Player, things like that to give the game enough time to sync, but no luck.

If any scripting wizz on here has any ideas it'd be much appreciated.

Probably the most annoying thing is everything else matches up, players see the correct clothing, vest, hats, etc. for each player, it's JUST the weapon.

Thanks,

-Phal

Share this post


Link to post
Share on other sites

Try this, I added a _unit == player check to make it run only on the desired client

private ["_unit"];
_unit = _this select 0;
if (_unit == player) then {
waitUntil {!isNull _unit};

removeAllAssignedItems _unit;
Removeuniform _unit;
Removevest _unit;
Removegoggles _unit;
Removeheadgear _unit;
Removeallweapons _unit;

//------------ Uniform ------------

_uniform = (ceil (random 9));

switch (_uniform ) do 
{
case 0: {
	_unit adduniform "U_C_Commoner1_1";
	};
case 1: {
	_unit adduniform "U_C_Commoner1_1";
	};
case 2: {
	_unit adduniform "U_C_Commoner1_2";
	};
case 3: {
	_unit adduniform "U_C_Commoner1_3";
	};
case 4: {
	_unit adduniform "U_C_Poloshirt_blue";
	};
case 5: {
	_unit adduniform "U_C_Poloshirt_burgundy";
	};
case 6: {
	_unit adduniform "U_C_Poloshirt_redwhite";
	};
case 7: {
	_unit adduniform "U_C_Poloshirt_salmon";
	};
case 8: {
	_unit adduniform "U_C_Poloshirt_stripped";
	};
case 9: {
	_unit adduniform "U_C_Poloshirt_tricolour";
	};
};

//------------ Body Armour ------------

_armour = (ceil (random 9));

switch (_armour ) do 
{
case 0: {
	_unit addvest "V_Chestrig_khk";
	};
case 1: {
	_unit addvest "V_BandollierB_rgr";
	};
case 2: {
	_unit addvest "V_BandollierB_cbr";
	};
case 3: {
	_unit addvest "V_BandollierB_khk";
	};
case 4: {
	_unit addvest "V_TacVest_brn";
	};
case 5: {
	_unit addvest "V_TacVest_oli";
	};
case 6: {
	_unit addvest "V_TacVest_khk";
	};
case 7: {
	_unit addvest "V_ChestrigB_rgr";
	};
case 8: {
	_unit addvest "V_PlateCarrierGL_rgr";
	};
case 9: {
	_unit addvest "V_PlateCarrier1_cbr";
	};
};

//------------ Eyewear ------------

_eyewear = (ceil (random 5));

switch (_eyewear ) do 
{
case 0: {
	_unit addGoggles "G_Shades_Black";
	};
case 1: {
	_unit addGoggles "G_Shades_Blue";
	};
case 2: {
	_unit addGoggles "G_Sport_Blackred";
	};
case 3: {
	_unit addGoggles "G_Tatical_Clear";
	};
};

//------------ Helmet/Hat ------------

_hat = (ceil (random 5));

switch (_hat ) do 
{
case 0: {
	_unit addheadgear "H_Cap_brn_SERO";
	};
case 1: {
	_unit addheadgear "H_Cap_blu";
	};
case 2: {
	_unit addheadgear "H_Cap_red";
	};
case 3: {
	_unit addheadgear "H_Cap_headphones";
	};
};


//------------ Weapon ------------

_weapon = (ceil (random 10));

switch (_weapon ) do 
{
case 0: {
	_unit addMagazines ["30Rnd_65x39_caseless_green",6];
	_unit addweapon "arifle_Khaybar_F";
	};
case 1: {
	_unit addMagazines ["30Rnd_65x39_caseless_green",6];
	_unit addweapon "arifle_Khaybar_C_F";
	};
case 2: {
	_unit addMagazines ["30Rnd_65x39_caseless_mag",6];
	_unit addweapon "arifle_MX_F";
	};
case 3: {
	_unit addMagazines ["30Rnd_65x39_caseless_mag",6];
	_unit addweapon "arifle_MXC_F";
	};
case 4: {
	_unit addMagazines ["20Rnd_762x45_Mag",6];
	_unit addweapon "arifle_MXM_F";
	};
case 5: {
	_unit addMagazines ["30Rnd_65x39_case_mag",6];
	_unit addweapon "arifle_TRG20_F";
	};
case 6: {
	_unit addMagazines ["30Rnd_65x39_case_mag",6];
	_unit addweapon "arifle_TRG21_F";
	};
case 7: {
	_unit addMagazines ["30Rnd_556x45_Stanag",6];
	_unit addweapon "arifle_SDAR_F";
	};
case 8: {
	_unit addMagazines ["20Rnd_762x45_Mag",6];
	_unit addweapon "srifle_EBR_F";
	};
case 9: {
	_unit addMagazines ["16Rnd_9x21_Mag",6];
	_unit addweapon "hgun_P07_F";
	};
case 10: {
	_unit addMagazines ["16Rnd_9x21_Mag",6];
	_unit addweapon "hgun_Rook40_F";
	};

};

//------------ Attachments ------------

_extras = (ceil (random 7));

switch (_extras ) do 
{
case 0: {
	_unit addPrimaryWeaponItem "optic_Holosight";
	};
case 1: {
	_unit addPrimaryWeaponItem "optic_Aco";
	};
case 2: {
	_unit addPrimaryWeaponItem "acc_flashlight";
	};
case 3: {
	_unit addPrimaryWeaponItem "acc_pointer_IR";
	};
case 4: {
	_unit addMagazines ["HandGrenade",2];
	};
case 5: {
	_unit addMagazines ["HandGrenade",1];
	};
};

//------------ Extra Items ------------

_items = (ceil (random 7));

switch (_items ) do 
{
case 0: {
	_unit addItem "FirstAidKit";
	};
case 1: {
	_unit addItem "FirstAidKit";
	_unit addItem "ItemMap";
	_unit assignItem "ItemMap";
	_unit addItem "ItemCompass";
	_unit assignItem "ItemCompass";
	_unit addItem "ItemWatch";
	_unit assignItem "ItemWatch";
	};
case 2: {
	_unit addItem "FirstAidKit";
	_unit addItem "ItemMap";
	_unit assignItem "ItemMap";
	};
case 3: {
	_unit addItem "ItemWatch";
	_unit assignItem "ItemWatch";
	_unit addItem "FirstAidKit";
	_unit addItem "ItemCompass";
	_unit assignItem "ItemCompass";
	};
case 4: {
	_unit addItem "ItemWatch";
	_unit assignItem "ItemWatch";
	_unit addItem "ItemCompass";
	_unit assignItem "ItemCompass";
	};
case 5: {
	_unit addItem "ItemMap";
	_unit assignItem "ItemMap";
	_unit addItem "ItemWatch";
	_unit assignItem "ItemWatch";
	};
case 6: {
	_unit addItem "ItemMap";
	_unit assignItem "ItemMap";
	_unit addItem "ItemCompass";
	_unit assignItem "ItemCompass";
	};
case 7: {
	_unit addItem "FirstAidKit";
	_unit addItem "ItemWatch";
	_unit assignItem "ItemWatch";
	};
};

//------------ Script Done ------------
};

Maybe this will work. The problem lies in the random number creating a different num for each client, most likely.

Edited by Tuliq
think i got your problem

Share this post


Link to post
Share on other sites

Hi Tuliq,

Thanks for trying to help.

I applied your proposed fix and it worked for the first try with my friend, then every subsequent test he spawned in as if the script hadn't even executed (so he hadn't even been stripped and assigned new clothes etc. let alone a weapon), meanwhile the script executes fine for myself.

Maybe this will work. The problem lies in the random number creating a different num for each client, most likely.

And yeah that makes sense, except the only thing that seems to differ between clients is the weapon. I've tested this multiple times by asking other players what they see others wearing and their descriptions match. It's completely bonkers (aka annoyingly inconsistent, and it's driving me mad!).

Even after reverting from your changes and making it into a .pbo instead of just hosting it raw from the editor, other players sometimes still spawn as if the script hasn't executed. :[

Share this post


Link to post
Share on other sites

No problem, glad to help! Just a quick thought: try moving the waitUntil command at the beginning to the very top of the script. Might help, not sure.

Actually scratch that, remove my IF check (remember the bottom brace) and set a waitUntil {(player == _unit)}; in its place.

That should make it so that the script waits for the player to get control of the unit. Just remove that other waitUntil, since it is not needed.

Edited by Tuliq

Share this post


Link to post
Share on other sites

I did try moving the waitUntil to the top when I tested your first suggestion, still did the same thing..

I put in the {(player == _unit)}; Will have to wait until tomorrow now to test though so will post results then.

Cheers

Share this post


Link to post
Share on other sites

Alright, cool. Just so we are on the same page, here is my vision of how to fix script:

private ["_unit"];
_unit = _this select 0;
waitUntil {(player == _unit)};

removeAllAssignedItems _unit;
Removeuniform _unit;
Removevest _unit;
Removegoggles _unit;
Removeheadgear _unit;
Removeallweapons _unit;

//------------ Uniform ------------

_uniform = (ceil (random 9));

switch (_uniform ) do 
{
case 0: {
	_unit adduniform "U_C_Commoner1_1";
	};
case 1: {
	_unit adduniform "U_C_Commoner1_1";
	};
case 2: {
	_unit adduniform "U_C_Commoner1_2";
	};
case 3: {
	_unit adduniform "U_C_Commoner1_3";
	};
case 4: {
	_unit adduniform "U_C_Poloshirt_blue";
	};
case 5: {
	_unit adduniform "U_C_Poloshirt_burgundy";
	};
case 6: {
	_unit adduniform "U_C_Poloshirt_redwhite";
	};
case 7: {
	_unit adduniform "U_C_Poloshirt_salmon";
	};
case 8: {
	_unit adduniform "U_C_Poloshirt_stripped";
	};
case 9: {
	_unit adduniform "U_C_Poloshirt_tricolour";
	};
};

//------------ Body Armour ------------

_armour = (ceil (random 9));

switch (_armour ) do 
{
case 0: {
	_unit addvest "V_Chestrig_khk";
	};
case 1: {
	_unit addvest "V_BandollierB_rgr";
	};
case 2: {
	_unit addvest "V_BandollierB_cbr";
	};
case 3: {
	_unit addvest "V_BandollierB_khk";
	};
case 4: {
	_unit addvest "V_TacVest_brn";
	};
case 5: {
	_unit addvest "V_TacVest_oli";
	};
case 6: {
	_unit addvest "V_TacVest_khk";
	};
case 7: {
	_unit addvest "V_ChestrigB_rgr";
	};
case 8: {
	_unit addvest "V_PlateCarrierGL_rgr";
	};
case 9: {
	_unit addvest "V_PlateCarrier1_cbr";
	};
};

//------------ Eyewear ------------

_eyewear = (ceil (random 5));

switch (_eyewear ) do 
{
case 0: {
	_unit addGoggles "G_Shades_Black";
	};
case 1: {
	_unit addGoggles "G_Shades_Blue";
	};
case 2: {
	_unit addGoggles "G_Sport_Blackred";
	};
case 3: {
	_unit addGoggles "G_Tatical_Clear";
	};
};

//------------ Helmet/Hat ------------

_hat = (ceil (random 5));

switch (_hat ) do 
{
case 0: {
	_unit addheadgear "H_Cap_brn_SERO";
	};
case 1: {
	_unit addheadgear "H_Cap_blu";
	};
case 2: {
	_unit addheadgear "H_Cap_red";
	};
case 3: {
	_unit addheadgear "H_Cap_headphones";
	};
};


//------------ Weapon ------------

_weapon = (ceil (random 10));

switch (_weapon ) do 
{
case 0: {
	_unit addMagazines ["30Rnd_65x39_caseless_green",6];
	_unit addweapon "arifle_Khaybar_F";
	};
case 1: {
	_unit addMagazines ["30Rnd_65x39_caseless_green",6];
	_unit addweapon "arifle_Khaybar_C_F";
	};
case 2: {
	_unit addMagazines ["30Rnd_65x39_caseless_mag",6];
	_unit addweapon "arifle_MX_F";
	};
case 3: {
	_unit addMagazines ["30Rnd_65x39_caseless_mag",6];
	_unit addweapon "arifle_MXC_F";
	};
case 4: {
	_unit addMagazines ["20Rnd_762x45_Mag",6];
	_unit addweapon "arifle_MXM_F";
	};
case 5: {
	_unit addMagazines ["30Rnd_65x39_case_mag",6];
	_unit addweapon "arifle_TRG20_F";
	};
case 6: {
	_unit addMagazines ["30Rnd_65x39_case_mag",6];
	_unit addweapon "arifle_TRG21_F";
	};
case 7: {
	_unit addMagazines ["30Rnd_556x45_Stanag",6];
	_unit addweapon "arifle_SDAR_F";
	};
case 8: {
	_unit addMagazines ["20Rnd_762x45_Mag",6];
	_unit addweapon "srifle_EBR_F";
	};
case 9: {
	_unit addMagazines ["16Rnd_9x21_Mag",6];
	_unit addweapon "hgun_P07_F";
	};
case 10: {
	_unit addMagazines ["16Rnd_9x21_Mag",6];
	_unit addweapon "hgun_Rook40_F";
	};

};

//------------ Attachments ------------

_extras = (ceil (random 7));

switch (_extras ) do 
{
case 0: {
	_unit addPrimaryWeaponItem "optic_Holosight";
	};
case 1: {
	_unit addPrimaryWeaponItem "optic_Aco";
	};
case 2: {
	_unit addPrimaryWeaponItem "acc_flashlight";
	};
case 3: {
	_unit addPrimaryWeaponItem "acc_pointer_IR";
	};
case 4: {
	_unit addMagazines ["HandGrenade",2];
	};
case 5: {
	_unit addMagazines ["HandGrenade",1];
	};
};

//------------ Extra Items ------------

_items = (ceil (random 7));

switch (_items ) do 
{
case 0: {
	_unit addItem "FirstAidKit";
	};
case 1: {
	_unit addItem "FirstAidKit";
	_unit addItem "ItemMap";
	_unit assignItem "ItemMap";
	_unit addItem "ItemCompass";
	_unit assignItem "ItemCompass";
	_unit addItem "ItemWatch";
	_unit assignItem "ItemWatch";
	};
case 2: {
	_unit addItem "FirstAidKit";
	_unit addItem "ItemMap";
	_unit assignItem "ItemMap";
	};
case 3: {
	_unit addItem "ItemWatch";
	_unit assignItem "ItemWatch";
	_unit addItem "FirstAidKit";
	_unit addItem "ItemCompass";
	_unit assignItem "ItemCompass";
	};
case 4: {
	_unit addItem "ItemWatch";
	_unit assignItem "ItemWatch";
	_unit addItem "ItemCompass";
	_unit assignItem "ItemCompass";
	};
case 5: {
	_unit addItem "ItemMap";
	_unit assignItem "ItemMap";
	_unit addItem "ItemWatch";
	_unit assignItem "ItemWatch";
	};
case 6: {
	_unit addItem "ItemMap";
	_unit assignItem "ItemMap";
	_unit addItem "ItemCompass";
	_unit assignItem "ItemCompass";
	};
case 7: {
	_unit addItem "FirstAidKit";
	_unit addItem "ItemWatch";
	_unit assignItem "ItemWatch";
	};
};

//------------ Script Done ------------

Share this post


Link to post
Share on other sites

Ok so I've just tested it with one other person and it seems to work. The gun he sees on me is the gun I have, hooray! All other gear is synced too just like before.

Only thing now is the AI obviously spawn with nothing as they're not considered players! But this is a minor issue I can think up a workaround for later.

Thanks for the help Tuliq.

The final code I have is:

//---------- Script Start ---------------|

private ["_unit"];
_unit = _this select 0;

//---------------------------------------|
waitUntil {(player == _unit)};
//---------------------------------------|

removeAllAssignedItems _unit;
Removeuniform _unit;
Removevest _unit;
Removegoggles _unit;
Removeheadgear _unit;
Removeallweapons _unit;

//---------- Uniform --------------------|

_uniform = (ceil (random 9));

switch (_uniform ) do 
{
case 0: {
	_unit adduniform "U_C_Commoner1_1";
	};
case 1: {
	_unit adduniform "U_C_Commoner1_1";
	};
case 2: {
	_unit adduniform "U_C_Commoner1_2";
	};
case 3: {
	_unit adduniform "U_C_Commoner1_3";
	};
case 4: {
	_unit adduniform "U_C_Poloshirt_blue";
	};
case 5: {
	_unit adduniform "U_C_Poloshirt_burgundy";
	};
case 6: {
	_unit adduniform "U_C_Poloshirt_redwhite";
	};
case 7: {
	_unit adduniform "U_C_Poloshirt_salmon";
	};
case 8: {
	_unit adduniform "U_C_Poloshirt_stripped";
	};
case 9: {
	_unit adduniform "U_C_Poloshirt_tricolour";
	};
};

//---------- Body Armour ----------------|

_armour = (ceil (random 9));

switch (_armour ) do 
{
case 0: {
	_unit addvest "V_Chestrig_khk";
	};
case 1: {
	_unit addvest "V_BandollierB_rgr";
	};
case 2: {
	_unit addvest "V_BandollierB_cbr";
	};
case 3: {
	_unit addvest "V_BandollierB_khk";
	};
case 4: {
	_unit addvest "V_TacVest_brn";
	};
case 5: {
	_unit addvest "V_TacVest_oli";
	};
case 6: {
	_unit addvest "V_TacVest_khk";
	};
case 7: {
	_unit addvest "V_ChestrigB_rgr";
	};
case 8: {
	_unit addvest "V_PlateCarrierGL_rgr";
	};
case 9: {
	_unit addvest "V_PlateCarrier1_cbr";
	};
};

//---------- Eyewear --------------------|

_eyewear = (ceil (random 5));

switch (_eyewear ) do 
{
case 0: {
	_unit addGoggles "G_Shades_Black";
	};
case 1: {
	_unit addGoggles "G_Shades_Blue";
	};
case 2: {
	_unit addGoggles "G_Sport_Blackred";
	};
case 3: {
	_unit addGoggles "G_Tatical_Clear";
	};
};

//---------- Helmet/Hat -----------------|

_hat = (ceil (random 5));

switch (_hat ) do 
{
case 0: {
	_unit addheadgear "H_Cap_brn_SERO";
	};
case 1: {
	_unit addheadgear "H_Cap_blu";
	};
case 2: {
	_unit addheadgear "H_Cap_red";
	};
case 3: {
	_unit addheadgear "H_Cap_headphones";
	};
};

//---------- Extra Items ----------------|

_items = (ceil (random 7));

switch (_items ) do 
{
case 0: {
	_unit addItem "FirstAidKit";
	};
case 1: {
	_unit addItem "FirstAidKit";
	_unit addItem "ItemMap";
	_unit assignItem "ItemMap";
	_unit addItem "ItemCompass";
	_unit assignItem "ItemCompass";
	_unit addItem "ItemWatch";
	_unit assignItem "ItemWatch";
	};
case 2: {
	_unit addItem "FirstAidKit";
	_unit addItem "ItemMap";
	_unit assignItem "ItemMap";
	};
case 3: {
	_unit addItem "ItemWatch";
	_unit assignItem "ItemWatch";
	_unit addItem "FirstAidKit";
	_unit addItem "ItemCompass";
	_unit assignItem "ItemCompass";
	};
case 4: {
	_unit addItem "ItemWatch";
	_unit assignItem "ItemWatch";
	_unit addItem "ItemCompass";
	_unit assignItem "ItemCompass";
	};
case 5: {
	_unit addItem "ItemMap";
	_unit assignItem "ItemMap";
	_unit addItem "ItemWatch";
	_unit assignItem "ItemWatch";
	};
case 6: {
	_unit addItem "ItemMap";
	_unit assignItem "ItemMap";
	_unit addItem "ItemCompass";
	_unit assignItem "ItemCompass";
	};
case 7: {
	_unit addItem "FirstAidKit";
	_unit addItem "ItemWatch";
	_unit assignItem "ItemWatch";
	};
};

//---------- Weapon ---------------------|

_weapon = (ceil (random 10));

switch (_weapon ) do 
{
case 0: {
	_unit addMagazines ["30Rnd_65x39_caseless_green",6];
	_unit addweapon "arifle_Khaybar_F";
	};
case 1: {
	_unit addMagazines ["30Rnd_65x39_caseless_green",6];
	_unit addweapon "arifle_Khaybar_C_F";
	};
case 2: {
	_unit addMagazines ["30Rnd_65x39_caseless_mag",6];
	_unit addweapon "arifle_MX_F";
	};
case 3: {
	_unit addMagazines ["30Rnd_65x39_caseless_mag",6];
	_unit addweapon "arifle_MXC_F";
	};
case 4: {
	_unit addMagazines ["20Rnd_762x45_Mag",6];
	_unit addweapon "arifle_MXM_F";
	};
case 5: {
	_unit addMagazines ["30Rnd_65x39_case_mag",6];
	_unit addweapon "arifle_TRG20_F";
	};
case 6: {
	_unit addMagazines ["30Rnd_65x39_case_mag",6];
	_unit addweapon "arifle_TRG21_F";
	};
case 7: {
	_unit addMagazines ["20Rnd_762x45_Mag",6];
	_unit addweapon "srifle_EBR_F";
	};
case 8: {
	_unit addMagazines ["30Rnd_556x45_Stanag",6];
	_unit addweapon "arifle_SDAR_F";
	};
case 9: {
	_unit addMagazines ["16Rnd_9x21_Mag",6];
	_unit addweapon "hgun_P07_F";
	};
case 10: {
	_unit addMagazines ["16Rnd_9x21_Mag",6];
	_unit addweapon "hgun_Rook40_F";
	};
};

//---------- Bonus 1 ----------|
// Chance to get a pistol if given a rifle

if (_weapon < 9) then 
{
_bonuswep = (ceil (random 7));

switch (_bonuswep ) do 
{
case 0: {
	_unit addMagazines ["16Rnd_9x21_Mag",3];
	_unit addweapon "hgun_P07_F";
	};
case 1: {
	_unit addMagazines ["16Rnd_9x21_Mag",3];
	_unit addweapon "hgun_Rook40_F";
	};
};
};

//---------- Bonus 2 ----------|
// Chance to get a weapon attachment if given a rifle

if (_weapon < 8) then 
{
_attachments = (ceil (random 6));

switch (_attachments ) do 
{
case 0: {
	_unit addPrimaryWeaponItem "optic_Holosight";
	};
case 1: {
	_unit addPrimaryWeaponItem "optic_Aco";
	};
case 2: {
	_unit addPrimaryWeaponItem "acc_flashlight";
	};
case 3: {
	_unit addPrimaryWeaponItem "acc_pointer_IR";
	};
};
};

//---------- Grenades -------------------|

_grenades = (ceil (random 12));

switch (_grenades ) do 
{
case 0: {
	_unit addMagazines ["HandGrenade",1];
	};
case 1: {
	_unit addMagazines ["HandGrenade",2];
	};
case 2: {
	_unit addMagazines ["SmokeShell",1];
	};
case 3: {
	_unit addMagazines ["SmokeShell",2];
	};
case 4: {
	_unit addMagazines ["HandGrenade",1];
	_unit addMagazines ["SmokeShell",1];
	};
};

//---------- Script Done ----------------|

When I can I'll test this with larger player counts but for now it seems to be working as expected. Fingers crossed.

Share this post


Link to post
Share on other sites

Hey I've been testing this out and the weapons match up ... I just respawn with no gear (i'm a noob at scripting, shouldn't nul run the script everytime you respawn?)

Share this post


Link to post
Share on other sites

To make it work for every respawn you could do this, not very nice looking but should work.

//---------- Script Start ---------------|

private ["_unit"];
_unit = _this select 0;

//---------------------------------------|
waitUntil {(player == _unit)};
//---------------------------------------|
while {true} do {
waitUntil{(alive _unit)};

// rest of script here

waitUntil{(!alive _unit)};
};

Share this post


Link to post
Share on other sites
Only thing now is the AI obviously spawn with nothing as they're not considered players! But this is a minor issue I can think up a workaround for later.

Was anyone able to solve the issue of generating the random items on AI? This code works great for players and i'd really like to apply this to my civilian AI as well.

Share this post


Link to post
Share on other sites

This simple modification should make it work for AI as well

//---------- Script Start ---------------|

private ["_unit"];
_unit = _this select 0;

while {true} do {
waitUntil{(alive _unit)};

if (!isServer) exitWith {};

removeAllAssignedItems _unit;
Removeuniform _unit;
Removevest _unit;
Removegoggles _unit;
Removeheadgear _unit;
Removeallweapons _unit;

//---------- Uniform --------------------|

_uniform = (ceil (random 9));

switch (_uniform ) do 
{
case 0: {
	_unit adduniform "U_C_Commoner1_1";
	};
case 1: {
	_unit adduniform "U_C_Commoner1_1";
	};
case 2: {
	_unit adduniform "U_C_Commoner1_2";
	};
case 3: {
	_unit adduniform "U_C_Commoner1_3";
	};
case 4: {
	_unit adduniform "U_C_Poloshirt_blue";
	};
case 5: {
	_unit adduniform "U_C_Poloshirt_burgundy";
	};
case 6: {
	_unit adduniform "U_C_Poloshirt_redwhite";
	};
case 7: {
	_unit adduniform "U_C_Poloshirt_salmon";
	};
case 8: {
	_unit adduniform "U_C_Poloshirt_stripped";
	};
case 9: {
	_unit adduniform "U_C_Poloshirt_tricolour";
	};
};

//---------- Body Armour ----------------|

_armour = (ceil (random 9));

switch (_armour ) do 
{
case 0: {
	_unit addvest "V_Chestrig_khk";
	};
case 1: {
	_unit addvest "V_BandollierB_rgr";
	};
case 2: {
	_unit addvest "V_BandollierB_cbr";
	};
case 3: {
	_unit addvest "V_BandollierB_khk";
	};
case 4: {
	_unit addvest "V_TacVest_brn";
	};
case 5: {
	_unit addvest "V_TacVest_oli";
	};
case 6: {
	_unit addvest "V_TacVest_khk";
	};
case 7: {
	_unit addvest "V_ChestrigB_rgr";
	};
case 8: {
	_unit addvest "V_PlateCarrierGL_rgr";
	};
case 9: {
	_unit addvest "V_PlateCarrier1_cbr";
	};
};

//---------- Eyewear --------------------|

_eyewear = (ceil (random 5));

switch (_eyewear ) do 
{
case 0: {
	_unit addGoggles "G_Shades_Black";
	};
case 1: {
	_unit addGoggles "G_Shades_Blue";
	};
case 2: {
	_unit addGoggles "G_Sport_Blackred";
	};
case 3: {
	_unit addGoggles "G_Tatical_Clear";
	};
};

//---------- Helmet/Hat -----------------|

_hat = (ceil (random 5));

switch (_hat ) do 
{
case 0: {
	_unit addheadgear "H_Cap_brn_SERO";
	};
case 1: {
	_unit addheadgear "H_Cap_blu";
	};
case 2: {
	_unit addheadgear "H_Cap_red";
	};
case 3: {
	_unit addheadgear "H_Cap_headphones";
	};
};

//---------- Extra Items ----------------|

_items = (ceil (random 7));

switch (_items ) do 
{
case 0: {
	_unit addItem "FirstAidKit";
	};
case 1: {
	_unit addItem "FirstAidKit";
	_unit addItem "ItemMap";
	_unit assignItem "ItemMap";
	_unit addItem "ItemCompass";
	_unit assignItem "ItemCompass";
	_unit addItem "ItemWatch";
	_unit assignItem "ItemWatch";
	};
case 2: {
	_unit addItem "FirstAidKit";
	_unit addItem "ItemMap";
	_unit assignItem "ItemMap";
	};
case 3: {
	_unit addItem "ItemWatch";
	_unit assignItem "ItemWatch";
	_unit addItem "FirstAidKit";
	_unit addItem "ItemCompass";
	_unit assignItem "ItemCompass";
	};
case 4: {
	_unit addItem "ItemWatch";
	_unit assignItem "ItemWatch";
	_unit addItem "ItemCompass";
	_unit assignItem "ItemCompass";
	};
case 5: {
	_unit addItem "ItemMap";
	_unit assignItem "ItemMap";
	_unit addItem "ItemWatch";
	_unit assignItem "ItemWatch";
	};
case 6: {
	_unit addItem "ItemMap";
	_unit assignItem "ItemMap";
	_unit addItem "ItemCompass";
	_unit assignItem "ItemCompass";
	};
case 7: {
	_unit addItem "FirstAidKit";
	_unit addItem "ItemWatch";
	_unit assignItem "ItemWatch";
	};
};

//---------- Weapon ---------------------|

_weapon = (ceil (random 10));

switch (_weapon ) do 
{
case 0: {
	_unit addMagazines ["30Rnd_65x39_caseless_green",6];
	_unit addweapon "arifle_Khaybar_F";
	};
case 1: {
	_unit addMagazines ["30Rnd_65x39_caseless_green",6];
	_unit addweapon "arifle_Khaybar_C_F";
	};
case 2: {
	_unit addMagazines ["30Rnd_65x39_caseless_mag",6];
	_unit addweapon "arifle_MX_F";
	};
case 3: {
	_unit addMagazines ["30Rnd_65x39_caseless_mag",6];
	_unit addweapon "arifle_MXC_F";
	};
case 4: {
	_unit addMagazines ["20Rnd_762x45_Mag",6];
	_unit addweapon "arifle_MXM_F";
	};
case 5: {
	_unit addMagazines ["30Rnd_65x39_case_mag",6];
	_unit addweapon "arifle_TRG20_F";
	};
case 6: {
	_unit addMagazines ["30Rnd_65x39_case_mag",6];
	_unit addweapon "arifle_TRG21_F";
	};
case 7: {
	_unit addMagazines ["20Rnd_762x45_Mag",6];
	_unit addweapon "srifle_EBR_F";
	};
case 8: {
	_unit addMagazines ["30Rnd_556x45_Stanag",6];
	_unit addweapon "arifle_SDAR_F";
	};
case 9: {
	_unit addMagazines ["16Rnd_9x21_Mag",6];
	_unit addweapon "hgun_P07_F";
	};
case 10: {
	_unit addMagazines ["16Rnd_9x21_Mag",6];
	_unit addweapon "hgun_Rook40_F";
	};
};

//---------- Bonus 1 ----------|
// Chance to get a pistol if given a rifle

if (_weapon < 9) then 
{
_bonuswep = (ceil (random 7));

switch (_bonuswep ) do 
{
case 0: {
	_unit addMagazines ["16Rnd_9x21_Mag",3];
	_unit addweapon "hgun_P07_F";
	};
case 1: {
	_unit addMagazines ["16Rnd_9x21_Mag",3];
	_unit addweapon "hgun_Rook40_F";
	};
};
};

//---------- Bonus 2 ----------|
// Chance to get a weapon attachment if given a rifle

if (_weapon < 8) then 
{
_attachments = (ceil (random 6));

switch (_attachments ) do 
{
case 0: {
	_unit addPrimaryWeaponItem "optic_Holosight";
	};
case 1: {
	_unit addPrimaryWeaponItem "optic_Aco";
	};
case 2: {
	_unit addPrimaryWeaponItem "acc_flashlight";
	};
case 3: {
	_unit addPrimaryWeaponItem "acc_pointer_IR";
	};
};
};

//---------- Grenades -------------------|

_grenades = (ceil (random 12));

switch (_grenades ) do 
{
case 0: {
	_unit addMagazines ["HandGrenade",1];
	};
case 1: {
	_unit addMagazines ["HandGrenade",2];
	};
case 2: {
	_unit addMagazines ["SmokeShell",1];
	};
case 3: {
	_unit addMagazines ["SmokeShell",2];
	};
case 4: {
	_unit addMagazines ["HandGrenade",1];
	_unit addMagazines ["SmokeShell",1];
	};
};

//---------- Script Done ----------------|

waitUntil{(!alive _unit)};
};

Share this post


Link to post
Share on other sites

Thanks!! This works great, the only problem is that some units start without a uniform (SOLVED: the random number must be 1 less than the number of "cases" available) and playable units start out swimming, even though they are on land, very strange (SOLVED: when playable units are moved to higher ground, they are not swimming).

Thoughts?

Edited by ZuluZulu

Share this post


Link to post
Share on other sites

While continuing to playtest I noticed that sometimes (and it's a rare occasion) a random player will spawn as if the script hasn't executed, and I have no idea why. It doesn't happen often enough to be too much of a bother, just would be nice it didn't happen at all!

In that latest code Tuliq is there any reason why you removed: waitUntil {(player == _unit)}; ?

I haven't tested it yet but I will try to tomorrow, just wondered what the switch in code would do (if anything) in terms of clientside execution and inconsistent items across players etc.

Share this post


Link to post
Share on other sites
While continuing to playtest I noticed that sometimes (and it's a rare occasion) a random player will spawn as if the script hasn't executed, and I have no idea why. It doesn't happen often enough to be too much of a bother, just would be nice it didn't happen at all!

In that latest code Tuliq is there any reason why you removed: waitUntil {(player == _unit)}; ?

I haven't tested it yet but I will try to tomorrow, just wondered what the switch in code would do (if anything) in terms of clientside execution and inconsistent items across players etc.

It is because I found it an ineffective check. Your whole script could actually be fixed by just adding a if (!isServer) exitWith {} command at the very start, because as it stated, then the script will exit if any clients try to run it. I overcomplicated things a bit. Everything should work fine as long as the server is the only one running the script for each player, which that if statement makes sure of.

Share this post


Link to post
Share on other sites

Having it run on the server, using the "isserver" check.. and using the global versions of add items (if they exist for that command.. for example "additemcargoglobal" exists) will fix most of your problems.

Right now, each client is generating a different random number than the other clients, causing the mismatch.

Share this post


Link to post
Share on other sites

Haven't had a chance to test the script with 'if (!isServer) exitWith {};' until now.

And any other player other than myself receives no gear.

I tried this before by surrounding the script with a 'if (isServer) then {' and I had the same result, I didn't think that an exitWith if !isServer would give different results - or if it did it wouldn't make any sense from what I understand.

So I'm back to the drawing board again then? Why can the server not just execute this code and give all units gear? It seems like if the code isn't executed on the client calling the script they don't receive anything.. And then as soon as you let each client run the code then everyone generates different numbers for each other and you run into inconsistencies.

Here is the code I'm using:

//---------- Script Start ---------------|

private ["_unit"];
_unit = _this select 0;

while {true} do 
{
waitUntil{(alive _unit)};

if (!isServer) exitWith {};

removeAllAssignedItems _unit;
Removeuniform _unit;
Removevest _unit;
Removegoggles _unit;
Removeheadgear _unit;
Removeallweapons _unit;

//---------- Uniform --------------------|

_uniform = (ceil (random 9));

switch (_uniform ) do 
{
case 0: {
	_unit adduniform "U_C_Commoner1_1";
	};
case 1: {
	_unit adduniform "U_C_Commoner1_1";
	};
case 2: {
	_unit adduniform "U_C_Commoner1_2";
	};
case 3: {
	_unit adduniform "U_C_Commoner1_3";
	};
case 4: {
	_unit adduniform "U_C_Poloshirt_blue";
	};
case 5: {
	_unit adduniform "U_C_Poloshirt_burgundy";
	};
case 6: {
	_unit adduniform "U_C_Poloshirt_redwhite";
	};
case 7: {
	_unit adduniform "U_C_Poloshirt_salmon";
	};
case 8: {
	_unit adduniform "U_C_Poloshirt_stripped";
	};
case 9: {
	_unit adduniform "U_C_Poloshirt_tricolour";
	};
};

//---------- Body Armour ----------------|

_armour = (ceil (random 9));

switch (_armour ) do 
{
case 0: {
	_unit addvest "V_Chestrig_khk";
	};
case 1: {
	_unit addvest "V_BandollierB_rgr";
	};
case 2: {
	_unit addvest "V_BandollierB_cbr";
	};
case 3: {
	_unit addvest "V_BandollierB_khk";
	};
case 4: {
	_unit addvest "V_TacVest_brn";
	};
case 5: {
	_unit addvest "V_TacVest_oli";
	};
case 6: {
	_unit addvest "V_TacVest_khk";
	};
case 7: {
	_unit addvest "V_ChestrigB_rgr";
	};
case 8: {
	_unit addvest "V_PlateCarrierGL_rgr";
	};
case 9: {
	_unit addvest "V_PlateCarrier1_cbr";
	};
};

//---------- Eyewear --------------------|

_eyewear = (ceil (random 5));

switch (_eyewear ) do 
{
case 0: {
	_unit addGoggles "G_Shades_Black";
	};
case 1: {
	_unit addGoggles "G_Shades_Blue";
	};
case 2: {
	_unit addGoggles "G_Sport_Blackred";
	};
case 3: {
	_unit addGoggles "G_Tatical_Clear";
	};
};

//---------- Helmet/Hat -----------------|

_hat = (ceil (random 5));

switch (_hat ) do 
{
case 0: {
	_unit addheadgear "H_Cap_brn_SERO";
	};
case 1: {
	_unit addheadgear "H_Cap_blu";
	};
case 2: {
	_unit addheadgear "H_Cap_red";
	};
case 3: {
	_unit addheadgear "H_Cap_headphones";
	};
};

//---------- Extra Items ----------------|

_items = (ceil (random 7));

switch (_items ) do 
{
case 0: {
	_unit addItem "FirstAidKit";
	};
case 1: {
	_unit addItem "FirstAidKit";
	_unit addItem "ItemMap";
	_unit assignItem "ItemMap";
	_unit addItem "ItemCompass";
	_unit assignItem "ItemCompass";
	_unit addItem "ItemWatch";
	_unit assignItem "ItemWatch";
	};
case 2: {
	_unit addItem "FirstAidKit";
	_unit addItem "ItemMap";
	_unit assignItem "ItemMap";
	};
case 3: {
	_unit addItem "ItemWatch";
	_unit assignItem "ItemWatch";
	_unit addItem "FirstAidKit";
	_unit addItem "ItemCompass";
	_unit assignItem "ItemCompass";
	};
case 4: {
	_unit addItem "ItemWatch";
	_unit assignItem "ItemWatch";
	_unit addItem "ItemCompass";
	_unit assignItem "ItemCompass";
	};
case 5: {
	_unit addItem "ItemMap";
	_unit assignItem "ItemMap";
	_unit addItem "ItemWatch";
	_unit assignItem "ItemWatch";
	};
case 6: {
	_unit addItem "ItemMap";
	_unit assignItem "ItemMap";
	_unit addItem "ItemCompass";
	_unit assignItem "ItemCompass";
	};
case 7: {
	_unit addItem "FirstAidKit";
	_unit addItem "ItemWatch";
	_unit assignItem "ItemWatch";
	};
};

//---------- Weapon ---------------------|

_weapon = (ceil (random 10));

switch (_weapon ) do 
{
case 0: {
	_unit addMagazines ["30Rnd_65x39_caseless_green",6];
	_unit addweapon "arifle_Khaybar_F";
	};
case 1: {
	_unit addMagazines ["30Rnd_65x39_caseless_green",6];
	_unit addweapon "arifle_Khaybar_C_F";
	};
case 2: {
	_unit addMagazines ["30Rnd_65x39_caseless_mag",6];
	_unit addweapon "arifle_MX_F";
	};
case 3: {
	_unit addMagazines ["30Rnd_65x39_caseless_mag",6];
	_unit addweapon "arifle_MXC_F";
	};
case 4: {
	_unit addMagazines ["20Rnd_762x45_Mag",6];
	_unit addweapon "arifle_MXM_F";
	};
case 5: {
	_unit addMagazines ["30Rnd_65x39_case_mag",6];
	_unit addweapon "arifle_TRG20_F";
	};
case 6: {
	_unit addMagazines ["30Rnd_65x39_case_mag",6];
	_unit addweapon "arifle_TRG21_F";
	};
case 7: {
	_unit addMagazines ["20Rnd_762x45_Mag",6];
	_unit addweapon "srifle_EBR_F";
	};
case 8: {
	_unit addMagazines ["30Rnd_556x45_Stanag",6];
	_unit addweapon "arifle_SDAR_F";
	};
case 9: {
	_unit addMagazines ["16Rnd_9x21_Mag",6];
	_unit addweapon "hgun_P07_F";
	};
case 10: {
	_unit addMagazines ["16Rnd_9x21_Mag",6];
	_unit addweapon "hgun_Rook40_F";
	};
};

//---------- Bonus 1 ----------|
// Chance to get a pistol if given a rifle

if (_weapon < 9) then 
{
_bonuswep = (ceil (random 7));

switch (_bonuswep ) do 
{
case 0: {
	_unit addMagazines ["16Rnd_9x21_Mag",3];
	_unit addweapon "hgun_P07_F";
	};
case 1: {
	_unit addMagazines ["16Rnd_9x21_Mag",3];
	_unit addweapon "hgun_Rook40_F";
	};
};
};

//---------- Bonus 2 ----------|
// Chance to get a weapon attachment if given a rifle

if (_weapon < 8) then 
{
_attachments = (ceil (random 6));

switch (_attachments ) do 
{
case 0: {
	_unit addPrimaryWeaponItem "optic_Holosight";
	};
case 1: {
	_unit addPrimaryWeaponItem "optic_Aco";
	};
case 2: {
	_unit addPrimaryWeaponItem "acc_flashlight";
	};
case 3: {
	_unit addPrimaryWeaponItem "acc_pointer_IR";
	};
};
};

//---------- Grenades -------------------|

_grenades = (ceil (random 12));

switch (_grenades ) do 
{
case 0: {
	_unit addMagazines ["HandGrenade",1];
	};
case 1: {
	_unit addMagazines ["HandGrenade",2];
	};
case 2: {
	_unit addMagazines ["SmokeShell",1];
	};
case 3: {
	_unit addMagazines ["SmokeShell",2];
	};
case 4: {
	_unit addMagazines ["HandGrenade",1];
	_unit addMagazines ["SmokeShell",1];
	};
};

//---------- Script Done ----------------|

waitUntil{(!alive _unit)};
};

-Edit:

and using the global versions of add items (if they exist for that command.. for example "additemcargoglobal" exists) will fix most of your problems.

There is no addweaponglobal command

Edited by Phal
edit code

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  

×