CMD:fill(playerid,params[])
{
#pragma unused params
new string[256];
new stringa[256];
new pvehh = GetVehicleModel(GetPlayerVehicleID(playerid));
//if(gEngine[playerid] == 0) return SCM(playerid, SIVA, "Vozilo mora biti ugaseno");
//if(Tazovan[playerid] > 0 || Zavezan[playerid] > 0 || Tie[playerid] > 0) return SCM(playerid, SIVA, "Ne mozes to!");
if(VoziloJeBicikla(pvehh)) return SCM(playerid, SIVA, "Ne mozes to na bicikli!");
if(GetPlayerState(playerid) != PL_ST_DRIVER) return SCM(playerid, SIVA, "Moras biti vozac!");
if(pvehh != 509 && pvehh != 481 && pvehh != 510 && pvehh != 519 && pvehh != 520 && pvehh != 553 && pvehh != 592 && pvehh != 460 && pvehh != 476 && pvehh != 511 && pvehh != 512 && pvehh != 513)
{
format(string,sizeof(string),"Dizel\nBenzin\nPlin");
format(stringa,sizeof(stringa),"%s",string);
ShowPlayerDialog(playerid, GORIVOPUNJENJE, DIALOG_STYLE_LIST, "{FF0000}Benzinska Pumpa",stringa,"Unesi","Izlaz");
}
return true;
}
if(dialogid == GORIVOPUNJENJE)
{
if(response)
{
if(listitem == 0)
{
if(!IsPlayerInAnyVehicle(playerid)) return SCM(playerid, SIVA, "Nisi u vozilu.");
if(IsAnOwnableCar(GetPlayerVehicleID(playerid)) && CarInfo[GetPlayerVehicleID(playerid)][cPlin] == 1) return SCM(playerid, SIVA, "Vase vozilo je na plin, ne moze ova vrsta!");
if(VrstaGoriva(GetPlayerVehicleID(playerid)) != 2) return SCM(playerid, SIVA, "Vase vozilo nije dizel.");
new gorivo = strval(inputtext);
new stringc[128];
if(sscanf(inputtext, "d[300]",stringc)) return SCM(playerid, -1, "{0A9DC9}Benzinska Pumpa: {FFFFFF}Unesite koliko litara zelite kupiti");
if(gorivo < 0) return SCM(playerid, SIVA, "Ne moze manje od 1 litar!");
if(VoziloNA(GetPlayerVehicleID(playerid))) return SCM(playerid, SIVA, "Ne mozete u ovo vozilo!");
if(OnDuty[playerid] == 0)
{
if(GetPlayerMoney(playerid) < gorivo*136) return SCM(playerid, SIVA, "Nemate dovoljno novca.");
}
if(Punjenje[playerid] == true) return SCM(playerid, SIVA, "Vec tocite gorivo.");
if(!Benzinske(playerid)) return SCM(playerid, SIVA, "Morate biti na pumpi.");
if(VoziloJeMotor(GetPlayerVehicleID(playerid)))
{
if(gorivo > (40.0-CarInfo[GetPlayerVehicleID(playerid)][cGorivo])) return SCM(playerid, SIVA, "Zapremina rezervoara je 40 litara!");
if(gorivo > 40) return SCM(playerid, SIVA, "Ne mozes vise od 40 litara za ovo vozilo!");
if(PlayerInfo[playerid][pCash] < (gorivo*136))
CarInfo[GetPlayerVehicleID(playerid)][cGorivo] += gorivo;
}
else if(VoziloJeAvion(GetPlayerVehicleID(playerid)) || VoziloJeBrod(GetPlayerVehicleID(playerid)) || VoziloJeKamion(GetPlayerVehicleID(playerid)))
{
if(gorivo > (100.0-CarInfo[GetPlayerVehicleID(playerid)][cGorivo])) return SCM(playerid, SIVA, "Zapremina rezervoara je 100 litara!");
if(gorivo > 100) return SCM(playerid, SIVA, "Ne mozes vise od 100 litara za ovo vozilo!");
if(PlayerInfo[playerid][pCash] < (gorivo*248))
CarInfo[GetPlayerVehicleID(playerid)][cGorivo] += gorivo;
}
else
{
if(gorivo > (60.0-CarInfo[GetPlayerVehicleID(playerid)][cGorivo])) return SCM(playerid, SIVA, "Zapremina rezervoara je 60 litara!");
if(gorivo > 60) return SCM(playerid, SIVA, "Ne mozes vise od 60 litara za ovo vozilo!");
if(PlayerInfo[playerid][pCash] < (gorivo*136))
CarInfo[GetPlayerVehicleID(playerid)][cGorivo] += gorivo;
}
format(string, sizeof(string), "{FFFFFF}Unesite koliko Litara zelite kupiti\n{FF0000}Cena: 1L = 136 Dinara");
ShowPlayerDialog(playerid, GORIVOPUNJENJE, DIALOG_STYLE_INPUT, "{FF0000}Benzinska Pumpa",string,"Unesi","Izlaz");
return 1;
}
if(listitem == 1)
{
if(!IsPlayerInAnyVehicle(playerid)) return SCM(playerid, SIVA, "Nisi u vozilu.");
if(IsAnOwnableCar(GetPlayerVehicleID(playerid)) && CarInfo[GetPlayerVehicleID(playerid)][cPlin] == 1) return SCM(playerid, SIVA, "Vase vozilo je na plin, ne moze ova vrsta!");
if(VrstaGoriva(GetPlayerVehicleID(playerid)) != 1) return SCM(playerid, SIVA, "Vase vozilo nije benzin.");
new gorivo = strval(inputtext);
new stringc[128];
if(sscanf(inputtext, "d[300]",stringc)) return SCM(playerid, -1, "{0A9DC9}Benzinska Pumpa: {FFFFFF}Unesite koliko litara zelite kupiti");
if(gorivo < 1) return SCM(playerid, SIVA, "Ne moze manje od 1 litar!");
if(VoziloNA(GetPlayerVehicleID(playerid))) return SCM(playerid, SIVA, "Ne mozete u ovo vozilo!");
if(OnDuty[playerid] == 0)
{
if(GetPlayerMoney(playerid) < gorivo*137) return SCM(playerid, SIVA, "Nemate dovoljno novca.");
}
if(Punjenje[playerid] == true) return SCM(playerid, SIVA, "Vec tocite gorivo.");
if(!Benzinske(playerid)) return SCM(playerid, SIVA, "Morate biti na pumpi.");
if(VoziloJeMotor(GetPlayerVehicleID(playerid)))
{
if(gorivo > (40.0-CarInfo[GetPlayerVehicleID(playerid)][cGorivo])) return SCM(playerid, SIVA, "Zapremina rezervoara je 40 litara!");
if(gorivo > 40) return SCM(playerid, SIVA, "Ne mozes vise od 40 litara za ovo vozilo!");
if(PlayerInfo[playerid][pCash] < (gorivo*137))
CarInfo[GetPlayerVehicleID(playerid)][cGorivo] += gorivo;
}
else if(VoziloJeAvion(GetPlayerVehicleID(playerid)) || VoziloJeBrod(GetPlayerVehicleID(playerid)) || VoziloJeKamion(GetPlayerVehicleID(playerid)))
{
if(gorivo > (100.0-CarInfo[GetPlayerVehicleID(playerid)][cGorivo])) return SCM(playerid, SIVA, "Zapremina rezervoara je 100 litara!");
if(gorivo > 100) return SCM(playerid, SIVA, "Ne mozes vise od 100 litara za ovo vozilo!");
if(PlayerInfo[playerid][pCash] < (gorivo*236))
CarInfo[GetPlayerVehicleID(playerid)][cGorivo] += gorivo;
}
else
{
if(gorivo > (60.0-CarInfo[GetPlayerVehicleID(playerid)][cGorivo])) return SCM(playerid, SIVA, "Zapremina rezervoara je 60 litara!");
if(gorivo > 60) return SCM(playerid, SIVA, "Ne mozes vise od 60 litara za ovo vozilo!");
if(PlayerInfo[playerid][pCash] < (gorivo*136))
CarInfo[GetPlayerVehicleID(playerid)][cGorivo] += gorivo;
}
format(string, sizeof(string), "{FFFFFF}Unesite koliko Litara zelite kupiti\n{FF0000}Cena: 1L = 136 Dinara");
ShowPlayerDialog(playerid, GORIVOPUNJENJE, DIALOG_STYLE_INPUT, "{FF0000}Benzinska Pumpa",string,"Unesi","Izlaz");
return 1;
}
if(listitem == 2)
{
if(!IsPlayerInAnyVehicle(playerid)) return SCM(playerid, SIVA, "Nisi u vozilu.");
if(IsAnOwnableCar(GetPlayerVehicleID(playerid)) && CarInfo[GetPlayerVehicleID(playerid)][cPlin] == 0) return SCM(playerid, SIVA, "Vase vozilo nije na plin, ne moze ova vrsta!");
if(!IsAnOwnableCar(GetPlayerVehicleID(playerid))) return SCM(playerid, SIVA, "Ne mozes na ovom vozilu dopuniti plin!");
new gorivo = strval(inputtext);
new stringc[128];
if(sscanf(inputtext, "d[300]",stringc)) return SCM(playerid, -1, "{0A9DC9}Benzinska Pumpa: {FFFFFF}Unesite koliko litara zelite kupiti");
if(gorivo < 1) return SCM(playerid, SIVA, "Ne moze manje od 1 litar!");
if(VoziloNA(GetPlayerVehicleID(playerid))) return SCM(playerid, SIVA, "Ne mozete u ovo vozilo!");
if(OnDuty[playerid] == 0)
{
if(GetPlayerMoney(playerid) < gorivo*62) return SCM(playerid, SIVA, "Nemate dovoljno novca.");
}
if(Punjenje[playerid] == true) return SCM(playerid, SIVA, "Vec tocite gorivo.");
if(!Benzinske(playerid)) return SCM(playerid, SIVA, "Morate biti na pumpi.");
if(VoziloJeMotor(GetPlayerVehicleID(playerid)))
{
if(gorivo > (40.0-CarInfo[GetPlayerVehicleID(playerid)][cGorivo])) return SCM(playerid, SIVA, "Zapremina rezervoara je 40 litara!");
if(gorivo > 40) return SCM(playerid, SIVA, "Ne mozes vise od 40 litara za ovo vozilo!");
if(PlayerInfo[playerid][pCash] < (gorivo*62))
CarInfo[GetPlayerVehicleID(playerid)][cGorivo] += gorivo;
}
else if(VoziloJeAvion(GetPlayerVehicleID(playerid)) || VoziloJeBrod(GetPlayerVehicleID(playerid)) || VoziloJeKamion(GetPlayerVehicleID(playerid)))
{
if(gorivo > (100.0-CarInfo[GetPlayerVehicleID(playerid)][cGorivo])) return SCM(playerid, SIVA, "Zapremina rezervoara je 100 litara!");
if(gorivo > 100) return SCM(playerid, SIVA, "Ne mozes vise od 100 litara za ovo vozilo!");
if(PlayerInfo[playerid][pCash] < (gorivo*236))
CarInfo[GetPlayerVehicleID(playerid)][cGorivo] += gorivo;
}
else
{
if(gorivo > (60.0-CarInfo[GetPlayerVehicleID(playerid)][cGorivo])) return SCM(playerid, SIVA, "Zapremina rezervoara je 60 litara!");
if(gorivo > 60) return SCM(playerid, SIVA, "Ne mozes vise od 60 litara za ovo vozilo!");
if(PlayerInfo[playerid][pCash] < (gorivo*62))
CarInfo[GetPlayerVehicleID(playerid)][cGorivo] += gorivo;
}
format(string, sizeof(string), "{FFFFFF}Unesite koliko Litara zelite kupiti\n{FF0000}Cena: 1L = 136 Dinara");
ShowPlayerDialog(playerid, GORIVOPUNJENJE, DIALOG_STYLE_INPUT, "{FF0000}Benzinska Pumpa",string,"Unesi","Izlaz");
return 1;
}
}
return 1;
}
Brate nece da mi radi dialog kad izaberem naprimer benzin i sad treba da izbaci dialog koliko litara hocu ono nece da izbaci.
|
if(dialogid == VNESIGORIVO)
{
if(response)
{
if(!IsPlayerInAnyVehicle(playerid)) return SCM(playerid, SIVA, "Nisi u vozilu.");
if(PunjenjeGorivo[playerid] == 1) if(IsAnOwnableCar(GetPlayerVehicleID(playerid)) && CarInfo[GetPlayerVehicleID(playerid)][cBenzin] == 0) return SCM(playerid, SIVA, "Vase vozilo nije na benzin, ne moze ova vrsta!");
if(PunjenjeGorivo[playerid] == 2) if(IsAnOwnableCar(GetPlayerVehicleID(playerid)) && CarInfo[GetPlayerVehicleID(playerid)][cDizel] == 0) return SCM(playerid, SIVA, "Vase vozilo nije na dizel, ne moze ova vrsta!");
if(PunjenjeGorivo[playerid] == 3) if(IsAnOwnableCar(GetPlayerVehicleID(playerid)) && CarInfo[GetPlayerVehicleID(playerid)][cPlin] == 0) return SCM(playerid, SIVA, "Vase vozilo nije na plin, ne moze ova vrsta!");
if(!IsAnOwnableCar(GetPlayerVehicleID(playerid))) return SCM(playerid, SIVA, "Ne mozes na ovom vozilu dopuniti gorivo!");
new gorivo;
if(sscanf(inputtext, "d", gorivo))
{
format(string, sizeof(string), "{FFFFFF}Unesite koliko Litara zelite kupiti\n{FF0000}Cena: 1L = 136 Dinara");
ShowPlayerDialog(playerid, GORIVOPUNJENJE, DIALOG_STYLE_INPUT, "{FF0000}Benzinska Pumpa",string,"Unesi","Izlaz");
SCM(playerid, -1, "{0A9DC9}Benzinska Pumpa: {FFFFFF}Unesite koliko litara zelite kupiti");
return 1;
if(gorivo < 1) return SCM(playerid, SIVA, "Ne moze manje od 1 litar!");
if(VoziloNA(GetPlayerVehicleID(playerid))) return SCM(playerid, SIVA, "Ne mozete u ovo vozilo!");
if(OnDuty[playerid] == 0)
{
if(GetPlayerMoney(playerid) < gorivo*62) return SCM(playerid, SIVA, "Nemate dovoljno novca.");
}
if(Punjenje[playerid] == true) return SCM(playerid, SIVA, "Vec tocite gorivo.");
if(!Benzinske(playerid)) return SCM(playerid, SIVA, "Morate biti na pumpi.");
if(VoziloJeMotor(GetPlayerVehicleID(playerid)))
{
if(gorivo > (40.0-CarInfo[GetPlayerVehicleID(playerid)][cGorivo])) return SCM(playerid, SIVA, "Zapremina rezervoara je 40 litara!");
if(gorivo > 40) return SCM(playerid, SIVA, "Ne mozes vise od 40 litara za ovo vozilo!");
if(PlayerInfo[playerid][pCash] < (gorivo*62))
CarInfo[GetPlayerVehicleID(playerid)][cGorivo] += gorivo;
}
else if(VoziloJeAvion(GetPlayerVehicleID(playerid)) || VoziloJeBrod(GetPlayerVehicleID(playerid)) || VoziloJeKamion(GetPlayerVehicleID(playerid)))
{
if(gorivo > (100.0-CarInfo[GetPlayerVehicleID(playerid)][cGorivo])) return SCM(playerid, SIVA, "Zapremina rezervoara je 100 litara!");
if(gorivo > 100) return SCM(playerid, SIVA, "Ne mozes vise od 100 litara za ovo vozilo!");
if(PlayerInfo[playerid][pCash] < (gorivo*236))
CarInfo[GetPlayerVehicleID(playerid)][cGorivo] += gorivo;
}
else
{
if(gorivo > (60.0-CarInfo[GetPlayerVehicleID(playerid)][cGorivo])) return SCM(playerid, SIVA, "Zapremina rezervoara je 60 litara!");
if(gorivo > 60) return SCM(playerid, SIVA, "Ne mozes vise od 60 litara za ovo vozilo!");
if(PlayerInfo[playerid][pCash] < (gorivo*62))
CarInfo[GetPlayerVehicleID(playerid)][cGorivo] += gorivo;
}
}
}
if(dialogid == GORIVOPUNJENJE)
{
if(response)
{
if(listitem == 0)
{
PunjenjeGorivo[playerid] = 1;
format(string, sizeof(string), "{FFFFFF}Unesite koliko Litara zelite kupiti\n{FF0000}Cena: 1L = 136 Dinara");
ShowPlayerDialog(playerid, GORIVOPUNJENJE, DIALOG_STYLE_INPUT, "{FF0000}Benzinska Pumpa",string,"Unesi","Izlaz");
return 1;
}
if(listitem == 1)
{
PunjenjeGorivo[playerid] = 2;
format(string, sizeof(string), "{FFFFFF}Unesite koliko Litara zelite kupiti\n{FF0000}Cena: 1L = 136 Dinara");
ShowPlayerDialog(playerid, GORIVOPUNJENJE, DIALOG_STYLE_INPUT, "{FF0000}Benzinska Pumpa",string,"Unesi","Izlaz");
return 1;
}
if(listitem == 2)
{
PunjenjeGorivo[playerid] = 3;
format(string, sizeof(string), "{FFFFFF}Unesite koliko Litara zelite kupiti\n{FF0000}Cena: 1L = 136 Dinara");
ShowPlayerDialog(playerid, GORIVOPUNJENJE, DIALOG_STYLE_INPUT, "{FF0000}Benzinska Pumpa",string,"Unesi","Izlaz");
return 1;
}
}
return 1;
}