SA-MP Forums Archive
[Ajuda] HELP ME DIALOG_STYLE_INPUT - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] HELP ME DIALOG_STYLE_INPUT (/showthread.php?tid=630639)



HELP ME DIALOG_STYLE_INPUT - Alucynious - 17.03.2017

Hello need a dialog but I do not know how to make command / fuel

display DIALOG_STYLE_LIST and when typing the liters in DIALOG_STYLE_INPUT

















PHP код:
if(strcmp(cmd"/fuel"true) == 0)
            {
                
tmp strtok(cmdtextidx);
                if(!
strlen(tmp))
                {
                    
SendClientMessage(playeridCOR_ERRO"Valid use: /fuel Gasoline [Liters]");
                return 
1;
                }
                new 
amount;
                
amount strval(tmp);
                
                
                if(
amount 100 || amount 1)    return SendClientMessage(playeridCOR_ERRO"Invalid quantity!");
                
                if(
pInfo[playerid][GasG] >= 100)    return SendClientMessage(playeridCOR_ERRO"Your tank is already full!");
                
                if(
GetPlayerCash(playerid) < amount*5)    return SendClientMessage(playeridCOR_ERRO"You do not have the amount you need!");
                
                if(
pInfo[playerid][GasG]+amount <= 100)
                {
                    
                    
                    new 
preco amount*5;
                    
                    
                    
TogglePlayerControllable(playeridtrue);
                    
                    
                    new 
AgoraV pInfo[playerid][GasG] + amount;
                    
pInfo[playerid][GasG] = AgoraV;
                    
sGivePlayerCash(playerid, -preco);
                     
format(gStrsizeof(gStr), "fuel %d Liters  Gasoline"amount);
                    
SendClientMessage(playeridAZUL_BMOgStr);
                }
                else
                {
                    new 
precofull 100-pInfo[playerid][GasG];
                    
TogglePlayerControllable(playeridtrue);
                    
pInfo[playerid][GasG] = 100;
                    
sGivePlayerCash(playerid, -precofull*5);
                    
format(gStrsizeof(gStr), "fuel %d Liters  Gasoline."precofull);
                    
SendClientMessage(playeridAZUL_BMOgStr);
                }
                
SetTimerEx("To Fuel"3000false"i"playerid);
                
TogglePlayerControllable(playeridfalse);
                return 
1;
            } 



Sorry my bad English [by ****** Transllater] - RazorGuigo - 17.03.2017

Wrong area! Only the Portuguese language is allowed here!