Dialog won't work
#1

I'm making a tokens FS and eveyrhting work correctly just.. the dialog in the last of the script won't open IG... plz help me in this

http://pastebin.com/MRMybDeM
Reply
#2

Copy the code which dialog doesn't appear not your whole GM/FS.
Reply
#3

PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    if(
dialogid == FIRSTMENU)
    {
        if(
response)
        {
            if(
listitem == 0// Weapons
            
{
                
ShowPlayerDialog(playerid,FIRSTMENU+2,DIALOG_STYLE_LIST,
                
"Regular Players Lounge",
                
"MP5\nCombat Shotgun\nDesert Eagle\nM4\nAK-47\nBack",
                
"Select""Exit");
            }
         }
      }
     if(
dialogid == FIRSTMENU+2// Weapons
      
{
           if(
response)
        {
              if(
listitem == 0// MP5
            
{
                new 
ammo GetPlayerAmmo(playerid);
                if(
ammo >=600)
                    {
                        
SendClientMessage(playeridCOLOR_GREY,
                        
"Sorry you have all the free ammo we can give you for now");
                    }
                if(
GetPlayerMoney(playerid) < 15000)
                    {
                    
SendClientMessage(playeridCOLOR_GREY,"* You cannot afford this!");
                    }
                    else
                
GivePlayerMoney(playerid, -15000);
                
GivePlayerWeapon(playerid29200);
            }
            if(
listitem == 1// Chainsaw
               
{
                new 
ammo GetPlayerAmmo(playerid);
                if(
ammo >400)
                    {
                        
SendClientMessage(playeridCOLOR_GREY,
                        
"Sorry you have all the free ammo we can give you for now");
                    }
                if(
GetPlayerMoney(playerid) < 8000)
                    {
                    
SendClientMessage(playeridCOLOR_GREY,"* You cannot afford this!");
                    }
                    else
                
GivePlayerWeapon(playerid,25 ,25);
                
GivePlayerMoney(playerid, -8000);
              }
          }
      }
       return 
1;
  } 
Reply
#4

Why are you using FIRSTMENU+2? That is possibily causing the issue, use dialog == 0, dialog == 1.
Reply
#5

Can you fix it for me if possible ? i don't understand what you're trying to tell me exactly
Reply
#6

Your indentation is completly wrong.
Like MotherDucker said, define your dialogid before use it.
PHP код:
#define FIRSTMENU    990
#define SECONDMENU  991
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    if(
dialogid == FIRSTMENU)
    {
        if(
reponse)
        {
            if(
listitem == 0)
            {
                
ShowPlayerDialog(playeridSECONDMENUDIALOG_STYLE_LIST,
                
"Regular Players Lounge",
                
"MP5\nCombat Shotgun\nDesert Eagle\nM4\nAK-47\nBack",
                
"Select""Exit");
            }
        }
    }
    
    if(
dialogid == SECONDMENU)
    {
        if(
reponse)
        {
            switch(
listitem)
              {
                case 
0:
                {
                    new 
ammo GetPlayerAmmo(playerid);
                    if(
ammo >= 600) return SendClientMessage(playeridCOLOR_GREY"Sorry you have all the free ammo we can give you for now");
                    if(
GetPlayerMoney(playerid) < 15000) return SendClientMessage(playeridCOLOR_GREY,"* You cannot afford this!");
                    
GivePlayerMoney(playerid, -15000);
                    
GivePlayerWeapon(playerid29200);
                    return 
1;
                }
                case 
1:
                {
                    new 
ammo GetPlayerAmmo(playerid);
                    if(
ammo 400) return SendClientMessage(playeridCOLOR_GREY"Sorry you have all the free ammo we can give you for now");
                    if(
GetPlayerMoney(playerid) < 8000) return SendClientMessage(playeridCOLOR_GREY,"* You cannot afford this!");
                    
GivePlayerWeapon(playerid,25 ,25);
                    
GivePlayerMoney(playerid, -8000);
                    return 
1;
                }
                default : return 
1;
            }
               return 
1;
        }
    }
     return 
1;

pastbin with right indentation: http://pastebin.com/n6vPZuHC
Reply
#7

Excuse me but i still got the same problem
Reply
#8

Which command call FIRSTMENU ?
Reply
#9

Here is it

PHP код:
COMMAND:buyweapons(playeridparams[])
{
    if(
IsPlayerConnected(playerid))
    {
        if(
IsPlayerInRangeOfPoint(playerid31720.9337, -1629.047920.2135))
        {
            
ShowPlayerDialog(playeridFIRSTMENUDIALOG_STYLE_LIST,
                
"Weapons List",
                
"MP5           5 Tokens\nShotgun       5 Tokens\nDesert Eagle  5 Tokens\nCombat Shotgun5 Tokens\nM4            5 Tokens\nAK-47         5 Tokens\nSniper Rifle  5 Tokens",
                
"Select""Exit");
        }
        else
        {
            
SendClientMessage(playeridCOLOR_GREY"You Are not at the weapon point!");
                }
            }
    return 
1;
        } 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)