problem with code
#1

I Would like to make it total cars instead of the traditional blowing up
here is the code I Tryed
pawn Код:
public OnVehicleTotal()
{
    for(new count; count < MAX_VEHICLES;count++)
    {
        new Float:health;
        GetVehicleHealth(count,health);
        if((health) < 300.0)
        {
            SetVehicleHealth(count,290.0);
            new engine,lights,alarm,doors,bonnet,boot,objective;
            total[count] = 1;
            GetVehicleParamsEx(count,engine,lights,alarm,doors,bonnet,boot,objective);
            SetVehicleParamsEx(count,false,false,alarm,doors,bonnet,boot,objective);
            for(new i;i < MAX_PLAYERS;i++)
            {
                if(IsPlayerConnected(i))
                {
                    if(IsPlayerInVehicle(i,count))
                    {
                        GameTextForPlayer(i,"~r~Totaled",12,0);
                    }
                }
            }
        }
        else
        {
            total[count] = 0;
        }
    }
    return 1;
}
The Code works when you are near the car but if you teleport a car or your spawn a car it will be totaled any way to fix this
Reply


Messages In This Thread
problem with code - by horsemeat - 19.04.2013, 01:09
Re: problem with code - by zDivine - 19.04.2013, 01:31
Re: problem with code - by horsemeat - 19.04.2013, 01:44
Re: problem with code - by zDivine - 19.04.2013, 01:55

Forum Jump:


Users browsing this thread: 1 Guest(s)