[Help] Weapon switch/remove based on _playerID

Inkko

Valued Member!
Could someone help me with a script to do this? I would like to have some non spawning weapons for people who donate, but I don't want just anyone to be able to have the weapon, meaning people who haven't donated. Can someone help me with like a weapon switch script that is based off of player ID? Like player id X who has donated can have non spawning weapon and player Y will have that weapon switched to another. or player X has non spawning weapon and player Y will have that weapon removed.

I have tried doing this myself but have just run into error after another.
Thanks to anyone who can steer me the correct way or help me out with creating a script like this.
 
nvm.. Apparently I have a working remove weapon script, i am just not sure how to make it only remove weapons if your playerID does NOT equal what is specified. Would that be something like if (_playerID!=####) then it would run the remove weapon stuff?
 
nvm.. Apparently I have a working remove weapon script, i am just not sure how to make it only remove weapons if your playerID does NOT equal what is specified. Would that be something like if (_playerID!=####) then it would run the remove weapon stuff?


probably more like: if _playerid not in _ListOfPlayersArray Then...

I think I've seen something similar to that in the debug monitor code
 
This is the code i'm using. In my mission init.sqf i have a line saying execVM "remove.sqf"

Then the code chunk below is what is in remove.sqf
Code:
[] spawn
 
{
            while {true} do
            {
                _items = weapons player;
                {
                    if (_x in _items) then
                    {
                        player removeWeapon _x;
                        hackFlag = [player, "Hacked Item", _x];
                        publicVariableServer "hackFlag";
                    };
                }    forEach ["SCAR_H_LNG_Sniper","SCAR_H_LNG_Sniper_SD","m8_base","m8_carbineGL","SCAR_Base",
                    "SCAR_L_STD_Mk4CQT","SCAR_L_STD_EGLM_RCO","SCAR_L_CQC_EGLM_Holo",
                    "SCAR_H_Base","SCAR_H_CQC_CCO","SCAR_H_STD_EGLM_Spect"];
                sleep 30;
            };
};

I just can't seem to figure out how to make it so it checks for a player id and if it fails the check it runs the remove weapon script.
 
I've spent all day on this and just been rewarded with error in excepssions, positions, and missing ;

I'm totally stuck now as to how to add a player id check that if failed will run the remove weapon script :(
 
Well I found one of my old hard coded anti hacks and was able to rip just the weapon remove out of it. I was way off on the player check I was looking for. It had an array setup for admins and the playerid check looked like this
Code:
if (!(getPlayerUID player in admins) && (getPlayerUID player == (_this select 0))) then
 
Back
Top