Jump to content

Custom Loadouts for Admins and Regular Players


MisterT

Recommended Posts

Not tested, but something like this should work for handling multiple different loadouts.

 

player addEventHandler["Respawn",fn_player_init];

fn_player_init = {

    waitUntil{(typename (getPlayerUID player) == "SCALAR")};

    private["_adminlist","_weapons","_magazines","_money"];

    _adminlist = ["888","999"];

    if(getPlayerUID player in _adminlist) then {
        private["_backpack","_backpack_items","_vest","_vest_items","_uniform"];
        _weapons        = ["srifle_EBR_F","hgun_Pistol_heavy_01_F","RPG32_F","NVG_EPOCH","ItemGPS","hgun_Pistol_heavy_01_F","RangeFinder","ItemCompass","ItemWatch","EpochRadio0","ItemMap","optic_tws_mg","muzzle_snds_B"];
        _magazines        = ["20Rnd_762x51_Mag","11Rnd_45ACP_Mag","launch_RPG32_F"]
        _backpack        = "B_Carryall_cbr"
        _backpack_items = ["ItemLockbox","20Rnd_762x51_Mag","20Rnd_762x51_Mag","11Rnd_45ACP_Mag","11Rnd_45ACP_Mag","CinderBlocks","CinderBlocks","CinderBlocks","CinderBlocks","CinderBlocks","ItemCorrugated","MortarBucket","launch_NLAW_F","launch_NLAW_F","HeatPack","ColdPack","FirstAidKit","MeleeSledge","Hatchet"];
        _vest            = "V_TacVest_camo";
        _vest_items        = ["10Rnd_762x51_Mag","10Rnd_762x51_Mag","11Rnd_45ACP_Mag","WhiskeyNoodle","ItemSodaOrangeSherbet","meatballs_epoch","sweetcorn_epoch","scam_epoch","ItemSodaRbull","ItemSodaRbull"];
        _uniform        = "U_O_GhillieSuit";
        _money            = 30000;
    } else {
        private["_num_loadouts","_dice"];
        _num_loadouts = 5;
        _dice = floor(random(_num_loadouts));
        if(_dice == 5) then { _dice = 4 };

        call {
            if(_dice == 0) exitWith {
                _weapons     = ["ItemMap"];
                _money        = 25;
            };
            if(_dice == 1) exitWith {
                _weapons     = ["EpochRadio0","ItemMap"];
                _money        = 50;
            };
            if(_dice == 2) exitWith {
                _weapons     = ["EpochRadio0","ItemMap","hgun_Pistol_heavy_01_F"];
                _magazines    = ["11Rnd_45ACP_Mag"];    
                _money        = 100;
            };
            if(_dice == 3) exitWith {
                _weapons     = ["EpochRadio0","ItemMap","hgun_Pistol_heavy_01_F"];
                _magazines    = ["11Rnd_45ACP_Mag","11Rnd_45ACP_Mag"];    
                _money        = 200;
            };
            if(_dice == 4) exitWith {
                _weapons     = ["EpochRadio0","ItemMap","hgun_Pistol_heavy_01_F"];
                _magazines    = ["11Rnd_45ACP_Mag","11Rnd_45ACP_Mag","11Rnd_45ACP_Mag"];    
                _money        = 300;
            };
        };
    };

    if(!isNil "_weapons" && typeName _weapons == "ARRAY") then {
        {
            player addWeapon _x;
        } forEach _weapons;
    };

    if(!isNil "_magazines" && typeName _magazines == "ARRAY") then {
        {
            player addMagazine _x;
        } forEach _magazines;
    };

    if(!isNil "_backpack" && typeName _backpack == "STRING") then {
        player addBackpack _backpack;
        if(!isNil "_backpack_items" && typeName _backpack_items == "ARRAY") then {
            {
                player addItemToBackpack _x;
            } forEach _backpack_items;
        };
    };

    if(!isNil "_vest" && typeName _vest == "STRING") then {
        player addVest _vest;
        if(!isNil "_vest_items" && typeName _vest_items == "ARRAY") then {
            {
                player addItemtoVest _x;
            } forEach _vest_items;
        };
    };

    if(!isNil "_uniform" && typeName _uniform == "STRING") then {
        player forceAddUniform _uniform;
    };

    if(!isNil "_money" && typeName _money == "SCALAR") then {
        EPOCH_playerCrypto = _money;
    };
};

