HELP ME DIALOG_STYLE_INPUT
#1

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


Forum Jump:


Users browsing this thread: 1 Guest(s)