Vehicle damage check not working
#9

If you keep this in OnGameModeInit/OnFilterScriptInit:
pawn Код:
SetTimer("DerbySys",1000,1);
then change to:
pawn Код:
forward DerbySys();
public DerbySys()
{
    for (new playerid; playerid != MAX_PLAYERS; ++playerid)
    {
        if (!IsPlayerConnected(playerid) || !IsPlayerInRangeOfPoint(playerid, 500, -1364,1004.5,1220)) continue;
        if (!IsPlayerInAnyVehicle(playerid))
        {
            GetDerbyCar(playerid);
            continue;
        }
        if (IsPlayerInVehicle(playerid,RandDerbyCar[playerid]))
        {
            new Float:Vhealth;
            GetVehicleHealth(RandDerbyCar[playerid],Vhealth);
            if (Vhealth <= 250)
            {
                DestroyVehicle(RandDerbyCar[playerid]);
                SendClientMessage(playerid,0xFFFFFFFF,"Vehicle was destroyed. New vehicle created.");
            }
        }
    }
}
Else you'd have to set the timer when a player joins the derby:
pawn Код:
SetTimerEx("DerbySys", 1000, true, "i", playerid);
and use it as you have it but keep in mind to store the timer ID in an array and when a player leaves derby to destroy the timer.
Reply


Messages In This Thread
Vehicle damage check not working - by Aerotactics - 24.03.2014, 01:05
Re: Vehicle damage check not working - by ]Rafaellos[ - 24.03.2014, 06:52
Re: Vehicle damage check not working - by Aerotactics - 24.03.2014, 07:30
Re: Vehicle damage check not working - by Hanuman - 24.03.2014, 10:08
Re: Vehicle damage check not working - by Aerotactics - 24.03.2014, 19:33
Re: Vehicle damage check not working - by Konstantinos - 24.03.2014, 19:36
Re: Vehicle damage check not working - by Aerotactics - 24.03.2014, 19:54
Re: Vehicle damage check not working - by Zeppo - 24.03.2014, 19:56
Re: Vehicle damage check not working - by Konstantinos - 24.03.2014, 20:04
Re: Vehicle damage check not working - by Aerotactics - 24.03.2014, 20:35

Forum Jump:


Users browsing this thread: 1 Guest(s)