[Help] Vehicle usable depending on PlayerUID

Inkko

Valued Member!
I have a weapon remove script that is based on playerUID and I'd like to include a auto eject out of certain vehicles but am unsure how to do so.

Code:
BIS_fnc_swapVars = {};
BIS_MPF_remoteExecutionServer2 = BIS_MPF_remoteExecutionServer;
BIS_MPF_remoteExecutionServer =
{
    _input = (_this select 1) select 2;
    if (_input in ["SwitchMove", "PlayMove", "SAY", "JIPrequest"]) then
    {
        _this call BIS_MPF_remoteExecutionServer2;
    };
};
 
"rcmd" addPublicVariableEventHandler
{
    _array = _this select 1;
    _sp = _array select 0;
    _name = _array select 1;
    _uid = _array select 2;
    _reason = _array select 3;
    _field = _array select 4;
    _log = format ["HACKER FOUND:  %1 (%2)  REASON:  %3  (%4) - |%5|", _name, _uid, _reason, _field, dayZ_instance];
    diag_log (_log);
    if (_sp) then
    {
        _cght = format ["if !(isServer) then {['ALPHA AntiCheat', 'Captured: %1', 'For: %2 (%3)'] spawn BIS_fnc_infoText;};", _name, _reason, _field];
        //[nil, nil, rSPAWN, [], compile _cght] call RE;
    };
};
 
"dayzLogin" addPublicVariableEventHandler
{
    (_this select 1) call server_playerLogin;
    uid1448 = (_this select 1) select 0;
    admins1448 =  [ "####" , "####" , "####" , "####" , "####" , "####" ];
    code1448 =
    {
        if (!(getPlayerUID player in admins1448) && (getPlayerUID player == (_this select 0))) then
        {
            BIS_fnc_swapVars = {};
            BIS_MPF_remoteExecutionServer2 = compile preprocessFile (BIS_MP_Path + BIS_PATH_SQF + "remExServer.sqf");
            BIS_MPF_remoteExecutionServer =
            {
                _input = (_this select 1) select 2;
                if (_input in ["SwitchMove", "PlayMove", "SAY", "JIPrequest"]) then
                {
                    _this call BIS_MPF_remoteExecutionServer2;
                };
            };
            playableUnits = [player];
            allUnits = [player];
            allMissionObjects = [player];
            entities = [player];
            vehicles = [player];
            {[] spawn _x;} forEach
            [{
                while {true} do
                {
                    _items = weapons player;
                    {
                        if (_x in _items) then
                        {
                            player removeWeapon _x;
                            rcmd = [true, name player, getPlayerUID player, 'Bad Item', _x];
                            publicVariableServer 'rcmd';
                        };
                    } forEach ['SCAR_H_LNG_Sniper','SCAR_H_LNG_Sniper_SD','BAF_L86A2_ACOG','9M311Laucher','m8_base','m8_carbineGL','BAF_L17_40mm','BAF_L85A2_UGL_Holo','BAF_L85A2_UGL_SUSAT','BAF_L85A2_RIS_ACOG','BAF_L85A2_UGL_ACOG','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','MG36','MG36_camo','RPK_74','m8_sharpshooter','m8_SAW','BAF_AS50_TWS','PMC_AS50_scoped','PMC_AS50_TWS'];
                    sleep 30;
                };
            },];
            hint 'Welcome %1';
        };
    };
    publicVariable "uid1448";
    publicVariable "admins1448";
    publicVariable "code1448";
    cowFarm = createGroup west;
    "Cow03" createUnit [[1615, 7785, 0], cowFarm, "dayzCow = this;if !(isServer) then {[uid1448] spawn code1448;};", 0.5, "corporal"];
    deleteVehicle dayzCow;
    {deleteGroup _x} forEach allGroups;
};

I know how to addon to the script to also have the auto eject. I'm just unsure of exactly how to set it up.

Oh ya, and feel free to use this code for removing weapons. It can be helpful for removing certain weapons you want off your map, or you can use it how I am using it. Having it as an exclusive donator only weapons perk.
 
Back
Top