UrbanSkaters
Valued Member!
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:
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!
in my server functions file I have this code:
Code:
God_Protect = {
private ["_tID","_x_type","_count"];
{
_x_type = typeOf _x;
//_name = getText(configFile >> "cfgVehicles" >> _x_type >> "displayName");
_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!