Vehicle health.
#1

pawn Код:
public ServerTimer()
{
    for(new i; i < MAX_VEHICLES; i++)
    {
        if(i != INVALID_VEHICLE_ID)
        {
            new Float:vHp;
            GetVehicleHealth(i, vHp);
            if(vHp != 999.0) SetVehicleHealth(i, 999.0);
        }
    }
    return (true);
}
why it's not calling when vehicle is empty?
Reply
#2

Can you show use the SetTimer function ?
Reply
#3

if(i != INVALID_VEHICLE_ID) the fuck ?
Reply
#4

Everything works when player in vehicle....
Reply
#5

Please show us the code where the timer is.
Reply
#6

You think I'm stupid?
public OnGameModeInit()
{
SetTimer("ServerTimer", 50, true);
return 1;
}
Reply
#7

Add print("Test") in the timer, And see if the timer gets actually called...

If not, Then you may not have forwarded the function.

Add forward ServerTimer(); in the top of the public.
Reply
#8

As I say, every works when vehicle is occupied. But whent vehicle un-occupied code doesn't call.
Reply
#9

Vehicles can't be damaged unless someone's in them, anyway.
Reply
#10

just use
pawn Код:
public OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat, Float:new_x, Float:new_y, Float:new_z, Float:vel_x, Float:vel_y, Float:vel_z)
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)