Whats wrong with this dialog code?
#1

Actual Dialog Code
pawn Код:
CMD:help(playerid, params[])
{
    ShowPlayerDialog(playerid,123,DIALOG_STYLE_LIST,"Help Dialog","General Commands\nAdministrator Help\nCookie Help\Administrator level 1 commands\nAdministrator level 2 commands\nAdministrator level 3 commands\nAdministrator level 4 commands","OK","Cancel");
    return 1;
}

Dialog Response
pawn Код:
if(dialogid == 123 && response)
    {
        switch(listitem)
        {
       
            case 0:
            {
                ShowPlayerDialog(playerid, 301,DIALOG_STYLE_MSGBOX,"General Commands","/help, /shop, /kill, /locker, /afk, /back\n /rules, /admins, /admin, /report, /cshop\n /mycookies, /stats, /bug, /sug","OK","");
            }
            case 1:
            {
                ShowPlayerDialog(playerid, 302,DIALOG_STYLE_MSGBOX, "Administrator Help","In order to be on the Administrator Team, you need to be active, help people, and be mature.","OK","");
            }
            case 2:
            {
                ShowPlayerDialog(playerid, 302,DIALOG_STYLE_MSGBOX, "Cookie Help","Cookies are rewards given to you for good behavior.\nYou can use your cookies at the /cshop","OK","");
            }
            case 3:
            if(PlayerInfo[playerid][pAdmin]>=1)
            {
                ShowPlayerDialog(playerid, 303,DIALOG_STYLE_MSGBOX, "Admin Level 1 Commands","/ah, /pm, /clearchat, /goto, /a, /fakechat, /askin","OK","");
            }
            else if(PlayerInfo[playerid][pAdmin] < 1)
            {
                SendClientMessage(playerid, COLOR_BRIGHTRED, "You're not admin level 1!");
            }
                        case 4:
            if(PlayerInfo[playerid][pAdmin]>=2)
            {
                ShowPlayerDialog(playerid, 403,DIALOG_STYLE_MSGBOX, "Admin Level 2 Commands","/ah, /pm, /clearchat, /goto, /a, /fakechat, /askin \n/mute, /unmute, /unban, /warn, /mode, /gethere, /repair, /fix, /veh, /ban \n /ashop, /setskin, /asay, /spec, /specoff, /kick, /givecookie, /resetcookies, /weather","OK","");
            }
            else if(PlayerInfo[playerid][pAdmin] < 2)
            {
                SendClientMessage(playerid, COLOR_BRIGHTRED, "You're not admin level 2!");
                }
                        case 5:
            if(PlayerInfo[playerid][pAdmin]>=3)
            {
                ShowPlayerDialog(playerid, 333,DIALOG_STYLE_MSGBOX, "Admin Level 3 Commands","/ah, /pm, /clearchat, /goto, /a, /fakechat, /askin \n/mute, /unmute, /unban, /warn, /mode, /gethere, /repair, /fix, /veh, /ban \n /ashop, /setskin, /asay, /spec, /specoff, /kick, /givecookie, /resetcookies, /weather\n /resetwarns, /freeze, /unfreeze, /hh, /sethp, /setarmour, /giveweapon, /giveallcookies \n /killall, /giveweaponall, /sethpall, /setarmourall, /ann ","OK","");
            }
            else if(PlayerInfo[playerid][pAdmin] < 3)
            {
                SendClientMessage(playerid, COLOR_BRIGHTRED, "You're not admin level 3!");
                }
                                        case 6:
            if(PlayerInfo[playerid][pAdmin]>=4)
            {
                ShowPlayerDialog(playerid, 344,DIALOG_STYLE_MSGBOX, "Admin Level 4 Commands","/ah, /pm, /clearchat, /goto, /a, /fakechat, /askin \n/mute, /unmute, /unban, /warn, /mode, /gethere, /repair, /fix, /veh, /ban \n /ashop, /setskin, /asay, /spec, /specoff, /kick, /givecookie, /resetcookies, /weather\n /resetwarns, /freeze, /unfreeze, /hh, /sethp, /setarmour, /giveweapon, /giveallcookies \n /killall, /giveweaponall, /sethpall, /setarmourall, /ann \n /givemoney, /god, /gmx","OK","");
            }
            else if(PlayerInfo[playerid][pAdmin] < 4)
            {
                SendClientMessage(playerid, COLOR_BRIGHTRED, "You're not admin level 4!");
                }
           }
        }
    }
Reply
#2

