Tente assim:
Código PHP:
new
jatinha = 0,
precocombustivel = 0,
TimerAbastecer[MAX_PLAYERS]
;
CMD:abastecer(playerid, params[]){
new IDCAR = GetPlayerVehicleID(playerid);
if(Combustivel[IDCAR] == 100) return SendClientMessage(playerid, Cinza,"Seu Vehiculo esta com o tanque Cheio!");
TimerAbastecer[playerid] = SetTimerEx("Abastecer", 500, true, "i", playerid);
return 1;
}
forward Abastecer(playerid);
public Abastecer(playerid)
{
if(Combustivel[GetPlayerVehicleID(playerid)] > 0)
{
jatinha ++;
precocombustivel += 10;
GivePlayerMoney(playerid, -10);
Combustivel[GetPlayerVehicleID(playerid)] ++;
}
if(Combustivel[GetPlayerVehicleID(playerid)] >= 100)
{
new string[128];
KillTimer(TimerAbastecer[playerid]);
format(string, sizeof(string), "O abastecimento acabou, foram colocados %d litros por %dR$", jatinha, precocombustivel);
SendClientMessage(playerid, -1, string);
jatinha = 0;
precocombustivel = 0;
}
return 1;
}