PDA

View Full Version : Fuel station


IchNar
31/07/2015, 05:29 PM
Dont work please help me.When I enter the number of litres,so to me it can be -5 000 000 $ and dont give me fuel.
if(dialogid == DIALOG_BENZINKA)
{
if(response == 0)
{
TogglePlayerControllable(playerid,1);
}
if(response == 1)
{
new veh = GetPlayerVehicleID(playerid);
new Float:litre = strval(inputtext);
if(Benzin[veh]>=100)return ShowPlayerDialog(playerid,DIALOG_BENZINKA,DIALOG_S TYLE_INPUT,"Benzinka","Maximalne si mozes natankovat do 100 l benzinu\nZadaj počet litrov,1 liter stoji 2$","Zadať","Zrusiť");
if(!inputtext[0]) return ShowPlayerDialog(playerid,DIALOG_BENZINKA,DIALOG_S TYLE_INPUT,"Benzinka","Nezadal si pocet litrov\nZadaj počet litrov,1 liter stojí 2$","Zadať","Zrušiť");
if(litre<=0 || litre>100) return ShowPlayerDialog(playerid,DIALOG_BENZINKA,DIALOG_S TYLE_INPUT,"Benzinka","Môzes zadat pocet l benzinu od 0-100\nZadaj počet litrov,1 liter stoji 2$","Zadať","Zrušiť");
if(Benzin[veh]+ litre> 100.0) return ShowPlayerDialog(playerid,DIALOG_BENZINKA,DIALOG_S TYLE_INPUT,"Benzinka","Maximalne si mozes natankovat do 100l\nZadaj počet litrov,1 liter stoji 2$","Zadať","Zrušiť");
if(GetPlayerMoney(playerid) < litre*2) return ShowPlayerDialog(playerid,DIALOG_BENZINKA,DIALOG_S TYLE_INPUT,"Benzinka","Nemas tolko penazi na kupu tolko litrov\nZadaj počet litrov,1 liter stojí 2$","Zadať","Zrušiť");
GivePlayerMoney(playerid,-litre*2);
Benzin[veh] = Benzin[veh]+litre;
TogglePlayerControllable(playerid,1);
}
}