halfbarrell

Custom Loadouts for players?

10 posts in this topic

This may have been discussed before but has anyone developed a custom starting loadout script (by player uid) yet?  I remember seeing that someone was working on something a while back that had drop downs and such.  Even something similar to what we had in our arma 2 server would be awesome.

Share this post


Link to post
Share on other sites
if((getPlayerUID player) in ["xxx","xxx","xxx"])then {
    RemoveAllWeapons player;
    {player removeMagazine _x;} foreach (magazines player);
    removeUniform player;
    removeVest player;
    removeBackpack player;
    removeGoggles player;
    removeHeadGear player;
    {
        player unassignItem _x;
        player removeItem _x;
    } foreach (assignedItems player);

    if(hmd player != "") then {
        player unlinkItem (hmd player);
    };
	player forceAddUniform "xxx";
	player addVest "xxx";
	player addBackPack "xxx";
	player addMagazine "xxx";
	player addWeapon "xxx";
	player addItem "ItemMap";
	player assignItem "ItemMap";
	player addItem "ItemRadio";
	player assignItem "ItemRadio";
	player addItem "ItemCompass";
	player assignItem "ItemCompass";
};

Maybe add something like this into bambi state begin? 

Share this post


Link to post
Share on other sites
Advertisement
18 hours ago, halfbarrell said:

does this work?  i am not a scripter by any means.  i rely on you smart folks work to make my server awesome lol

 

It should if you configure it correctly :) you only start editing the items you want in the players inventory at  player forceAddUniform "xxx";

although i don't think it will work, so use this one:

if((getPlayerUID player) in ["xxx","xxx","xxx"])then {
	RemoveAllWeapons player;
	{player removeMagazine _x;} foreach (magazines player);
	removeUniform player;
	removeVest player;
	removeBackpack player;
    removeGoggles player;
    removeHeadGear player;
	if(hmd player != "") then {
		player unlinkItem (hmd player);
	};
	{
		player unassignItem _x;
		player removeItem _x;
	} foreach (assignedItems player);
	player forceAddUniform "xxx";
	player addVest "xxx";
	player addBackPack "xxx";
	player addMagazine "xxx";
	player addWeapon "xxx";
	player addItem "ItemMap";
	player assignItem "ItemMap";
	player addItem "ItemRadio";
	player assignItem "ItemRadio";
	player addItem "ItemCompass";
	player assignItem "ItemCompass";
};

 

Edited by †RiH† Stokes
  • Like 1

Share this post


Link to post
Share on other sites
7 hours ago, †RiH† Stokes said:

It should if you configure it correctly :) you only start editing the items you want in the players inventory at  player forceAddUniform "xxx";

although i don't think it will work, so use this one:


if((getPlayerUID player) in ["xxx","xxx","xxx"])then {
	RemoveAllWeapons player;
	{player removeMagazine _x;} foreach (magazines player);
	removeUniform player;
	removeVest player;
	removeBackpack player;
    removeGoggles player;
    removeHeadGear player;
	if(hmd player != "") then {
		player unlinkItem (hmd player);
	};
	{
		player unassignItem _x;
		player removeItem _x;
	} foreach (assignedItems player);
	player forceAddUniform "xxx";
	player addVest "xxx";
	player addBackPack "xxx";
	player addMagazine "xxx";
	player addWeapon "xxx";
	player addItem "ItemMap";
	player assignItem "ItemMap";
	player addItem "ItemRadio";
	player assignItem "ItemRadio";
	player addItem "ItemCompass";
	player assignItem "ItemCompass";
};

 

AWESOME MAN I WANT TO TRY THIS ASAP!  Where does this go?  Any kind of install guidance would be fantastic!!

Share this post


Link to post
Share on other sites
4 hours ago, halfbarrell said:

AWESOME MAN I WANT TO TRY THIS ASAP!  Where does this go?  Any kind of install guidance would be fantastic!!

ExileClient_object_player_bambiStateBegin.sqf :)

Spoiler

/**
 * ExileClient_object_player_bambiStateBegin
 *
 * Exile Mod
 * exile.majormittens.co.uk
 * © 2015 Exile Mod Team
 *
 * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. 
 * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
 */
 
private["_duration"];
disableSerialization;
_duration = _this;
//LOADOUT
if((getPlayerUID player) in ["xxx","xxx","xxx"])then {
	RemoveAllWeapons player;
	{player removeMagazine _x;} foreach (magazines player);
	removeUniform player;
	removeVest player;
	removeBackpack player;
    removeGoggles player;
    removeHeadGear player;
	if(hmd player != "") then {
		player unlinkItem (hmd player);
	};
	{
		player unassignItem _x;
		player removeItem _x;
	} foreach (assignedItems player);
	player forceAddUniform "xxx";
	player addVest "xxx";
	player addBackPack "xxx";
	player addMagazine "xxx";
	player addWeapon "xxx";
	player addItem "ItemMap";
	player assignItem "ItemMap";
	player addItem "ItemRadio";
	player assignItem "ItemRadio";
	player addItem "ItemCompass";
	player assignItem "ItemCompass";
};
ExileClientPlayerIsBambi = true;
ExileClientPlayerBambiStateExpiresAt = time + _duration; 
true call ExileClient_gui_hud_toggleBambiIcon;
ExileClientEndBambiStateThread = [_duration, ExileClient_object_player_bambiStateEnd, [], true] call ExileClient_system_thread_addTask;
true

 

 

  • Like 2

Share this post


Link to post
Share on other sites
On 2/22/2016 at 9:11 AM, halfbarrell said:

apologies but i cannot find bambistate begin anywhere. 

This is because its a serverside file that you need to override by placing it in your mission file, you must go into the exile_server.pbo/code/ExileClient_object_player_bambiStateBegin.sqf

copy this file into your mission side pbo somewhere, I would recommend you put it in a folder called overrides. and then call it using the exec custom code block in your config.cpp if you still need help after this let me know and I will see what I can do. 

Share this post


Link to post
Share on other sites
24 minutes ago, Higgins909 said:

Sorry to kinda hijack thread, but how would you do this, rep based?  Also a bit confused on the first line of code.  Why are there all those xxxes?

Replace the xxxes with the item(s) you want players to spawn with. ;)

  • Like 1

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.