Jump to content
  • 0

Owned Vehicles not saving position to Database after GodMode


MatthewK

Question

I'm trying to get all locked vehicles set to GodMode at restart only . Then once unlocked they're vulnerable until server restart again..

in my server functions file I have this code:

God_Protect = {
private ["_tID","_x_type","_count"];        
{        
    _x_type = typeOf _x;
    _tID = parseNumber (_x getVariable ["CharacterID","0"]);
    if ((_tID != 0) && ((_x_type isKindOf "Air") || (_x_type isKindOf "LandVehicle") || (_x_type isKindOf "Ship"))) then {
        _x removeAllEventHandlers "handleDamage";
        _x addEventHandler ["handleDamage", {false}];
        _x enableSimulation false;
        _x allowDamage false;
        sleep 0.1;
        };
    } forEach vehicles;

};

 

 

Then in my server_monitor.sqf file right at the bottom I have:

[] spawn God_Protect;

The vehicles are protected on restart, but they're not saving to the database when moved. If I remove this code, then they start saving to the database again..

 

Any ideas? I'm sure it's something noob that I've messed up! 

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...