Jump to content
cobrosstuidos

Script to lock out player slots

Recommended Posts

Actually, if I am remembering correctly 1.50 filepatching is disabled. I believe you need to add this to the server.cfg file on the server too.

allowedFilePatching = 1;

Can you check it?

Yeah that is in my config.. Just really strange sure I am missing something simple.

Share this post


Link to post
Share on other sites

A number of different ways you can go about this, many of which have been discussed a number of times in this forum section.

Heres one.

Description.ext

class CfgDebriefing
{

	class NOT_ALLOWED
	{
		title = "This is a reserved slot.";
		description = "This is a reserved slot. Please rejoin using a different slot. Reserved slots are clearly marked on each units description in the lobby as ( Reserved )";
		picture = "";
	};
};
initServer.sqf

allowed = call compile preprocessFileLineNumbers "allowedIDs.txt";
initPlayerServer.sqf

_player = _this select 0;
_uid = getPlayerUID _player;

if ( _player getVariable [ "reserved", false ] && { !( _uid in allowed ) } ) then {
	[ [], "fnc_reservedSlot", _player ] call BIS_fnc_MP;
};
initPlayerLocal.sqf

fnc_reservedSlot = {
	player enableSimulationGlobal false;
	( "reserved" call BIS_fnc_rscLayer ) cutText [ "This is a reserved slot. Reserved slots are clearly marked in the lobby as ( Reserved ) . Please rejoin using a different slot.", "BLACK OUT", 1, true ];
	sleep 10;
	endMission "NOT_ALLOWED";
};
allowedIDs.txt << this file gets placed in the folder where your servers Arma3.exe is, it keeps the IDs private as they are not transmitted with the mission and can be updated for all your missions in one place.

//Fill the ARRAY with allowed UIDs - steam IDs
//Look something like "76566179256348507"
[  ];
Then in each units init that you want to be a reserved unit place

this setVariable [ "Reserved", true ]

You can also change their description by filling out the Description section in the insert unit dialog with something like

Group leader (Reserved)
So people know what units not to choose in the lobby.

 

nice one , was looking for this

Share this post


Link to post
Share on other sites

Hi,

I've just added this to my server, but i am having issues with the .txt file.

 

Should the txt file look like 

 

1.

//Fill the ARRAY with allowed UIDs - steam IDs

//Look something like "76566179256348507"
#################;

 

 

2.

//Fill the ARRAY with allowed UIDs - steam IDs
//Look something like "76566179256348507"
"#################";

 

3

//Fill the ARRAY with allowed UIDs - steam IDs
//Look something like "76566179256348507"
["#################];
 
 
 
Also, i don't own my own server. I pay to have it hosted. If i am not mistaken, i will not be able to place the .txt file into the root folder where the arma.exe is located.
Can i have some clarification on this as well?

I am very green in regards to this, so, any help will be greatly appreciated.

 

Share this post


Link to post
Share on other sites

Hi.

I have made a very easy method which used for my old clan (NatoTaskForce) and own hosted mission. Wanna share it since the map was recently "stolen" by a guy I'm not at good terms with and content used un-credited.

 

First the script, you can name it what you want. My standard name was "slotinit.sqf".

//Simplest Slot ini script by the Benmaster
//Simply just a name check, you don't want your GUID floating around out there
//Script design by the Benmaster alone. From the good ol Arma2 NTF days
_ntfalloweduserlist = ["Ben 1", "BushWhacker", "E B E"];
_reserved_units = ["p10", "p14"];

waitUntil {sleep 2;!isNull player};
waitUntil {sleep 2;player == player};
waitUntil {sleep 2;name player == name player};

_uid = name player;
_unn = vehiclevarname player;

if ((_unn in _reserved_units)&& !(_uid in _ntfalloweduserlist)) then {
   failMission "end4";
};

if (true) exitwith {};

It uses a simple "namecheck", which is defined as "_ntfalloweduserlist". Those are your profile/character names.

"_reserved_units" refers to the units name as defined in THE EDITOR. That is necessary to prevent hiccups like the script firing for all chars, or not at all.

 

The line "_uid = name player;" can simply be rewritten to use the GUID instead, as the simple name is a very sketchy method. Then again, if your name is "Ben 1" and you see someone log in with that name, and it's not you, .... you can get rid of these scumbags faking access asap anyway, no need to have them around.

 

RAMBLING! Here is how to activate the script:

Put this: _nul = this execvm "slotinit.sqf";

into your UNITS INIT-line in the Editor. Thats the right moment to give the Character it's name that it will use in the script as well.

 

Downsides are:

-Players get "game over" screen, maybe modifyable, I never cared about it too much lol.

-On laggy servers can take a while b4 it fires. You can change the sleeps, but it may cause mayhem or weirdness.

 

Pro sides are:

-Works on player/unit init, pretty much failsafe IF THE UNIT DOESN'T PERSIST! after player DC.

-As simple as it gets, all parameters are in the one single .sqf, no need for static variables.

 

I say again, I chose to use name-based PID over GUID, because in the olden days, there was a possibility of people using the GUID to cause mayhem, and having GUID's floating about, .... I never liked the idea. Personal preference I guess? ¯\_(ツ)_/¯

 

Please leave the comment section in there, unlike "someguy" who stole my content and insulted me like a child. But hey, it's all fair use right, even if someone throws homophobic slurs into your face. But hey, I'm a grown man, I get over things, but it grinds my gears if hard work gets stolen and rebranded as "herp derp my own inwention".

 

Thx guys and questions?, ask them.

 

Edit:

I have some also relatively easy coded "vehicle lockout" script for, lets say, you want the clanmates drive a car and gun in a tank/chopper, but you want publics in the cargo or back seats, it's all been made many years back then, seldom used. If there is interest, sadly for some god damn reason I can't post on the main page, and the old account seems to have been whacked or sacked some time ago. So this is my new acc.

Share this post


Link to post
Share on other sites

Is there any way to set up two whitelist?

We need two because we have 3 Slots that have Zeus Permissions und we have 1 Party that is a Party for people who Donate for the Server and we dont want that any other People can join this slots.

The Other two Partys are for all free...

Share this post


Link to post
Share on other sites
On 22/6/2015 at 11:01 PM, Larrow said:

initServer.sqf

 


allowed = call compile preprocessFileLineNumbers "allowedIDs.txt";

Hello, could you tell me how I could modify this to place the file "allowedIDs.txt" out of the pbo mission file and instead put it on a server? That's how I call the list from an external file?

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

×