Jump to content

Violt

Member
  • Content Count

    49
  • Joined

  • Last visited

  • Medals

Posts posted by Violt


  1. 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!

     


  2. 16 hours ago, HazJ said:

    Did you output the player rank after the switch?

    
    hintSilent format [":: %1", rank player];

    Also... Try:

    
    private _playerUID = getPlayerUID player;

    You can also output a test message inside each case block for testing. How do you execute this?

    Hello again, i found out that if i add the case

    case (_playerUID in PRIVATE)    : { player setRank "PRIVATE"; };

    It will not work so i commented it out and it works now. 

    But the script has to have Private's to be able to be "whitelisted"

     

     

    //Ranks.sqf by Violt Created for American-Tactics.com
    //This Script gives every player their rank and kicks players that are not in the rank list.
    
    sleep 2; //Delay to make sure that the script is beign executed
    
    //Rank and SteamID list
    //PRIVATE         =    ["76561198157925156"];
    CORPORAL        =    [];
    SERGEANT        =    [];
    LIEUTENANT      =    [];
    CAPTAIN         =    ["76561198137045416"];
    MAJOR           =    ["76561198155447330"];
    COLONEL         =    ["76561198122914475"];
    
    _playerUID = getPlayerUID player; //Get Player UID
    
    //check to see if the player matches
    switch (true) do {
    //	case (_playerUID in PRIVATE)    : { player setRank "PRIVATE"; };
        case (_playerUID in CORPORAL)   : { player setRank "CORPORAL"; };
        case (_playerUID in SERGEANT)   : { player setRank "SERGEANT"; };
        case (_playerUID in LIEUTENANT) : { player setRank "LIEUTENANT"; };
        case (_playerUID in CAPTAIN)    : { player setRank "CAPTAIN"; };
        case (_playerUID in MAJOR)      : { player setRank "MAJOR"; };
        case (_playerUID in COLONEL)    : { player setRank "COLONEL"; };
    
        default { hint "Test"; }; //setting default rank for all others    
    };

     


  3. 8 hours ago, HazJ said:

    Did you output the player rank after the switch?

    
    hintSilent format [":: %1", rank player];

    Also... Try:

    
    private _playerUID = getPlayerUID player;

    You can also output a test message inside each case block for testing. How do you execute this?

    I do not understand this fullt yet. If you mean by executing the script. The executing code is in the init.sqf


  4. 1 hour ago, HazJ said:

    My eyes! I recommend you use switch instead of if statements. Also, is there a need for the while loop since you can just check on first join. Something like:

    
    switch (true) do
    {
    	case (_playerUID in PRIVATE) :
    	{
    		// code...
    	};
    	case (_playerUID in CORPORAL) :
    	{
    		// code...
    	};
    	case (_playerUID in SERGEANT) :
    	{
    		// code...
    	};
    	case (_playerUID in LIEUTENANT) :
    	{
    		// code...
    	};
    	case (_playerUID in CAPTAIN) :
    	{
    		// code...
    	};
    	case (_playerUID in MAJOR) :
    	{
    		// code...
    	};
    	case (_playerUID in COLONEL) :
    	{
    		// code...
    	};
    	default
    	{
    		// NOT whitelisted!
    		// kick or do whatever...
    	};
    };

     

    For some reason the script is not working at all right now. 

     

    Here's my script

    What am i doing wrong? 

     

    //Ranks.sqf by Violt Created for American-Tactics.com
    //This Script gives every player their rank and kicks players that are not in the rank list.
    
    sleep 5; //Delay to make sure that the script is beign executed
    
    // Rank and SteamID list
    
    PRIVATE         =    ["76561198157925156"];
    CORPORAL        =    [];
    SERGEANT        =    [];
    LIEUTENANT      =    [];
    CAPTAIN         =    ["76561198137045416"];
    MAJOR           =    ["76561198155447330"];
    COLONEL         =    ["76561198122914475"];
    
    _playerUID = getPlayerUID player; //Checks Player ID
    
    //check to see if the player matches
    switch (true) do {
    	case (_playerUID in PRIVATE)    : { player setRank "PRIVATE"; };
        case (_playerUID in CORPORAL)   : { player setRank "CORPORAL"; };
        case (_playerUID in SERGEANT)   : { player setRank "SERGEANT"; };
        case (_playerUID in LIEUTENANT) : { player setRank "LIEUTENANT"; };
        case (_playerUID in CAPTAIN)    : { player setRank "CAPTAIN"; };
        case (_playerUID in MAJOR)      : { player setRank "MAJOR"; };
        case (_playerUID in COLONEL)    : { player setRank "COLONEL"; };
    	default { 					
        	disableUserInput true;
    		hint "You are not whitelisted! You will be kicked to the lobby in 5 seconds!";
    		sleep 5;
    		disableUserInput false;
    		failMission "end1";;
    	};
    };

     


  5. Hello, 

    I am working on a script. 

    And i have got it working pretty much. 

    I have only got one problem. 

    This Script gives every player their rank and kicks players that are not in the rank list.

    It gives the players that have their SteamID in here their rank but it does not kick players who don't.

    But i can't figure it out. 

    Here's my script

    /*
    Rank.sqf
    This Script gives every player their rank and kicks players that are not in the rank list.
    */
    sleep 2; //Delay to make sure that the script is beign executed
    
    // Rank and SteamID List
    PRIVATE        =    [
    "765**************" // SteamID64 here
    
    ];
    CORPORAL        =    [
    "765**************" // SteamID64 here
      
    ];
    SERGEANT        =    [
    "765**************" // SteamID64 here
      
    ];
    LIEUTENANT    =    [
    "765**************" // SteamID64 here
      
    ];
    CAPTAIN        =    [
    "765**************" // SteamID64 Here
    
    ];
    MAJOR        =    [
    "765**************" // SteamID64 Here
      
    ];
    COLONEL        =    [
    "765**************" // SteamID64 Here
    
    ];
    
    
    //=========================================================================================================================================================
    
    _playerUID = getPlayerUID player; //Checks PlayerUID
    
    
    _found = false;
    while {!_found} do {
        if (_playerUID in CORPORAL) then {
            player setRank "CORPORAL"; // This sets the ingame Rank
            _found = true; // Stops Searching if the playerUID was found
    		
        }else{
    		
            if (_playerUID in SERGEANT) then {
                player setRank "SERGEANT";
                _found = true;
    			
            }else{
                if (_playerUID in LIEUTENANT) then {
                    player setRank "LIEUTENANT";
                    _found = true;
    
                }else{
                    if (_playerUID in CAPTAIN) then {
                        player setRank "CAPTAIN";
                        _found = true;
    
                    }else{
                        if (_playerUID in MAJOR) then {
                            player setRank "MAJOR";
                            _found = true;
    
                        }else{
                            if (_playerUID in COLONEL) then {
                                player setRank "COLONEL";
                                _found = true;
    
                            }else{
    						if (_playerUID in PRIVATE) then {
                                player setRank "PRIVATE";
                                _found = true;
    							
    							}else{  // If you are not in the Rank List you will get kicked back to the lobby
    								disableUserInput true;
    								hint "You are not whitelisted! You will be kicked to the lobby in 5 seconds!";
    								sleep 5;
    								disableUserInput false;
    								failMission "end1";
    								_found = true;
    							};
                            };
                        };
                    };
                };    
            };    
        };
    };

     


  6. Hello, 

     

    I am using the Vanilla Respawn Menu for my Arma 3 Mil-Sim Mission. 

    But i can't seem to get the roles and loadouts to work. 

    I just need someone to help me with this. 

    I already have a loadout setup with the following items: 

    (It's exported from the arsenal)

     

    comment "Add containers"; 
    this forceAddUniform "rhs_uniform_acu_ucp"; 
    this addItemToUniform "ACE_EarPlugs"; 
    for "_i" from 1 to 7 do {this addItemToUniform "rhsusf_mag_7x45acp_MHP";}; 
    this addHeadgear "rhsusf_patrolcap_ucp"; 
     
    comment "Add weapons"; 
    this addWeapon "rhsusf_weap_m1911a1"; 
     
    comment "Add items"; 
    this linkItem "ItemMap"; 
    this linkItem "ItemCompass"; 
    this linkItem "tf_microdagr"; 
    this linkItem "tf_anprc152_5"; 
    this linkItem "ItemGPS";

     

    I will send you my mission file through pm if you can help. 

     

    Many Thanks!


  7. On 5/12/2018 at 1:45 PM, Grumpy Old Man said:

     

    Well the mission you posted might as well be a default mission template with most of the files being empty.

    @Floof already posted the wiki containing all needed info on how to implement a respawn system with multiple selectable positions.

    If this is over your head you can ask someone to script it for you, hence my link to the find or offer editing forum.

     

    Maybe I misunderstood but what exactly was the purpose of uploading the mission, if the stuff you need help with isn't even in the mission?

     

    Cheers

     

    Hello again, 

     

    I have my respawn points back. And i have 1 loadout but thats the standard units loadout and not the one that is in my class CfgRespawnInventory

    Could you please help me? 


  8. Hello, 

     

    On my missions i have several spawn points. 

    But what i want is if you spawn you spawn in a trigger. 

    and you get spawn gear because you are in the trigger with the spawn gear code in it. 

    I already have tried this but it is not working. 

     

    I have pasted the following in the On Activation space

    removeAllWeapons this; 
    removeAllItems this; 
    removeAllAssignedItems this; 
    removeUniform this; 
    removeVest this; 
    removeBackpack this; 
    removeHeadgear this; 
    removeGoggles this; 
     
    comment "Add containers"; 
    this forceAddUniform "rhs_uniform_acu_ucp"; 
    this addItemToUniform "ACE_EarPlugs"; 
    for "_i" from 1 to 7 do {this addItemToUniform "rhsusf_mag_7x45acp_MHP";}; 
    this addHeadgear "rhsusf_patrolcap_ucp"; 
     
    comment "Add weapons"; 
    this addWeapon "rhsusf_weap_m1911a1"; 
     
    comment "Add items"; 
    this linkItem "ItemMap"; 
    this linkItem "ItemCompass"; 
    this linkItem "tf_microdagr"; 
    this linkItem "tf_anprc152_5"; 
    this linkItem "ItemGPS"; 
     
    comment "Set identity"; 
    this setFace "WhiteHead_20"; 
    this setSpeaker "ace_novoice"; 

    What am i doing wrong? 


  9. 11 hours ago, Grumpy Old Man said:

     

    Well the mission you posted might as well be a default mission template with most of the files being empty.

    @Floof already posted the wiki containing all needed info on how to implement a respawn system with multiple selectable positions.

    If this is over your head you can ask someone to script it for you, hence my link to the find or offer editing forum.

     

    Maybe I misunderstood but what exactly was the purpose of uploading the mission, if the stuff you need help with isn't even in the mission?

     

    Cheers

     

    Hey i got it to work atleast the loadout.

    But now i can't choose where to spawn. What do i do? 

    I was able to choose to respawn at first.

     

     


  10. 5 hours ago, Grumpy Old Man said:

     

    So it doesn't work but you haven't implemented it yet?

     

     

    And this selection absolutely has to happen during respawn?

    Again if I understood this right, you made the code and it should work but you only state what to you're doing if it doesn't work.

    How about stating what exactly doesn't work?

    Does it work from debug console?

    Does it work in SP but not in MP/dedicated?

     

    The mission you linked to has no single file pointing to something like a custom reload script, initPlayerLocal.sqf and onPlayerRespawn.sqf are both empty.

    If you need someone to make the script for you you'll better post in a more appropriate forum.

     

    Cheers

     

    With not implemented yet i mean not working yet. So that feature is not in the mission yet. 

    I just need to know step by step what i need to do. As the link you sended me isn't giving me enough help. 


  11.  

    On 9-5-2018 at 7:05 PM, Grumpy Old Man said:

     

    Well he's execVMing empty .sqf files from the init.sqf and doing stuff like "for '_i' from 0 to 1 step 0 do", so there's that.

    Most likely in way over his head, heh.

     

    @Violt

    Does your mission absolutely need this kind of functionality?

    If you're new to arma scripting it's better to take small, simple steps to reach your goal.

    Nothing wrong with loadout selection during mission runtime.

     

    Cheers

    The reason why i need the respawn menu with the loadout is for the player to select their rank. And if you are an let say an lt you are able to call in attilery strikes. You won’t as a recruit. The code to select a rank depending on the loadout role you select is already made and should work. If this doesn’t work i need to find another wat for the player to be able to select their rank. 


  12. On 5/9/2018 at 7:05 PM, Grumpy Old Man said:

     

    Well he's execVMing empty .sqf files from the init.sqf and doing stuff like "for '_i' from 0 to 1 step 0 do", so there's that.

    Most likely in way over his head, heh.

     

    @Violt

    Does your mission absolutely need this kind of functionality?

    If you're new to arma scripting it's better to take small, simple steps to reach your goal.

    Nothing wrong with loadout selection during mission runtime.

     

    Cheers

    Yes it does need the system.

     

×