Car engine help
#8

Ooh okay,

So if you have "for(new i; i < MAX_PLAYERS; i++)" in your callback, all the "playerid's" are changed by "i"?

Edit:

Still got a little problem, when the car health is below 350, it sets the player health back to 349, and gives a message "Your Engine Died, etc etc etc". But the only thing is, it keeps spamming the message Your Engine Died.. Is there somehow i can get rid of this? (It is the same if the car is repaired

pawn Код:
public CarWrecked()
{
    for(new i; i < MAX_PLAYERS; i++)
    {
        new Float:VehHealth;
        new PlayerVehicle;
        PlayerVehicle = GetPlayerVehicleID(i);
        GetVehicleHealth(PlayerVehicle, VehHealth);
        if(IsPlayerInAnyVehicle(i))
        {
        if(VehHealth < 350)
        {
            SetVehicleParamsEx(PlayerVehicle, false, true, true, true, false, false, false);
            TogglePlayerControllable(i,0);
            SendClientMessage(i, orange, "Your engine died. Please call a repairsman to repair it");
            SetVehicleHealth(PlayerVehicle, 349);
            return 1;
            } else if(VehHealth > 998) {
            SetVehicleParamsEx(PlayerVehicle, true, false, false, false, false, false, false);
            TogglePlayerControllable(i, 1);
            SendClientMessage(i, orange, "Your engine have been fixed.");
            SendClientMessage(i, orange, "You gave the repairsman 500$.");
            return 1;
            }
        }
    }
    return 1;
}
Reply


Messages In This Thread
Car engine help - by Wesley221 - 17.05.2011, 15:56
Re: Car engine help - by cessil - 17.05.2011, 15:58
Re: Car engine help - by Wesley221 - 17.05.2011, 16:34
Re: Car engine help - by Swiftz - 17.05.2011, 16:41
Re: Car engine help - by cessil - 17.05.2011, 16:58
Re: Car engine help - by Wesley221 - 17.05.2011, 17:03
Re: Car engine help - by Swiftz - 17.05.2011, 17:11
Re: Car engine help - by Wesley221 - 17.05.2011, 17:18
Re: Car engine help - by cessil - 18.05.2011, 01:04
Re: Car engine help - by Wesley221 - 18.05.2011, 06:31

Forum Jump:


Users browsing this thread: 2 Guest(s)