28.11.2016, 17:25
Como seto Preзo por litros?
Quote:
if(strcmp(cmd, "/abastecer", true) == 0) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmdtext, idx); new gastanto; if(!strlen(tmp)) { gastanto = 100; } else { gastanto = strval(tmp); } if(gastanto > 100 || gastanto < 1) { SendClientMessage(playerid, COLOR_WHITE, " Gasolina: Litros [de 1 а 100]!"); return 1; } if(IsAtGasStation(playerid)) { Refueling[playerid] = gastanto; GasETanto[playerid] = Gas[GetPlayerVehicleID(playerid)]+Refueling[playerid]; if(GasETanto[playerid] > 100) { GasETanto[playerid] = 100; } //GameTextForPlayer(playerid,"~w~~n~~n~~n~~n~~n~~n~~ n~~n~~n~Re-Abastecendo, Aguarde!",2000,3); format(gstring,sizeof(gstring)," Reabastecendo Seu carro com %d Litros de Combustivel, Aguarde.",gastanto); SendClientMessage(playerid,COLOR_LIGHTBLUE,gstring ); TogglePlayerControllable(playerid, 0); Abastecendo(playerid); } else if(IsAtGasStationgang(playerid)) { SetTimer("GasGang",RefuelWait,0); Refuelinggang[playerid] = 1; GameTextForPlayer(playerid,"~w~~n~~n~~n~~n~~n~~n~~ n~~n~~n~ Aguarde!",2000,3); } else { SendClientMessage(playerid,COLOR_GREY," Vocк nгo estб em um posto de Gasolina"); } } return 1; } |