Jump to content
Sign in to follow this  
krihelion

Whitelisting Slots

Recommended Posts

How would I go about whitelisting slots that kicks the player out of the slot if their PID does not match?

if(name player != Krihelion) exitWith {titleText["This is a restricted slot! If this is an error please contact USASOC S-3 Operations.","BLACK"]};

This is what I am working with, it properly displays the error, however, I cannot seem to whitelist myself now. I have tried with "" around Krihelion a swell.

Edited by Krihelion

Share this post


Link to post
Share on other sites

Here you go! This is what I use for my missions.

RESERVED SLOT

/* 
ReservedSlot.sqf by Kahna

Initially call this script in the Init.sqf and then include it in whatever script you use to respawn players,
otherwise the respawned player will not have the Reserved Slot script applied to it.

*/

while {true} do 
{
private ["_reserved_units", "_reserved_uids", "_uid"];

waitUntil {!isNull player};
waitUntil {(vehicle player) == player};
waitUntil {(getPlayerUID player) != ""};

// Variable Name of the Player Character to be restricted. //
_reserved_units = [Reserved01];

// The player UID is a 17 digit number found in the profile tab. //
_reserved_uids = 
[
"UIDXXXXXXXXXXXXXX"/* Add Player Name Here */,
"UIDXXXXXXXXXXXXXX"/* Add Player Name Here */,
"UIDXXXXXXXXXXXXXX"/* Add Player Name Here */
];

// Stores the connecting player's UID //
_uid = getPlayerUID player;


if ((player in _reserved_units)&& !(_uid in _reserved_uids)) then 
{
  titleText ["", "BLACK OUT"];
  disableUserInput true;
  hint "You are in a reserved slot! You will be kicked to the lobby in 15 seconds!";
  sleep 5;
  hint "You are in a reserved slot! You will be kicked to the lobby in 10 seconds!";
  sleep 5;
  hint "You are in a reserved slot! You will be kicked to the lobby in 5 seconds!";
  sleep 5;
  titleText ["", "BLACK IN"];
  disableUserInput false;
  failMission "end1";
  	};  
};

  • Like 1

Share this post


Link to post
Share on other sites

Since you're running that code from init.sqf, it will be run by both server and connecting players.

I see nothing to exclude server from entering that

waitUntil {!isNull player};

loop.

I'd suggest either putting an:

if (isServer) exitWith {};

right at the top, or better yet initializing the script from "initPlayerLocal.sqf" instead of "init.sqf".

  • Like 1

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  

×