Oh and its these errors I'm getting:
pawn Код:
C:\Users\James\Desktop\SFCRRPG-FTP\Gamemodes\TwackersGM4.pwn(1130) : warning 219: local variable "pstring" shadows a variable at a preceding level
C:\Users\James\Desktop\SFCRRPG-FTP\Gamemodes\TwackersGM4.pwn(1140) : warning 219: local variable "pstring" shadows a variable at a preceding level
C:\Users\James\Desktop\SFCRRPG-FTP\Gamemodes\TwackersGM4.pwn(1150) : warning 219: local variable "pstring" shadows a variable at a preceding level
C:\Users\James\Desktop\SFCRRPG-FTP\Gamemodes\TwackersGM4.pwn(1629) : warning 209: function "OnDialogResponse" should return a value
C:\Users\James\Desktop\SFCRRPG-FTP\Gamemodes\TwackersGM4.pwn(1631) : error 010: invalid function or declaration
C:\Users\James\Desktop\SFCRRPG-FTP\Gamemodes\TwackersGM4.pwn(1633) : error 010: invalid function or declaration
C:\Users\James\Desktop\SFCRRPG-FTP\Gamemodes\TwackersGM4.pwn(1635) : error 010: invalid function or declaration
C:\Users\James\Desktop\SFCRRPG-FTP\Gamemodes\TwackersGM4.pwn(1641) : error 010: invalid function or declaration
C:\Users\James\Desktop\SFCRRPG-FTP\Gamemodes\TwackersGM4.pwn(1643) : error 010: invalid function or declaration
C:\Users\James\Desktop\SFCRRPG-FTP\Gamemodes\TwackersGM4.pwn(1645) : error 010: invalid function or declaration
C:\Users\James\Desktop\SFCRRPG-FTP\Gamemodes\TwackersGM4.pwn(1650) : error 010: invalid function or declaration
C:\Users\James\Desktop\SFCRRPG-FTP\Gamemodes\TwackersGM4.pwn(1655) : error 010: invalid function or declaration
C:\Users\James\Desktop\SFCRRPG-FTP\Gamemodes\TwackersGM4.pwn(1660) : error 010: invalid function or declaration
C:\Users\James\Desktop\SFCRRPG-FTP\Gamemodes\TwackersGM4.pwn(1665) : error 010: invalid function or declaration
C:\Users\James\Desktop\SFCRRPG-FTP\Gamemodes\TwackersGM4.pwn(1670) : error 010: invalid function or declaration
C:\Users\James\Desktop\SFCRRPG-FTP\Gamemodes\TwackersGM4.pwn(1677) : error 010: invalid function or declaration
C:\Users\James\Desktop\SFCRRPG-FTP\Gamemodes\TwackersGM4.pwn(1679) : error 010: invalid function or declaration
C:\Users\James\Desktop\SFCRRPG-FTP\Gamemodes\TwackersGM4.pwn(1681) : error 010: invalid function or declaration
C:\Users\James\Desktop\SFCRRPG-FTP\Gamemodes\TwackersGM4.pwn(1687) : error 010: invalid function or declaration
C:\Users\James\Desktop\SFCRRPG-FTP\Gamemodes\TwackersGM4.pwn(1689) : error 010: invalid function or declaration
C:\Users\James\Desktop\SFCRRPG-FTP\Gamemodes\TwackersGM4.pwn(1691) : error 010: invalid function or declaration
C:\Users\James\Desktop\SFCRRPG-FTP\Gamemodes\TwackersGM4.pwn(1698) : error 010: invalid function or declaration
C:\Users\James\Desktop\SFCRRPG-FTP\Gamemodes\TwackersGM4.pwn(1700) : error 010: invalid function or declaration
C:\Users\James\Desktop\SFCRRPG-FTP\Gamemodes\TwackersGM4.pwn(1710) : error 010: invalid function or declaration
C:\Users\James\Desktop\SFCRRPG-FTP\Gamemodes\TwackersGM4.pwn(1711) : error 010: invalid function or declaration
C:\Users\James\Desktop\SFCRRPG-FTP\Gamemodes\TwackersGM4.pwn(1720) : error 010: invalid function or declaration
C:\Users\James\Desktop\SFCRRPG-FTP\Gamemodes\TwackersGM4.pwn(1722) : error 010: invalid function or declaration
C:\Users\James\Desktop\SFCRRPG-FTP\Gamemodes\TwackersGM4.pwn(1732) : error 010: invalid function or declaration
C:\Users\James\Desktop\SFCRRPG-FTP\Gamemodes\TwackersGM4.pwn(1734) : error 010: invalid function or declaration
C:\Users\James\Desktop\SFCRRPG-FTP\Gamemodes\TwackersGM4.pwn(1744) : error 010: invalid function or declaration

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


