Jump to content
Violt

[RELEASE] Set rank + Whitelist Script

Recommended Posts

Hello everyone! 

 

I have created a script for people that have a Mil-Sim unit or a Mil-Sim RP mission. 

This is the first script i have ever created!

I couldn't find a script like this myself so i decided to make one.

 

This script is for you if you would like to set a specific rank for a specific player on log in. And if you are not that specific player you will get kicked back to the lobby. 

 

I got a little help from the people of the Bohemia Arma 3 Forums. Credits to them!

 

How to install: 

- Go to your Mission folder

- Open your Init.sqf and at the bottom of your init.sqf add:

//ranklist.sqf by Violt
[]execVM "Scripts\ranklist.sqf";

- Create a folder called Scripts in your mission folder. 

- Create a new .sqf file called ranklist

- Open the folder and add: 

//ranklist.sqf by Violt initially made for www.american-tactics.com
//This Script gives every player their rank and kicks players that are not in the rank list.

if (isServer) exitWith {}; // Do not delete this

sleep 2; //Delay to make sure that the script works.

//Rank and SteamID64 list
AMTAC_PRIVATE         =    [ // Private Rank
"765**************", // Your Friend
"765**************", // Your Friend
"765**************", // Your Friend
"765**************" // Your Friend

];
AMTAC_CORPORAL        =    [ // Corporal Rank
"765**************", // Your Friend
"765**************", // Your Friend
"765**************", // Your Friend
"765**************" // Your Friend

];
AMTAC_SERGEANT        =    [ // Sergeant Rank
"765**************", // Your Friend
"765**************", // Your Friend
"765**************" // Your Friend

];
AMTAC_LIEUTENANT      =    [ // Lieutenant Rank
"765**************", // Your Friend
"765**************" // Your Friend

];
AMTAC_CAPTAIN         =    [ // Captain Rank
"765**************" // Your Friend

];
AMTAC_MAJOR           =    [ // Major Rank
"765**************" // Your Friend

];
AMTAC_COLONEL         =    [ // Colonel Rank
"765**************" // You

];

_playerUID = getPlayerUID player; //Get Player UID

//check to see if the PlayerUID matches 
switch (true) do {
	case (_playerUID in AMTAC_PRIVATE)    : { player setRank "PRIVATE"; };
    case (_playerUID in AMTAC_CORPORAL)   : { player setRank "CORPORAL"; };
    case (_playerUID in AMTAC_SERGEANT)   : { player setRank "SERGEANT"; };
    case (_playerUID in AMTAC_LIEUTENANT) : { player setRank "LIEUTENANT"; };
    case (_playerUID in AMTAC_CAPTAIN)    : { player setRank "CAPTAIN"; };
    case (_playerUID in AMTAC_MAJOR)      : { player setRank "MAJOR"; };
    case (_playerUID in AMTAC_COLONEL)    : { player setRank "COLONEL"; };

    default { disableUserInput true; hint "You are not whitelisted... \nYou will be kicked back to the lobby in 30 seconds. \nIf you want to become a member visit our website for more information: \n wwww.yourwebsite.com \n \nIf you already are a member but you are getting this message then contact a staff member on TeamSpeak."; sleep 30; disableUserInput false; failMission "end1"; 
	};
};

 

Enjoy the script! 

If you have any questions feel free to ask them!

 

Share this post


Link to post
Share on other sites
if !(_state) exitWith {
	disableUserInput false;
	disableUserInput true;
	disableUserInput false;
	disableUserInput false;
};

That is crazy! :O

ArmA

:hang:

Share this post


Link to post
Share on other sites
1 hour ago, Belbo said:

disableInput is erratic in MP. You have to circumvent the problems of disableInput like this:

https://github.com/Pergor/ADV_MissionTemplate/blob/master/adv_missiontemplate.altis/functions/client/fn_disableInput.sqf

 

Otherwise players might end up not having their Inputs reenabled.

Hmm never had a problem doing it my way. 

Anyways i've removed it.

 

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

×