Fuel station
#1

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);
}
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)