26 Errors.
Reply
#3

The function :

pawn Код:
case x:
{
}
Reply
#4

What do you mean by
pawn Код:
case x
{
}
Reply
#5

Try this and fix the inendation.
pawn Код:
if(dialogid == 123 && response)
    {
        switch(listitem)
        {
       
            case 0:
            {
                ShowPlayerDialog(playerid, 301,DIALOG_STYLE_MSGBOX,"General Commands","/help, /shop, /kill, /locker, /afk, /back\n /rules, /admins, /admin, /report, /cshop\n /mycookies, /stats, /bug, /sug","OK","");
            }
            case 1:
            {
                ShowPlayerDialog(playerid, 302,DIALOG_STYLE_MSGBOX, "Administrator Help","In order to be on the Administrator Team, you need to be active, help people, and be mature.","OK","");
            }
            case 2:
            {
                ShowPlayerDialog(playerid, 302,DIALOG_STYLE_MSGBOX, "Cookie Help","Cookies are rewards given to you for good behavior.\nYou can use your cookies at the /cshop","OK","");
            }
            case 3:
            {
            if(PlayerInfo[playerid][pAdmin]>=1)
            {
                ShowPlayerDialog(playerid, 303,DIALOG_STYLE_MSGBOX, "Admin Level 1 Commands","/ah, /pm, /clearchat, /goto, /a, /fakechat, /askin","OK","");
            }
            else if(PlayerInfo[playerid][pAdmin] < 1)
            {
                SendClientMessage(playerid, COLOR_BRIGHTRED, "You're not admin level 1!");
            }
           }
                        case 4:
            {
            if(PlayerInfo[playerid][pAdmin]>=2)
            {
                ShowPlayerDialog(playerid, 403,DIALOG_STYLE_MSGBOX, "Admin Level 2 Commands","/ah, /pm, /clearchat, /goto, /a, /fakechat, /askin \n/mute, /unmute, /unban, /warn, /mode, /gethere, /repair, /fix, /veh, /ban \n /ashop, /setskin, /asay, /spec, /specoff, /kick, /givecookie, /resetcookies, /weather","OK","");
            }
            else if(PlayerInfo[playerid][pAdmin] < 2)
            {
                SendClientMessage(playerid, COLOR_BRIGHTRED, "You're not admin level 2!");
                }
              }
                        case 5:
            {
            if(PlayerInfo[playerid][pAdmin]>=3)
            {
                ShowPlayerDialog(playerid, 333,DIALOG_STYLE_MSGBOX, "Admin Level 3 Commands","/ah, /pm, /clearchat, /goto, /a, /fakechat, /askin \n/mute, /unmute, /unban, /warn, /mode, /gethere, /repair, /fix, /veh, /ban \n /ashop, /setskin, /asay, /spec, /specoff, /kick, /givecookie, /resetcookies, /weather\n /resetwarns, /freeze, /unfreeze, /hh, /sethp, /setarmour, /giveweapon, /giveallcookies \n /killall, /giveweaponall, /sethpall, /setarmourall, /ann ","OK","");
            }
            else if(PlayerInfo[playerid][pAdmin] < 3)
            {
                SendClientMessage(playerid, COLOR_BRIGHTRED, "You're not admin level 3!");
                }
                }
                                        case 6:
            {
            if(PlayerInfo[playerid][pAdmin]>=4)
            {
                ShowPlayerDialog(playerid, 344,DIALOG_STYLE_MSGBOX, "Admin Level 4 Commands","/ah, /pm, /clearchat, /goto, /a, /fakechat, /askin \n/mute, /unmute, /unban, /warn, /mode, /gethere, /repair, /fix, /veh, /ban \n /ashop, /setskin, /asay, /spec, /specoff, /kick, /givecookie, /resetcookies, /weather\n /resetwarns, /freeze, /unfreeze, /hh, /sethp, /setarmour, /giveweapon, /giveallcookies \n /killall, /giveweaponall, /sethpall, /setarmourall, /ann \n /givemoney, /god, /gmx","OK","");
            }
            else if(PlayerInfo[playerid][pAdmin] < 4)
            {
                SendClientMessage(playerid, COLOR_BRIGHTRED, "You're not admin level 4!");
                }
           }
         }
        }
    }
Reply
#6

