repair vehicle question! :D
#8

Quote:
Originally Posted by [XST]O_x
Посмотреть сообщение
pawn Код:
if (strcmp("/fix", cmdtext, true, 10) == 0)
    {
        if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid,RED,"You are not driving in any vehicle!");
        new Float:vHealth,cost;
        for(new i = 0; i < (1000 - (GetVehicleHealth(GetPlayerVehicleID(playerid),vHealth))); i += 3)
        {
            if(i - 1000 == 0) break; //If vehicle health is 1000
            cost = i;
        }
        if(GetPlayerMoney(playerid) < cost) return SendClientMessage(playerid,RED,"You don't have enough money to fix your vehicle.");
        SetVehicleHealth(GetPlayerVehicleID(playerid),1000);
        GivePlayerMoney(playerid,GetPlayerMoney(playerid) - cost);
        SendClientMessage(playerid,RED,"You have fixed your vehicle!");
    }
Try this.
thanks man!
Reply


Messages In This Thread
repair vehicle question! :D - by WillyP - 03.09.2010, 18:24
Re: repair vehicle question! :D - by CyNiC - 03.09.2010, 18:36
Re: repair vehicle question! :D - by Mauzen - 03.09.2010, 18:37
Re: repair vehicle question! :D - by gamer931215 - 03.09.2010, 18:40
Re: repair vehicle question! :D - by Voldemort - 03.09.2010, 18:48
Re: repair vehicle question! :D - by WillyP - 03.09.2010, 19:36
Re: repair vehicle question! :D - by [XST]O_x - 03.09.2010, 20:01
Re: repair vehicle question! :D - by WillyP - 03.09.2010, 20:10

Forum Jump:


Users browsing this thread: 1 Guest(s)