EH for setFuel 0

Junior Spellweaver
Joined
May 28, 2017
Messages
119
Reaction score
39
Hi everyone,
I finished to program my save system for cars, tents, barrels, anything object, but i have one problem.
I want set Fuel for 0 for cars damaged, doing this I can delete cars damaged of my IDB (Internal DataBase, used on system save) and spawn a new car after server restart.

my code for do this:

//////////////////////////////////////////////////////////////////

CarKilled =
{
private["_Car", "_fuel"];
_Car = _this select 0;
while {((fuel _Car) > 0)} do
{ sleep 10; _Car setFuel 0; };
};

Car = "SUV_TK_EP1" createVehicle [x,y,z];
Car addeventhandler ["killed",{_this spawn CarKilled} ];

//////////////////////////////////////////////////////////////////

But this not working.
Any suggestion?
the function SetFuel only work on local computer?

(The version of my server is 0.47)
 
Last edited:
Back