19.11.2013, 19:27
When I enter a car and start to drive, my fuel will bug to 123781947192 instead of a normal amount between 0 and 100. What's wrong in the code?
Код:
public Fillup() { //foreach(Player, i) for(new i; i<MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { new VID; new FillUp; new string[128]; VID = GetPlayerVehicleID(i); FillUp = 100 - Gas[VID]; if(Refueling[i] == 1) { if(PlayerInfo[i][pCash] >= FillUp+4) { Gas[VID] += FillUp; FillUp = 50; format(string,sizeof(string),"* You filled your Vehicle up for: $%d.",FillUp); SendClientMessage(i,COLOR_LIGHTBLUE,string); PlayerInfo[i][pCash] = PlayerInfo[i][pCash]-FillUp; GivePlayerMoney(i, - FillUp); Refueling[i] = 0; } else { SendClientMessage(i,COLOR_GREY," You can't afford that !"); } } } } return 1; }