Now its at
pawn Код:
C:\Users\James\Desktop\SFCRRPG-FTP\Gamemodes\TwackersGM4.pwn(2271) : error 027: invalid character constant
C:\Users\James\Desktop\SFCRRPG-FTP\Gamemodes\TwackersGM4.pwn(2271) : error 027: invalid character constant
C:\Users\James\Desktop\SFCRRPG-FTP\Gamemodes\TwackersGM4.pwn(3231) : warning 213: tag mismatch
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.
because i took a } off the end of it

pawn Код:
if(dialogid == 123 && response)
    {
        switch(listitem)
        {

            case 0:
            {
                ShowPlayerDialog(playerid, 301,DIALOG_STYLE_MSGBOX,"General Commands","/help, /shop, /kill, /locker, /afk, /back\n /rules, /admins, /admin, /report, /cshop\n /mycookies, /stats, /bug, /sug","OK","");
            }
            case 1:
            {
                ShowPlayerDialog(playerid, 302,DIALOG_STYLE_MSGBOX, "Administrator Help","In order to be on the Administrator Team, you need to be active, help people, and be mature.","OK","");
            }
            case 2:
            {
                ShowPlayerDialog(playerid, 302,DIALOG_STYLE_MSGBOX, "Cookie Help","Cookies are rewards given to you for good behavior.\nYou can use your cookies at the /cshop","OK","");
            }
            case 3:
            if(PlayerInfo[playerid][pAdmin]>=1)
            {
                ShowPlayerDialog(playerid, 303,DIALOG_STYLE_MSGBOX, "Admin Level 1 Commands","/ah, /pm, /clearchat, /goto, /a, /fakechat, /askin","OK","");
            }
            else if(PlayerInfo[playerid][pAdmin] < 1)
            {
                SendClientMessage(playerid, COLOR_BRIGHTRED, "You're not admin level 1!");
            }
            case 4:
            if(PlayerInfo[playerid][pAdmin]>=2)
            {
                ShowPlayerDialog(playerid, 403,DIALOG_STYLE_MSGBOX, "Admin Level 2 Commands","/ah, /pm, /clearchat, /goto, /a, /fakechat, /askin \n/mute, /unmute, /unban, /warn, /mode, /gethere, /repair, /fix, /veh, /ban \n /ashop, /setskin, /asay, /spec, /specoff, /kick, /givecookie, /resetcookies, /weather","OK","");
            }
            else if(PlayerInfo[playerid][pAdmin] < 2)
            {
                SendClientMessage(playerid, COLOR_BRIGHTRED, "You're not admin level 2!");
                }
            case 5:
            if(PlayerInfo[playerid][pAdmin]>=3)
            {
                ShowPlayerDialog(playerid, 333,DIALOG_STYLE_MSGBOX, "Admin Level 3 Commands","/ah, /pm, /clearchat, /goto, /a, /fakechat, /askin \n/mute, /unmute, /unban, /warn, /mode, /gethere, /repair, /fix, /veh, /ban \n /ashop, /setskin, /asay, /spec, /specoff, /kick, /givecookie, /resetcookies, /weather\n /resetwarns, /freeze, /unfreeze, /hh, /sethp, /setarmour, /giveweapon, /giveallcookies \n /killall, /giveweaponall, /sethpall, /setarmourall, /ann ","OK","");
            }
            else if(PlayerInfo[playerid][pAdmin] < 3)
            {
                SendClientMessage(playerid, COLOR_BRIGHTRED, "You're not admin level 3!");
                }
            case 6:
            if(PlayerInfo[playerid][pAdmin]>=4)
            {
                ShowPlayerDialog(playerid, 344,DIALOG_STYLE_MSGBOX, "Admin Level 4 Commands","/ah, /pm, /clearchat, /goto, /a, /fakechat, /askin \n/mute, /unmute, /unban, /warn, /mode, /gethere, /repair, /fix, /veh, /ban \n /ashop, /setskin, /asay, /spec, /specoff, /kick, /givecookie, /resetcookies, /weather\n /resetwarns, /freeze, /unfreeze, /hh, /sethp, /setarmour, /giveweapon, /giveallcookies \n /killall, /giveweaponall, /sethpall, /setarmourall, /ann \n /givemoney, /god, /gmx","OK","");
            }
            else if(PlayerInfo[playerid][pAdmin] < 4)
            {
                SendClientMessage(playerid, COLOR_BRIGHTRED, "You're not admin level 4!");
                }
           }
}
Reply
#7

