Anti Invisibility Thread [AIT]

Soul

Valued Member!
Anti Invisible Thread [AIT]
v1.1

This script runs a while loop that checks every players model
and if it returns a non initiated model, empty model or model survivor1_dz
it morphs the player into a survivor2_dz model that is visible.
This fixed spawn invisible glitch and people who manage to make themselves
invisible on your servers.
  • Easy = Blue <5
Installation:

Make a new file called: anti_invis.sqf
and put this code inside it:
Code:
waitUntil {!isNil "dayz_animalcheck"};
while {true} do {
_model = typeOf player;
modelCheck = false;
    if (isNil "_model") then {
        _model = "Survivor2_DZ";
        modelCheck = true;
    };

    if (_model == "") then {
        _model = "Survivor2_DZ";
        modelCheck = true;
    };

    if (_model == "Survivor1_DZ") then {
        _model = "Survivor2_DZ";
        modelCheck = true;
    };
 
    if(modelCheck) then {
        [dayz_playerUID,dayz_characterID,_model] spawn player_humanityMorph;
    };
 
    sleep 10;
};

Call the new file in your init.sqf inside the if(!isDedicated) then {} part with
Code:
[] execVM "anti_invis.sqf";


Note:
If this takes to much resources you can make the sleep command at the bottom in anti_invis.sqf
longer to slow down the while loop.


Credits - Soul
 
Last edited:
To make it more robust you can add:

Find:
Code:
_model = typeOf player;
Add below:
Code:
{if(!((getPlayerUID _x) in adminUIDs)) then { _x hideObject false;};} forEach playableUnits;
Now about this, it could be that it affects performance. I havent
tested this but it will for a fact unhide every invisible player.
This forEach loops trough all playableUnits = players and set hideObject false
localy since hideObjects effects are local to where it whas executed wich is in
this case on the players pc. Without the forEach loop this hideObject false
would only apply to the player himself and not all other players aswell.

To exclude admins just execVM this script like folowing in your init.sqf

Code:
if(!((getPlayerUID player) in adminUIDs)) then {
        [] execVM "scripts\anti_invis.sqf";
    };

This does require you to have an array called adminUIDs with admin uids in it somewhere
in the mission.pbo or on the server and have it publicVariabled.
 
Last edited:
Back
Top