Link to comment
Share on other sites

I've edited the mission.sqm with eliteness:

class Item2
		{
			side = "CIV";
			class Vehicles
			{
				items = 1;
				class Item0
				{
					position[] = {1025.3479,5.8627834,2021.8309};
					azimut = 153.62447;
					special = "NONE";
					id = 2;
					side = "CIV";
					vehicle = "VirtualMan_EPOCH";
					player = "PLAY CDG";
					leader = 1;
					skill = 0.6;
					init="if (isServer) then {execVM '\scripts\admin.sqf';};"; 
				};
			};
		};

Dont work for me :(

Link to comment
Share on other sites

Okay got it workin properly and have my admins defined. However like it was stated above, this only loads up upon the restart handler. We'd need to add in the fn_clientinit.sqf or EPOCH_load_playerPVS public variable as well for the first time players to receive the loadout?

Link to comment
Share on other sites

If I wanted to spawn new players with clothes, would I be able to do it with this? I don't have any desire to give new players anything else, but I think the underwear thing is a bit ridiculous.

 

I feel the same way as you, 

so this is what i did to the script.

 

(should go without saying, but edit scripts.txt 

7 forceAddUniform !"U_C_Poor_1"
if (!isServer) then {
	waitUntil {!isNull player};
	waitUntil {player == player};
	
	while {true} do {_player = player;
			player addEventHandler ["Respawn", 
				{
					player addVest "V_41_EPOCH";				
					player forceAddUniform "U_C_Poor_1";
					player addWeapon "ItemMap";
					player addWeapon "ItemCompass";
					player addWeapon "ItemWatch";
				}
			];
		waitUntil {_player != player};
	};
};
Link to comment
Share on other sites

 

I feel the same way as you, 

so this is what i did to the script.

 

(should go without saying, but edit scripts.txt 

7 forceAddUniform !"U_C_Poor_1"
if (!isServer) then {
	waitUntil {!isNull player};
	waitUntil {player == player};
	
	while {true} do {_player = player;
			player addEventHandler ["Respawn", 
				{
					player addVest "V_41_EPOCH";				
					player forceAddUniform "U_C_Poor_1";
					player addWeapon "ItemMap";
					player addWeapon "ItemCompass";
					player addWeapon "ItemWatch";
				}
			];
		waitUntil {_player != player};
	};
};

 

 

 

look at you go!

Link to comment
Share on other sites

Dont know what's wrong, but it don't works for me.

 

Here my init.sqf:

//Loadouts
player addEventHandler["Respawn",fn_player_init];

fn_player_init = {

    waitUntil{(typename (getPlayerUID player) == "SCALAR")};

    private["_adminlist","_weapons","_magazines","_money"];

    _adminlist = ["7656XXXXXXXXXXXX"];

    if(getPlayerUID player in _adminlist) then {
        private["_backpack","_backpack_items","_vest","_vest_items","_uniform"];
        _weapons        = ["srifle_EBR_F","hgun_Pistol_heavy_01_F","RPG32_F","NVG_EPOCH","ItemGPS","hgun_Pistol_heavy_01_F","RangeFinder","ItemCompass","ItemWatch","EpochRadio0","ItemMap","optic_tws_mg","muzzle_snds_B"];
        _magazines        = ["20Rnd_762x51_Mag","11Rnd_45ACP_Mag","launch_RPG32_F"]
        _backpack        = "B_Carryall_cbr"
        _backpack_items = ["ItemLockbox","20Rnd_762x51_Mag","20Rnd_762x51_Mag","11Rnd_45ACP_Mag","11Rnd_45ACP_Mag","CinderBlocks","CinderBlocks","CinderBlocks","CinderBlocks","CinderBlocks","ItemCorrugated","MortarBucket","launch_NLAW_F","launch_NLAW_F","HeatPack","ColdPack","FirstAidKit","MeleeSledge","Hatchet"];
        _vest            = "V_TacVest_camo";
        _vest_items        = ["10Rnd_762x51_Mag","10Rnd_762x51_Mag","11Rnd_45ACP_Mag","WhiskeyNoodle","ItemSodaOrangeSherbet","meatballs_epoch","sweetcorn_epoch","scam_epoch","ItemSodaRbull","ItemSodaRbull"];
        _uniform        = "U_O_GhillieSuit";
        _money            = 30000;
    } else {
        private["_num_loadouts","_dice"];
        _num_loadouts = 5;
        _dice = floor(random(_num_loadouts));
        if(_dice == 5) then { _dice = 4 };

        call {
            if(_dice == 0) exitWith {
                _weapons     = ["ItemMap"];
                _money        = 25;
            };
            if(_dice == 1) exitWith {
                _weapons     = ["EpochRadio0","ItemMap"];
                _money        = 50;
            };
            if(_dice == 2) exitWith {
                _weapons     = ["EpochRadio0","ItemMap","hgun_Pistol_heavy_01_F"];
                _magazines    = ["11Rnd_45ACP_Mag"];    
                _money        = 100;
            };
            if(_dice == 3) exitWith {
                _weapons     = ["EpochRadio0","ItemMap","hgun_Pistol_heavy_01_F"];
                _magazines    = ["11Rnd_45ACP_Mag","11Rnd_45ACP_Mag"];    
                _money        = 200;
            };
            if(_dice == 4) exitWith {
                _weapons     = ["EpochRadio0","ItemMap","hgun_Pistol_heavy_01_F"];
                _magazines    = ["11Rnd_45ACP_Mag","11Rnd_45ACP_Mag","11Rnd_45ACP_Mag"];    
                _money        = 300;
            };
        };
    };

    if(!isNil "_weapons" && typeName _weapons == "ARRAY") then {
        {
            player addWeapon _x;
        } forEach _weapons;
    };

    if(!isNil "_magazines" && typeName _magazines == "ARRAY") then {
        {
            player addMagazine _x;
        } forEach _magazines;
    };

    if(!isNil "_backpack" && typeName _backpack == "STRING") then {
        player addBackpack _backpack;
        if(!isNil "_backpack_items" && typeName _backpack_items == "ARRAY") then {
            {
                player addItemToBackpack _x;
            } forEach _backpack_items;
        };
    };

    if(!isNil "_vest" && typeName _vest == "STRING") then {
        player addVest _vest;
        if(!isNil "_vest_items" && typeName _vest_items == "ARRAY") then {
            {
                player addItemtoVest _x;
            } forEach _vest_items;
        };
    };

    if(!isNil "_uniform" && typeName _uniform == "STRING") then {
        player forceAddUniform _uniform;
    };

    if(!isNil "_money" && typeName _money == "SCALAR") then {
        EPOCH_playerCrypto = _money;
    };
};

//AI Mission
if(isDedicated)exitWith{};

fn_createMissionMarker = {	private["_create","_markerPos","_markerName","_marker"];
	_create = _this select 0;
	
	if(!_create)then[{	//delete marker
		if (getMarkerColor "MissionMarker" != "")then{	//Only delete existing Marker
			deleteMarkerLocal "MissionMarker";
		}; 
	},{	//else create marker
	_markerPos = _this select 1;
	_markerName = _this select 2;
	
	_marker = createMarkerLocal ["MissionMarker", _markerPos];
	_marker setMarkerPosLocal _markerPos;
	_marker setMarkerTypeLocal "mil_destroy";  
	_marker setMarkerTextLocal format["%1",_markerName];  
	_marker setMarkerColorLocal "ColorRed";
	_marker setMarkerDirLocal -37;
	_marker setMarkerSizeLocal [1.2,1.2];
	}];
};

if(!isNil "GlobalMissionMarker")then{GlobalMissionMarker call fn_createMissionMarker};
"GlobalMissionMarker" addPublicVariableEventHandler {_this select 1 call fn_createMissionMarker};
"GlobalHint" addPublicVariableEventHandler {hint parseText format["%1", _this select 1]};

if(toLower worldName in ["chernarus","chernarus_summer"])then{
	([4654.62,9593.63,0] nearestObject 145259) setDamage 1;
	([4654.62,9593.63,0] nearestObject 145260) setDamage 1;
};	//Fix for something, find out ;)

Also the first post dont work :(

Link to comment
Share on other sites

Im currently using this one for random starter loadouts for player respawns. except mine comes with the 'B_parachute' as a constant in the backpack slot for all players, due to a halospawn script im running. But the concept is all there.

private ["_player"];
if (!isServer) then {
	waitUntil {!isNull player};
	waitUntil {player == player};
	
	while {true} do {
		_player = player;
		player addEventHandler ["Respawn", {
			_PistolANDmag = [["hgun_Pistol_Signal_F","6Rnd_GreenSignal_F"],["hgun_Pistol_Signal_F","6Rnd_RedSignal_F"],["hgun_Pistol_heavy_02_Yorris_F","6Rnd_45ACP_Cylinder"],["hgun_Pistol_heavy_02_F","6Rnd_45ACP_Cylinder"],["hgun_Pistol_heavy_01_MRD_F","11Rnd_45ACP_Mag"],["hgun_Pistol_heavy_01_snds_F","11Rnd_45ACP_Mag"],["hgun_Pistol_heavy_01_F","11Rnd_45ACP_Mag"],["hgun_ACPC2_snds_F","9Rnd_45ACP_Mag"],["hgun_ACPC2_F","9Rnd_45ACP_Mag"],["hgun_Rook40_snds_F","16Rnd_9x21_Mag"],["hgun_Rook40_F","16Rnd_9x21_Mag"],["hgun_P07_snds_F","16Rnd_9x21_Mag"],["hgun_P07_F","16Rnd_9x21_Mag"]] call BIS_fnc_selectRandom;
			_pistol = _PistolANDmag select 0;
			_mag = _PistolANDmag select 1;
			_item = "FAK";
			_food = ["CookedSheep_EPOCH","CookedGoat_EPOCH","CookedChicken_EPOCH","CookedRabbit_EPOCH","ItemTunaCooked","ItemSeaBassCooked","ItemTroutCooked","FoodSnooter","FoodMeeps"] call BIS_fnc_selectRandom;
			_drink = ["ItemSodaRbull","ItemSodaOrangeSherbet","ItemSodaPurple","ItemSodaMocha","ItemSodaBurst","FoodWalkNSons","WhiskeyNoodle"] call BIS_fnc_selectRandom;
			_uniform = ["U_C_Driver_4","U_C_Driver_3","U_C_Driver_2","U_C_Driver_1","U_C_Scientist","U_C_Journalist","U_C_WorkerCoveralls","U_C_Poor_1","U_C_Poloshirt_redwhite","U_C_Poloshirt_salmon","U_C_Poloshirt_tricolour","U_C_Poloshirt_burgundy","U_C_Poloshirt_blue","U_C_Poloshirt_stripped"] call BIS_fnc_selectRandom;
			_vest = ["V_16_EPOCH","V_15_EPOCH","V_14_EPOCH","V_13_EPOCH","V_12_EPOCH","V_11_EPOCH","V_10_EPOCH","V_9_EPOCH","V_8_EPOCH","V_7_EPOCH","V_6_EPOCH","V_5_EPOCH","V_4_EPOCH","V_3_EPOCH","V_2_EPOCH","V_1_EPOCH"] call BIS_fnc_selectRandom;
			hint format [" %1 \n %2 \n %3 \n %4 \n %5 \n %6 \n %7",_pistol,_mag,_item,_food,_drink,_uniform,_vest];
			player addVest _vest;
			player addWeapon _pistol;
			player addMagazine _mag;
			player addMagazine _item;
			player addMagazine _food;
			player addMagazine _drink;
			player forceAddUniform _uniform;
		}]; waitUntil {_player != player}; 
	}; 
};
Link to comment
Share on other sites

 

Im currently using this one for random starter loadouts for player respawns. except mine comes with the 'B_parachute' as a constant in the backpack slot for all players, due to a halospawn script im running. But the concept is all there.

private ["_player"];
if (!isServer) then {
	waitUntil {!isNull player};
	waitUntil {player == player};
	
	while {true} do {
		_player = player;
		player addEventHandler ["Respawn", {
			_PistolANDmag = [["hgun_Pistol_Signal_F","6Rnd_GreenSignal_F"],["hgun_Pistol_Signal_F","6Rnd_RedSignal_F"],["hgun_Pistol_heavy_02_Yorris_F","6Rnd_45ACP_Cylinder"],["hgun_Pistol_heavy_02_F","6Rnd_45ACP_Cylinder"],["hgun_Pistol_heavy_01_MRD_F","11Rnd_45ACP_Mag"],["hgun_Pistol_heavy_01_snds_F","11Rnd_45ACP_Mag"],["hgun_Pistol_heavy_01_F","11Rnd_45ACP_Mag"],["hgun_ACPC2_snds_F","9Rnd_45ACP_Mag"],["hgun_ACPC2_F","9Rnd_45ACP_Mag"],["hgun_Rook40_snds_F","16Rnd_9x21_Mag"],["hgun_Rook40_F","16Rnd_9x21_Mag"],["hgun_P07_snds_F","16Rnd_9x21_Mag"],["hgun_P07_F","16Rnd_9x21_Mag"]] call BIS_fnc_selectRandom;
			_pistol = _PistolANDmag select 0;
			_mag = _PistolANDmag select 1;
			_item = "FAK";
			_food = ["CookedSheep_EPOCH","CookedGoat_EPOCH","CookedChicken_EPOCH","CookedRabbit_EPOCH","ItemTunaCooked","ItemSeaBassCooked","ItemTroutCooked","FoodSnooter","FoodMeeps"] call BIS_fnc_selectRandom;
			_drink = ["ItemSodaRbull","ItemSodaOrangeSherbet","ItemSodaPurple","ItemSodaMocha","ItemSodaBurst","FoodWalkNSons","WhiskeyNoodle"] call BIS_fnc_selectRandom;
			_uniform = ["U_C_Driver_4","U_C_Driver_3","U_C_Driver_2","U_C_Driver_1","U_C_Scientist","U_C_Journalist","U_C_WorkerCoveralls","U_C_Poor_1","U_C_Poloshirt_redwhite","U_C_Poloshirt_salmon","U_C_Poloshirt_tricolour","U_C_Poloshirt_burgundy","U_C_Poloshirt_blue","U_C_Poloshirt_stripped"] call BIS_fnc_selectRandom;
			_vest = ["V_16_EPOCH","V_15_EPOCH","V_14_EPOCH","V_13_EPOCH","V_12_EPOCH","V_11_EPOCH","V_10_EPOCH","V_9_EPOCH","V_8_EPOCH","V_7_EPOCH","V_6_EPOCH","V_5_EPOCH","V_4_EPOCH","V_3_EPOCH","V_2_EPOCH","V_1_EPOCH"] call BIS_fnc_selectRandom;
			hint format [" %1 \n %2 \n %3 \n %4 \n %5 \n %6 \n %7",_pistol,_mag,_item,_food,_drink,_uniform,_vest];
			player addVest _vest;
			player addWeapon _pistol;
			player addMagazine _mag;
			player addMagazine _item;
			player addMagazine _food;
			player addMagazine _drink;
			player forceAddUniform _uniform;
		}]; waitUntil {_player != player}; 
	}; 
};

 Okay jumped over this one :D It works for me... thank you for that! Love it ;)

Link to comment
Share on other sites

I have a random uniform role on my server, part of a spawn selection system but the same method could be applied to any item/weapon using BIS_fnc_selectRandom

Default_Loadout is simply a call compile to a loadout definition file and when the skin is added it calls the loadout for respawns, one thing that we need to get is a freshspawn variable, one for when a player loads in for the first time, not respawns after dying

Heres my random uniform role file

EDIT: The reason for storing classnames in variables in this instance is to make it easier changing things in my opinion :D
 

_UniOne = "U_O_CombatUniform_ocamo";
_UniTwo = "U_O_GhillieSuit";
_UniThree = "U_O_PilotCoveralls";
_UniFour = "U_O_Wetsuit";
_UniFive = "U_OG_Guerilla1_1";
_UniSix = "U_OG_Guerilla2_1";
_UniSeven = "U_OG_Guerilla2_2";
_UniEight = "U_OG_Guerilla2_3";
_UniNine = "U_OG_Guerilla3_1";
_UniTen = "U_OG_Guerilla3_2";
_UniEleven = "U_OG_leader";
_UniTwelve = "U_C_Poloshirt_stripped";
_UniThirteen = "U_C_Poloshirt_blue";

_UniWOne = "U_BasicBodyFemale";
_UniWTwo = "U_Wetsuit_uniform";
_UniWThree = "U_Wetsuit_White";
_UniWFour = "U_Wetsuit_Blue";
_UniWFive = "U_Wetsuit_Purp";
_UniWSix = "U_Wetsuit_Camo";
_UniWSeven = "U_Camo_uniform";
_UniWEight = "U_ghillie1_uniform";
_UniWNine = "U_ghillie2_uniform";
_UniWTen = "U_ghillie3_uniform";
_UniWEleven = "U_CamoBlue_uniform";
_UniWTwelve = "U_CamoBrn_uniform";
_UniWThirteen = "U_CamoRed_uniform";


_modelMale = (typeOF player == "Epoch_Male_F");
_modelFemale = (typeOF player == "Epoch_Female_F");

if (_modelMale) then {
	_KamiUniform = [_UniOne,_UniTwo,_UniThree,_UniFour,_UniFive,_UniSix,_UniSeven,_UniEight,_UniNine,_UniTen,_UniEleven,_UniTwelve,_UniThirteen] call BIS_fnc_selectRandom; 
	player forceAddUniform _KamiUniform;
};
if (_modelFemale) then {
	_KamiUniform = [_UniWOne,_UniWTwo,_UniWThree,_UniWFour,_UniWFive,_UniWSix,_UniWSeven,_UniWEight,_UniWNine,_UniWTen,_UniWEleven,_UniWTwelve,_UniWThirteen] call BIS_fnc_selectRandom;
	player forceAddUniform _KamiUniform;
};
call Default_Loadout;
systemChat ('Random Uniform Selected');
cutText ["                 \nRandom Uniform Selected","PLAIN"];
Link to comment
Share on other sites

 

I have a random uniform role on my server, part of a spawn selection system but the same method could be applied to any item/weapon using BIS_fnc_selectRandom

Default_Loadout is simply a call compile to a loadout definition file and when the skin is added it calls the loadout for respawns, one thing that we need to get is a freshspawn variable, one for when a player loads in for the first time, not respawns after dying

Heres my random uniform role file

EDIT: The reason for storing classnames in variables in this instance is to make it easier changing things in my opinion :D

 

_UniOne = "U_O_CombatUniform_ocamo";
_UniTwo = "U_O_GhillieSuit";
_UniThree = "U_O_PilotCoveralls";
_UniFour = "U_O_Wetsuit";
_UniFive = "U_OG_Guerilla1_1";
_UniSix = "U_OG_Guerilla2_1";
_UniSeven = "U_OG_Guerilla2_2";
_UniEight = "U_OG_Guerilla2_3";
_UniNine = "U_OG_Guerilla3_1";
_UniTen = "U_OG_Guerilla3_2";
_UniEleven = "U_OG_leader";
_UniTwelve = "U_C_Poloshirt_stripped";
_UniThirteen = "U_C_Poloshirt_blue";

_UniWOne = "U_BasicBodyFemale";
_UniWTwo = "U_Wetsuit_uniform";
_UniWThree = "U_Wetsuit_White";
_UniWFour = "U_Wetsuit_Blue";
_UniWFive = "U_Wetsuit_Purp";
_UniWSix = "U_Wetsuit_Camo";
_UniWSeven = "U_Camo_uniform";
_UniWEight = "U_ghillie1_uniform";
_UniWNine = "U_ghillie2_uniform";
_UniWTen = "U_ghillie3_uniform";
_UniWEleven = "U_CamoBlue_uniform";
_UniWTwelve = "U_CamoBrn_uniform";
_UniWThirteen = "U_CamoRed_uniform";


_modelMale = (typeOF player == "Epoch_Male_F");
_modelFemale = (typeOF player == "Epoch_Female_F");

if (_modelMale) then {
	_KamiUniform = [_UniOne,_UniTwo,_UniThree,_UniFour,_UniFive,_UniSix,_UniSeven,_UniEight,_UniNine,_UniTen,_UniEleven,_UniTwelve,_UniThirteen] call BIS_fnc_selectRandom; 
	player forceAddUniform _KamiUniform;
};
if (_modelFemale) then {
	_KamiUniform = [_UniWOne,_UniWTwo,_UniWThree,_UniWFour,_UniWFive,_UniWSix,_UniWSeven,_UniWEight,_UniWNine,_UniWTen,_UniWEleven,_UniWTwelve,_UniWThirteen] call BIS_fnc_selectRandom;
	player forceAddUniform _KamiUniform;
};
call Default_Loadout;
systemChat ('Random Uniform Selected');
cutText ["                 \nRandom Uniform Selected","PLAIN"];
execVM "SpaSel\Location_menu.sqf";

So assume you throw this in init.sqf or execvm to a sqf file?

Link to comment
Share on other sites

 

 

Essentially you could yes just run it using the respawn thing as in OP and then call this from there like this for EG

 

if (!isServer) then {
	waitUntil {!isNull player};
	waitUntil {player == player};
	
	while {true} do {
		_player = player;
		player addEventHandler ["Respawn", {
			execVM "custom\randomuni.sqf";
		}];
		waitUntil {_player != player};
	};
};

then have the code i first posted in a random uni file if you want loadouts then do a call compile from the init to a file with loadout defines

e.g

call compile preprocessFileLineNumbers "custom\LoadOuts.sqf";

in a if (!isDedicated) then { dedicated block

inside that sqf have

this lot for example

 

Default_Loadout = {
	player addWeapon "EpochRadio0"; // Basic User Loadouts
	player addWeapon "ItemMap";
	player addWeapon "hgun_Pistol_heavy_01_F";
	player addMagazine "11Rnd_45ACP_Mag";
	EPOCH_playerCrypto = 10;
};

and then as per my first post call Default_Loadout; (change Default_Loadout) to whatever you call your loadout

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Advertisement
×
×
  • Create New...