Quote:
Originally Posted by Saw®
Посмотреть сообщение
Try this and fix the inendation.
pawn Код:
if(dialogid == 123 && response)
    {
        switch(listitem)
        {
       
            case 0:
            {
                ShowPlayerDialog(playerid, 301,DIALOG_STYLE_MSGBOX,"General Commands","/help, /shop, /kill, /locker, /afk, /back\n /rules, /admins, /admin, /report, /cshop\n /mycookies, /stats, /bug, /sug","OK","");
            }
            case 1:
            {
                ShowPlayerDialog(playerid, 302,DIALOG_STYLE_MSGBOX, "Administrator Help","In order to be on the Administrator Team, you need to be active, help people, and be mature.","OK","");
            }
            case 2:
            {
                ShowPlayerDialog(playerid, 302,DIALOG_STYLE_MSGBOX, "Cookie Help","Cookies are rewards given to you for good behavior.\nYou can use your cookies at the /cshop","OK","");
            }
            case 3:
            {
            if(PlayerInfo[playerid][pAdmin]>=1)
            {
                ShowPlayerDialog(playerid, 303,DIALOG_STYLE_MSGBOX, "Admin Level 1 Commands","/ah, /pm, /clearchat, /goto, /a, /fakechat, /askin","OK","");
            }
            else if(PlayerInfo[playerid][pAdmin] < 1)
            {
                SendClientMessage(playerid, COLOR_BRIGHTRED, "You're not admin level 1!");
            }
           }
                        case 4:
            {
            if(PlayerInfo[playerid][pAdmin]>=2)
            {
                ShowPlayerDialog(playerid, 403,DIALOG_STYLE_MSGBOX, "Admin Level 2 Commands","/ah, /pm, /clearchat, /goto, /a, /fakechat, /askin \n/mute, /unmute, /unban, /warn, /mode, /gethere, /repair, /fix, /veh, /ban \n /ashop, /setskin, /asay, /spec, /specoff, /kick, /givecookie, /resetcookies, /weather","OK","");
            }
            else if(PlayerInfo[playerid][pAdmin] < 2)
            {
                SendClientMessage(playerid, COLOR_BRIGHTRED, "You're not admin level 2!");
                }
              }
                        case 5:
            {
            if(PlayerInfo[playerid][pAdmin]>=3)
            {
                ShowPlayerDialog(playerid, 333,DIALOG_STYLE_MSGBOX, "Admin Level 3 Commands","/ah, /pm, /clearchat, /goto, /a, /fakechat, /askin \n/mute, /unmute, /unban, /warn, /mode, /gethere, /repair, /fix, /veh, /ban \n /ashop, /setskin, /asay, /spec, /specoff, /kick, /givecookie, /resetcookies, /weather\n /resetwarns, /freeze, /unfreeze, /hh, /sethp, /setarmour, /giveweapon, /giveallcookies \n /killall, /giveweaponall, /sethpall, /setarmourall, /ann ","OK","");
            }
            else if(PlayerInfo[playerid][pAdmin] < 3)
            {
                SendClientMessage(playerid, COLOR_BRIGHTRED, "You're not admin level 3!");
                }
                }
                                        case 6:
            {
            if(PlayerInfo[playerid][pAdmin]>=4)
            {
                ShowPlayerDialog(playerid, 344,DIALOG_STYLE_MSGBOX, "Admin Level 4 Commands","/ah, /pm, /clearchat, /goto, /a, /fakechat, /askin \n/mute, /unmute, /unban, /warn, /mode, /gethere, /repair, /fix, /veh, /ban \n /ashop, /setskin, /asay, /spec, /specoff, /kick, /givecookie, /resetcookies, /weather\n /resetwarns, /freeze, /unfreeze, /hh, /sethp, /setarmour, /giveweapon, /giveallcookies \n /killall, /giveweaponall, /sethpall, /setarmourall, /ann \n /givemoney, /god, /gmx","OK","");
            }
            else if(PlayerInfo[playerid][pAdmin] < 4)
            {
                SendClientMessage(playerid, COLOR_BRIGHTRED, "You're not admin level 4!");
                }
           }
         }
        }
    }
still getting errors.

This is the line where im getting the 2 errors.
pawn Код:
ShowPlayerDialog(playerid,123,DIALOG_STYLE_LIST,"Help Dialog","General Commands\nAdministrator Help\nCookie Help\Administrator level 1 commands\nAdministrator level 2 commands\nAdministrator level 3 commands\nAdministrator level 4 commands","OK","Cancel");
Reply
#8

EDIT : the line above only ?
Reply
#9

Quote:
Originally Posted by Saw®
Посмотреть сообщение
Remove the last " } "
I did, it cut it down to 2 errors, and one warning.
Reply
#10

so , u removed the "}" in the code which i gave you , then you got two errors ? show me them.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)