SA-MP Forums Archive
[HELP] DIALOG FILLUP COMAND - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [HELP] DIALOG FILLUP COMAND (/showthread.php?tid=608677)



[HELP] DIALOG FILLUP COMAND - Markoni990 - 03.06.2016

I made a command when you fill out toci fuel to dialogue and to choose the fill type gas problem is to fill out the dialogue but when I choose the type of fuel that will not open dialogue and full.

PHP код:
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(playeridSIVA"Ne mozes to na bicikli!");
    if(
GetPlayerState(playerid) != PL_ST_DRIVER) return SCM(playeridSIVA"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(playeridGORIVOPUNJENJEDIALOG_STYLE_LIST"{FF0000}Benzinska Pumpa",stringa,"Unesi","Izlaz");
    }
    return 
true;



PHP код:
if(dialogid == GORIVOPUNJENJE)
{
    if(
response)
        {
         if(
listitem == 0)
        {
            if(!
IsPlayerInAnyVehicle(playerid)) return SCM(playeridSIVA"Nisi u vozilu.");
            if(
IsAnOwnableCar(GetPlayerVehicleID(playerid)) && CarInfo[GetPlayerVehicleID(playerid)][cPlin] == 1) return SCM(playeridSIVA"Vase vozilo je na plin, ne moze ova vrsta!");
            if(
VrstaGoriva(GetPlayerVehicleID(playerid)) != 2) return SCM(playeridSIVA"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(playeridSIVA"Ne moze manje od 1 litar!");
            if(
VoziloNA(GetPlayerVehicleID(playerid))) return SCM(playeridSIVA"Ne mozete u ovo vozilo!");
            if(
OnDuty[playerid] == 0)
            {
                if(
GetPlayerMoney(playerid) < gorivo*136) return SCM(playeridSIVA"Nemate dovoljno novca.");
            }
            if(
Punjenje[playerid] == true) return SCM(playeridSIVA"Vec tocite gorivo.");
            if(!
Benzinske(playerid)) return SCM(playeridSIVA"Morate biti na pumpi.");
            if(
VoziloJeMotor(GetPlayerVehicleID(playerid)))
            {
                if(
gorivo > (40.0-CarInfo[GetPlayerVehicleID(playerid)][cGorivo])) return SCM(playeridSIVA"Zapremina rezervoara je 40 litara!");
                if(
gorivo 40) return SCM(playeridSIVA"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(playeridSIVA"Zapremina rezervoara je 100 litara!");
                if(
gorivo 100) return SCM(playeridSIVA"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(playeridSIVA"Zapremina rezervoara je 60 litara!");
                if(
gorivo 60) return SCM(playeridSIVA"Ne mozes vise od 60 litara za ovo vozilo!");
                if(
PlayerInfo[playerid][pCash] < (gorivo*136))
                 
CarInfo[GetPlayerVehicleID(playerid)][cGorivo] += gorivo;
            }
            
format(stringsizeof(string), "{FFFFFF}Unesite koliko Litara zelite kupiti\n{FF0000}Cena: 1L = 136 Dinara");
            
ShowPlayerDialog(playeridGORIVOPUNJENJEDIALOG_STYLE_INPUT"{FF0000}Benzinska Pumpa",string,"Unesi","Izlaz");
            return 
1;
        }
        if(
listitem == 1)
        {
             if(!
IsPlayerInAnyVehicle(playerid)) return SCM(playeridSIVA"Nisi u vozilu.");
            if(
IsAnOwnableCar(GetPlayerVehicleID(playerid)) && CarInfo[GetPlayerVehicleID(playerid)][cPlin] == 1) return SCM(playeridSIVA"Vase vozilo je na plin, ne moze ova vrsta!");
            if(
VrstaGoriva(GetPlayerVehicleID(playerid)) != 1) return SCM(playeridSIVA"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(playeridSIVA"Ne moze manje od 1 litar!");
            if(
VoziloNA(GetPlayerVehicleID(playerid))) return SCM(playeridSIVA"Ne mozete u ovo vozilo!");
            if(
OnDuty[playerid] == 0)
            {
                if(
GetPlayerMoney(playerid) < gorivo*137) return SCM(playeridSIVA"Nemate dovoljno novca.");
            }
            if(
Punjenje[playerid] == true) return SCM(playeridSIVA"Vec tocite gorivo.");
            if(!
Benzinske(playerid)) return SCM(playeridSIVA"Morate biti na pumpi.");
            if(
VoziloJeMotor(GetPlayerVehicleID(playerid)))
            {
                if(
gorivo > (40.0-CarInfo[GetPlayerVehicleID(playerid)][cGorivo])) return SCM(playeridSIVA"Zapremina rezervoara je 40 litara!");
                if(
gorivo 40) return SCM(playeridSIVA"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(playeridSIVA"Zapremina rezervoara je 100 litara!");
                if(
gorivo 100) return SCM(playeridSIVA"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(playeridSIVA"Zapremina rezervoara je 60 litara!");
                if(
gorivo 60) return SCM(playeridSIVA"Ne mozes vise od 60 litara za ovo vozilo!");
                if(
PlayerInfo[playerid][pCash] < (gorivo*136))
                 
CarInfo[GetPlayerVehicleID(playerid)][cGorivo] += gorivo;
            }
            
format(stringsizeof(string), "{FFFFFF}Unesite koliko Litara zelite kupiti\n{FF0000}Cena: 1L = 136 Dinara");
            
ShowPlayerDialog(playeridGORIVOPUNJENJEDIALOG_STYLE_INPUT"{FF0000}Benzinska Pumpa",string,"Unesi","Izlaz");
            return 
1;
        }
        if(
listitem == 2)
        {
              if(!
IsPlayerInAnyVehicle(playerid)) return SCM(playeridSIVA"Nisi u vozilu.");
            if(
IsAnOwnableCar(GetPlayerVehicleID(playerid)) && CarInfo[GetPlayerVehicleID(playerid)][cPlin] == 0) return SCM(playeridSIVA"Vase vozilo nije na plin, ne moze ova vrsta!");
            if(!
IsAnOwnableCar(GetPlayerVehicleID(playerid))) return SCM(playeridSIVA"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(playeridSIVA"Ne moze manje od 1 litar!");
            if(
VoziloNA(GetPlayerVehicleID(playerid))) return SCM(playeridSIVA"Ne mozete u ovo vozilo!");
            if(
OnDuty[playerid] == 0)
            {
                if(
GetPlayerMoney(playerid) < gorivo*62) return SCM(playeridSIVA"Nemate dovoljno novca.");
            }
            if(
Punjenje[playerid] == true) return SCM(playeridSIVA"Vec tocite gorivo.");
            if(!
Benzinske(playerid)) return SCM(playeridSIVA"Morate biti na pumpi.");
            if(
VoziloJeMotor(GetPlayerVehicleID(playerid)))
            {
                if(
gorivo > (40.0-CarInfo[GetPlayerVehicleID(playerid)][cGorivo])) return SCM(playeridSIVA"Zapremina rezervoara je 40 litara!");
                if(
gorivo 40) return SCM(playeridSIVA"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(playeridSIVA"Zapremina rezervoara je 100 litara!");
                if(
gorivo 100) return SCM(playeridSIVA"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(playeridSIVA"Zapremina rezervoara je 60 litara!");
                if(
gorivo 60) return SCM(playeridSIVA"Ne mozes vise od 60 litara za ovo vozilo!");
                if(
PlayerInfo[playerid][pCash] < (gorivo*62))
                 
CarInfo[GetPlayerVehicleID(playerid)][cGorivo] += gorivo;
            }
            
format(stringsizeof(string), "{FFFFFF}Unesite koliko Litara zelite kupiti\n{FF0000}Cena: 1L = 136 Dinara");
            
ShowPlayerDialog(playeridGORIVOPUNJENJEDIALOG_STYLE_INPUT"{FF0000}Benzinska Pumpa",string,"Unesi","Izlaz");
            return 
1;
        }
    }
return 
1;




Re: [HELP] DIALOG FILLUP COMAND - ilijap - 03.06.2016

nisam te razumeo nista de pisi na balkanski


Re: [HELP] DIALOG FILLUP COMAND - Markoni990 - 03.06.2016

Brate nece da mi radi dialog kad izaberem naprimer benzin i sad treba da izbaci dialog koliko litara hocu ono nece da izbaci.


Re: [HELP] DIALOG FILLUP COMAND - ilijap - 03.06.2016

Quote:
Originally Posted by Markoni990
Посмотреть сообщение
Brate nece da mi radi dialog kad izaberem naprimer benzin i sad treba da izbaci dialog koliko litara hocu ono nece da izbaci.
Sacekaj.


Re: [HELP] DIALOG FILLUP COMAND - ilijap - 03.06.2016

Probaj ovako

Dodaj nov dialog VNESIGORIVO (ili dr) i var PunjenjeGorivo[MAX_PLAYERS] najgore,

PHP код:
if(dialogid == VNESIGORIVO)
{
    if(
response)
    {
        if(!
IsPlayerInAnyVehicle(playerid)) return SCM(playeridSIVA"Nisi u vozilu.");
        if(
PunjenjeGorivo[playerid] == 1) if(IsAnOwnableCar(GetPlayerVehicleID(playerid)) && CarInfo[GetPlayerVehicleID(playerid)][cBenzin] == 0) return SCM(playeridSIVA"Vase vozilo nije na benzin, ne moze ova vrsta!");
        if(
PunjenjeGorivo[playerid] == 2) if(IsAnOwnableCar(GetPlayerVehicleID(playerid)) && CarInfo[GetPlayerVehicleID(playerid)][cDizel] == 0) return SCM(playeridSIVA"Vase vozilo nije na dizel, ne moze ova vrsta!");
        if(
PunjenjeGorivo[playerid] == 3) if(IsAnOwnableCar(GetPlayerVehicleID(playerid)) && CarInfo[GetPlayerVehicleID(playerid)][cPlin] == 0) return SCM(playeridSIVA"Vase vozilo nije na plin, ne moze ova vrsta!");
        if(!
IsAnOwnableCar(GetPlayerVehicleID(playerid))) return SCM(playeridSIVA"Ne mozes na ovom vozilu dopuniti gorivo!");
        new 
gorivo;
        if(
sscanf(inputtext"d"gorivo))
        {
            
format(stringsizeof(string), "{FFFFFF}Unesite koliko Litara zelite kupiti\n{FF0000}Cena: 1L = 136 Dinara");
            
ShowPlayerDialog(playeridGORIVOPUNJENJEDIALOG_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(playeridSIVA"Ne moze manje od 1 litar!");
        if(
VoziloNA(GetPlayerVehicleID(playerid))) return SCM(playeridSIVA"Ne mozete u ovo vozilo!");
        if(
OnDuty[playerid] == 0)
        {
            if(
GetPlayerMoney(playerid) < gorivo*62) return SCM(playeridSIVA"Nemate dovoljno novca.");
        }
        if(
Punjenje[playerid] == true) return SCM(playeridSIVA"Vec tocite gorivo.");
        if(!
Benzinske(playerid)) return SCM(playeridSIVA"Morate biti na pumpi.");
        if(
VoziloJeMotor(GetPlayerVehicleID(playerid)))
        {
            if(
gorivo > (40.0-CarInfo[GetPlayerVehicleID(playerid)][cGorivo])) return SCM(playeridSIVA"Zapremina rezervoara je 40 litara!");
            if(
gorivo 40) return SCM(playeridSIVA"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(playeridSIVA"Zapremina rezervoara je 100 litara!");
            if(
gorivo 100) return SCM(playeridSIVA"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(playeridSIVA"Zapremina rezervoara je 60 litara!");
            if(
gorivo 60) return SCM(playeridSIVA"Ne mozes vise od 60 litara za ovo vozilo!");
            if(
PlayerInfo[playerid][pCash] < (gorivo*62))
            
CarInfo[GetPlayerVehicleID(playerid)][cGorivo] += gorivo;
        }
    }

I ovaj dialog zameni go:

PHP код:
if(dialogid == GORIVOPUNJENJE)
{
    if(
response)
        {
         if(
listitem == 0)
        {
            
PunjenjeGorivo[playerid] = 1;
            
format(stringsizeof(string), "{FFFFFF}Unesite koliko Litara zelite kupiti\n{FF0000}Cena: 1L = 136 Dinara");
            
ShowPlayerDialog(playeridGORIVOPUNJENJEDIALOG_STYLE_INPUT"{FF0000}Benzinska Pumpa",string,"Unesi","Izlaz");
            return 
1;
        }
        if(
listitem == 1)
        {
            
PunjenjeGorivo[playerid] = 2;
            
format(stringsizeof(string), "{FFFFFF}Unesite koliko Litara zelite kupiti\n{FF0000}Cena: 1L = 136 Dinara");
            
ShowPlayerDialog(playeridGORIVOPUNJENJEDIALOG_STYLE_INPUT"{FF0000}Benzinska Pumpa",string,"Unesi","Izlaz");
            return 
1;
        }
        if(
listitem == 2)
        {
            
PunjenjeGorivo[playerid] = 3;
            
format(stringsizeof(string), "{FFFFFF}Unesite koliko Litara zelite kupiti\n{FF0000}Cena: 1L = 136 Dinara");
            
ShowPlayerDialog(playeridGORIVOPUNJENJEDIALOG_STYLE_INPUT"{FF0000}Benzinska Pumpa",string,"Unesi","Izlaz");
            return 
1;
        }
    }
return 
1;

Nadam se da si me razumeo posto sam iz makedoniju :P


Re: [HELP] DIALOG FILLUP COMAND - Markoni990 - 04.06.2016

Nece i dalje brt