Dialog size
#1

Hi I'm creating a command to view all possible admin commands however I get an error stating that the string is too long. I was wondering how would I make the dialog bigger or something else?

PHP код:
    if(dialogid == DIALOG_CMDS_ADMIN)
    {
        if(
response)
        {
            if(
PlayerInfo[playerid][pAdmin] == 1)
            {
                switch(
listitem)
                {
                    case 
0:    ShowPlayerDialog(playeridDIALOG_RP_CMDSDIALOG_STYLE_MSGBOX"Roleplay Commands""/me, /do, /s, /shout""Close","");
                    case 
1:    ShowPlayerDialog(playeridDIALOG_VEH_CMDSDIALOG_STYLE_MSGBOX"Vehicle Commands""/opendoors, /closedoors, /opencarwindows, /closecarwindows, /openboot, /closeboot, /openbonnet, /closebonnet, /engine, /lights, /kph, /mph, /hidspeedo, /showspeedo""Close","");
                    case 
2:    ShowPlayerDialog(playeridDIALOG_GEN_CMDSDIALOG_STYLE_MSGBOX"General Commands""/admins, /afk, /back, /help, /report, /ask, /commands, /actions, /changename, /password, /civil""Close","");
                    case 
3:    ShowPlayerDialog(playeridDIALOG_PH_CMDSDIALOG_STYLE_MSGBOX"House Commands""/buyprop, /sellprop, /lockprop, /propdoor""Close","");
                    case 
4:    ShowPlayerDialog(playeridDIALOG_PORG_CMDSDIALOG_STYLE_MSGBOX"Organization Commands""/org, /ochat, /lc, /orgs, /want""Close","");
                    case 
5:    ShowPlayerDialog(playeridDIALOG_PBUS_CMDSDIALOG_STYLE_MSGBOX"Business Commands""/bnear, /buybus, /sellbus, /lockbus, /busdoor""Close","");
                    case 
6:    ShowPlayerDialog(playeridDIALOG_SCMDSDIALOG_STYLE_MSGBOX"{00E5EE}Support Commands""/sc, /scolor, /reply, /declinehelp""Close","");
                    case 
7:    ShowPlayerDialog(playeridDIALOG_ACMDSDIALOG_STYLE_MSGBOX"{FF0000}Admininstrator Commands""{DB881A}Level 1{FFFFFF} - /asay, /kick, /freeze, /unfreeze, /ac, /clear, /disarm, /checkplayer, /spectate, /stopspec, /acceptreport, /declinereport, /reports, /weather""Close","");
                    case 
8ShowPlayerDialog(playeridDIALOG_VIP_CMDSDIALOG_STYLE_MSGBOX"{FF69B4}VIP Commands""Nothing here, yet""Close","");
                }
            }
            else if(
PlayerInfo[playerid][pAdmin] == 2)
            {
                switch(
listitem)
                {
                    case 
0:    ShowPlayerDialog(playeridDIALOG_RP_CMDSDIALOG_STYLE_MSGBOX"Roleplay Commands""/me, /do, /s, /shout""Close","");
                    case 
1:    ShowPlayerDialog(playeridDIALOG_VEH_CMDSDIALOG_STYLE_MSGBOX"Vehicle Commands""/opendoors, /closedoors, /opencarwindows, /closecarwindows, /openboot, /closeboot, /openbonnet, /closebonnet, /engine, /lights, /kph, /mph, /hidspeedo, /showspeedo""Close","");
                    case 
2:    ShowPlayerDialog(playeridDIALOG_GEN_CMDSDIALOG_STYLE_MSGBOX"General Commands""/admins, /afk, /back, /help, /report, /ask, /commands, /actions, /changename, /password, /civil""Close","");
                    case 
3:    ShowPlayerDialog(playeridDIALOG_PH_CMDSDIALOG_STYLE_MSGBOX"House Commands""/buyprop, /sellprop, /lockprop, /propdoor""Close","");
                    case 
4:    ShowPlayerDialog(playeridDIALOG_PORG_CMDSDIALOG_STYLE_MSGBOX"Organization Commands""/org, /ochat, /lc, /orgs, /want""Close","");
                    case 
5:    ShowPlayerDialog(playeridDIALOG_PBUS_CMDSDIALOG_STYLE_MSGBOX"Business Commands""/bnear, /buybus, /sellbus, /lockbus, /busdoor""Close","");
                    case 
6:    ShowPlayerDialog(playeridDIALOG_SCMDSDIALOG_STYLE_MSGBOX"{00E5EE}Support Commands""/sc, /scolor, /reply, /declinehelp""Close","");
                    case 
7:    ShowPlayerDialog(playeridDIALOG_ACMDSDIALOG_STYLE_MSGBOX"{FF0000}Admininstrator Commands""{DB881A}Level 1{FFFFFF} - /asay, /kick, /freeze, /unfreeze, /ac, /clear, /disarm, /checkplayer, /spectate, /stopspec, /acceptreport, /declinereport, /reports, /weather\n{1B1BE0}Level 2{FFFFFF} - /goto, /get, /banip, /ban, /listen, /settime""Close","");
                    case 
8ShowPlayerDialog(playeridDIALOG_VIP_CMDSDIALOG_STYLE_MSGBOX"{FF69B4}VIP Commands""Nothing here, yet""Close","");
                }
            }
            else if(
PlayerInfo[playerid][pAdmin] == 3)
            {
                switch(
listitem)
                {
                    case 
0:    ShowPlayerDialog(playeridDIALOG_RP_CMDSDIALOG_STYLE_MSGBOX"Roleplay Commands""/me, /do, /s, /shout""Close","");
                    case 
1:    ShowPlayerDialog(playeridDIALOG_VEH_CMDSDIALOG_STYLE_MSGBOX"Vehicle Commands""/opendoors, /closedoors, /opencarwindows, /closecarwindows, /openboot, /closeboot, /openbonnet, /closebonnet, /engine, /lights, /kph, /mph, /hidspeedo, /showspeedo""Close","");
                    case 
2:    ShowPlayerDialog(playeridDIALOG_GEN_CMDSDIALOG_STYLE_MSGBOX"General Commands""/admins, /afk, /back, /help, /report, /ask, /commands, /actions, /changename, /password, /civil""Close","");
                    case 
3:    ShowPlayerDialog(playeridDIALOG_PH_CMDSDIALOG_STYLE_MSGBOX"House Commands""/buyprop, /sellprop, /lockprop, /propdoor""Close","");
                    case 
4:    ShowPlayerDialog(playeridDIALOG_PORG_CMDSDIALOG_STYLE_MSGBOX"Organization Commands""/org, /ochat, /lc, /orgs, /want""Close","");
                    case 
5:    ShowPlayerDialog(playeridDIALOG_PBUS_CMDSDIALOG_STYLE_MSGBOX"Business Commands""/bnear, /buybus, /sellbus, /lockbus, /busdoor""Close","");
                    case 
6:    ShowPlayerDialog(playeridDIALOG_SCMDSDIALOG_STYLE_MSGBOX"{00E5EE}Support Commands""/sc, /scolor, /reply, /declinehelp""Close","");
                    case 
7:    ShowPlayerDialog(playeridDIALOG_ACMDSDIALOG_STYLE_MSGBOX"{FF0000}Admininstrator Commands""{DB881A}Level 1{FFFFFF} - /asay, /kick, /freeze, /unfreeze, /ac, /clear, /disarm, /checkplayer, /spectate, /stopspec, /acceptreport, /declinereport, /reports, /weather\n{1B1BE0}Level 2{FFFFFF} - /goto, /get, /banip, /ban, /listen, /settime\n{7340DB}Level 3{FFFFFF} - /vdestroy, /heal, /giveweapon, /setskin, /givemoney, /deleteport, /deleteallreports, /setfuel""Close","");
                    case 
8ShowPlayerDialog(playeridDIALOG_VIP_CMDSDIALOG_STYLE_MSGBOX"{FF69B4}VIP Commands""Nothing here, yet""Close","");
                }
            }
            else if(
PlayerInfo[playerid][pAdmin] == 4)
            {
                switch(
listitem)
                {
                    case 
0:    ShowPlayerDialog(playeridDIALOG_RP_CMDSDIALOG_STYLE_MSGBOX"Roleplay Commands""/me, /do, /s, /shout""Close","");
                    case 
1:    ShowPlayerDialog(playeridDIALOG_VEH_CMDSDIALOG_STYLE_MSGBOX"Vehicle Commands""/opendoors, /closedoors, /opencarwindows, /closecarwindows, /openboot, /closeboot, /openbonnet, /closebonnet, /engine, /lights, /kph, /mph, /hidspeedo, /showspeedo""Close","");
                    case 
2:    ShowPlayerDialog(playeridDIALOG_GEN_CMDSDIALOG_STYLE_MSGBOX"General Commands""/admins, /afk, /back, /help, /report, /ask, /commands, /actions, /changename, /password, /civil""Close","");
                    case 
3:    ShowPlayerDialog(playeridDIALOG_PH_CMDSDIALOG_STYLE_MSGBOX"House Commands""/buyprop, /sellprop, /lockprop, /propdoor""Close","");
                    case 
4:    ShowPlayerDialog(playeridDIALOG_PORG_CMDSDIALOG_STYLE_MSGBOX"Organization Commands""/org, /ochat, /lc, /orgs, /want""Close","");
                    case 
5:    ShowPlayerDialog(playeridDIALOG_PBUS_CMDSDIALOG_STYLE_MSGBOX"Business Commands""/bnear, /buybus, /sellbus, /lockbus, /busdoor""Close","");
                    case 
6:    ShowPlayerDialog(playeridDIALOG_SCMDSDIALOG_STYLE_MSGBOX"{00E5EE}Support Commands""/sc, /scolor, /reply, /declinehelp""Close","");
                    case 
7:    ShowPlayerDialog(playeridDIALOG_ACMDSDIALOG_STYLE_MSGBOX"{FF0000}Admininstrator Commands""{DB881A}Level 1{FFFFFF} - /asay, /kick, /freeze, /unfreeze, /ac, /clear, /disarm, /checkplayer, /spectate, /stopspec, /acceptreport, /declinereport, /reports, /weather\n{1B1BE0}Level 2{FFFFFF} - /goto, /get, /banip, /ban, /listen, /settime\n{7340DB}Level 3{FFFFFF} - /vdestroy, /heal, /giveweapon, /setskin, /givemoney, /deleteport, /deleteallreports, /setfuel\n{8CED15}Level 4{FFFFFF} - /oban, /unban, /sac, /vehicle, /healall, /dycmds, /setsmember, /setname""Close","");
                    case 
8ShowPlayerDialog(playeridDIALOG_VIP_CMDSDIALOG_STYLE_MSGBOX"{FF69B4}VIP Commands""Nothing here, yet""Close","");
                }
            }
            else
            {
                switch(
listitem)
                {
                    case 
0:    ShowPlayerDialog(playeridDIALOG_RP_CMDSDIALOG_STYLE_MSGBOX"Roleplay Commands""/me, /do, /s, /shout""Close","");
                    case 
1:    ShowPlayerDialog(playeridDIALOG_VEH_CMDSDIALOG_STYLE_MSGBOX"Vehicle Commands""/opendoors, /closedoors, /opencarwindows, /closecarwindows, /openboot, /closeboot, /openbonnet, /closebonnet, /engine, /lights, /kph, /mph, /hidspeedo, /showspeedo""Close","");
                    case 
2:    ShowPlayerDialog(playeridDIALOG_GEN_CMDSDIALOG_STYLE_MSGBOX"General Commands""/admins, /afk, /back, /help, /report, /ask, /commands, /actions, /changename, /password, /civil""Close","");
                    case 
3:    ShowPlayerDialog(playeridDIALOG_PH_CMDSDIALOG_STYLE_MSGBOX"House Commands""/buyprop, /sellprop, /lockprop, /propdoor""Close","");
                    case 
4:    ShowPlayerDialog(playeridDIALOG_PORG_CMDSDIALOG_STYLE_MSGBOX"Organization Commands""/org, /ochat, /lc, /orgs, /want""Close","");
                    case 
5:    ShowPlayerDialog(playeridDIALOG_PBUS_CMDSDIALOG_STYLE_MSGBOX"Business Commands""/bnear, /buybus, /sellbus, /lockbus, /busdoor""Close","");
                    case 
6:    ShowPlayerDialog(playeridDIALOG_SCMDSDIALOG_STYLE_MSGBOX"{00E5EE}Support Commands""/sc, /scolor, /reply, /declinehelp""Close","");
                    case 
7ShowPlayerDialog(playeridDIALOG_CMDS_ADMINDIALOG_STYLE_MSGBOX"{FF0000}Admininistrator Commands""{DB881A}Level 1{FFFFFF} - /asay, /kick, /freeze, /unfreeze, /ac, /clear, /disarm, /checkplayer, /spectate, /stopspec, /acceptreport, /declinereport, /reports, /weather
                    \n{1B1BE0}Level 2{FFFFFF} - /goto, /get, /banip, /ban, /listen, /settime\n{7340DB}Level 3{FFFFFF} - /vdestroy, /heal, /giveweapon, /setskin, /givemoney, /deleteport, /deleteallreports, /setfuel\n{8CED15}Level 4{FFFFFF} - /oban, /unban, /sac, /vehicle, /healall, /dycmds, /setsmember, /setname\n{37DB45}Level 5{FFFFFF} - /setadmin, /setadminuc, /gmx, /asetpass"
"Back""Close");
                    case 
8ShowPlayerDialog(playeridDIALOG_VIP_CMDSDIALOG_STYLE_MSGBOX"{FF69B4}VIP Commands""Nothing here, yet""Close","");
                }
            }
        }
    }
    return 
1;

The error starts happening here at level 4 when the string gets long.
Код:
                    case 7:    ShowPlayerDialog(playerid, DIALOG_ACMDS, DIALOG_STYLE_MSGBOX, "{FF0000}Admininstrator Commands", "{DB881A}Level 1{FFFFFF} - /asay, /kick, /freeze, /unfreeze, /ac, /clear, /disarm, /checkplayer, /spectate, /stopspec, /acceptreport, /declinereport, /reports, /weather\n{1B1BE0}Level 2{FFFFFF} - /goto, /get, /banip, /ban, /listen, /settime\n{7340DB}Level 3{FFFFFF} - /vdestroy, /heal, /giveweapon, /setskin, /givemoney, /deleteport, /deleteallreports, /setfuel\n{8CED15}Level 4{FFFFFF} - /oban, /unban, /sac, /vehicle, /healall, /dycmds, /setsmember, /setname", "Close","");
And also continues onto level 5.

Код:
case 7: ShowPlayerDialog(playerid, DIALOG_CMDS_ADMIN, DIALOG_STYLE_MSGBOX, "{FF0000}Admininistrator Commands", "{DB881A}Level 1{FFFFFF} - /asay, /kick, /freeze, /unfreeze, /ac, /clear, /disarm, /checkplayer, /spectate, /stopspec, /acceptreport, /declinereport, /reports, /weather
					\n{1B1BE0}Level 2{FFFFFF} - /goto, /get, /banip, /ban, /listen, /settime\n{7340DB}Level 3{FFFFFF} - /vdestroy, /heal, /giveweapon, /setskin, /givemoney, /deleteport, /deleteallreports, /setfuel\n{8CED15}Level 4{FFFFFF} - /oban, /unban, /sac, /vehicle, /healall, /dycmds, /setsmember, /setname\n{37DB45}Level 5{FFFFFF} - /setadmin, /setadminuc, /gmx, /asetpass", "Back", "Close");
Reply
#2

The line* is too long. Nothing stops you from splitting the parameters and the text itself:
pawn Код:
// pAdmin = 4
case 7: ShowPlayerDialog(playerid, DIALOG_ACMDS, DIALOG_STYLE_MSGBOX, "{FF0000}Admininstrator Commands",
"{DB881A}Level 1{FFFFFF} - /asay, /kick, /freeze, /unfreeze, /ac, /clear, /disarm, /checkplayer, /spectate, /stopspec, /acceptreport, /declinereport, /reports, /weather\n" \
"{1B1BE0}Level 2{FFFFFF} - /goto, /get, /banip, /ban, /listen, /settime\n" \
"{7340DB}Level 3{FFFFFF} - /vdestroy, /heal, /giveweapon, /setskin, /givemoney, /deleteport, /deleteallreports, /setfuel\n" \
"{8CED15}Level 4{FFFFFF} - /oban, /unban, /sac, /vehicle, /healall, /dycmds, /setsmember, /setname", "Close","");
or you can just use Zeex's compiler patch which increases the line limit from 511 to 4095.
Reply
#3

I tried this however I still get
Код:
vR.pwn(3094 -- 3098) : error 075: input line too long (after substitutions)
vR.pwn(3099) : error 029: invalid expression, assumed zero
vR.pwn(3099) : error 017: undefined symbol "B1BE0"
vR.pwn(3099) : warning 217: loose indentation
vR.pwn(3099) : error 017: undefined symbol "Level"
vR.pwn(3099) : fatal error 107: too many error messages on one line
PHP код:
case 7ShowPlayerDialog(playeridDIALOG_CMDS_ADMINDIALOG_STYLE_MSGBOX"{FF0000}Admininistrator Commands"
                    
"{DB881A}Level 1{FFFFFF} - /asay, /kick, /freeze, /unfreeze, /ac, /clear, /disarm, /checkplayer, /spectate, /stopspec, /acceptreport, /declinereport, /reports, /weather\n\" 
                    "
{1B1BE0}Level 2{FFFFFF} - /goto, /get, /banip, /ban, /listen, /settime\n\
                    "
{7340DB}Level 3{FFFFFF} - /vdestroy, /heal, /giveweapon, /setskin, /givemoney, /deleteport, /deleteallreports, /setfuel\n\
                    "
{8CED15}Level 4{FFFFFF} - /oban, /unban, /sac, /vehicle, /healall, /dycmds, /setsmember, /setname\n\
                    "
{37DB45}Level 5{FFFFFF} - /setadmin, /setadminuc, /gmx, /asetpass", "Back", "Close"); 
Reply
#4

Here you go :-

Код:
CMD:help(playerid, parmas[])
{
  new pDialog[2048];
  strcat(pDialog, "YOURTEXT", sizeof(pDialog));
  strcat(pDialog, "YOURTEXT", sizeof(pDialog));
  strcat(pDialog, "YOURTEXT", sizeof(pDialog));
  strcat(pDialog, "YOURTEXT", sizeof(pDialog));
  strcat(pDialog, "YOURTEXT", sizeof(pDialog));
  strcat(pDialog, "YOURTEXT", sizeof(pDialog));
  strcat(pDialog, "YOURTEXT", sizeof(pDialog));
  strcat(pDialog, "YOURTEXT", sizeof(pDialog));
  strcat(pDialog, "YOURTEXT", sizeof(pDialog));
  strcat(pDialog, "YOURTEXT", sizeof(pDialog));
  strcat(pDialog, "YOURTEXT", sizeof(pDialog));
  strcat(pDialog, "YOURTEXT", sizeof(pDialog));
  //Add more if you wish.
  


  ShowPlayerDialog(playerid, 11, DIALOG_STYLE_MSGBOX,"Admin Commands", pDialog, "OK", "");
return 1;
}
This is a much easier way instead of using any other includes or stuff, if you don't get it, pm me and I will explain about how this works.
Reply
#5

The thing is; It's not the displaying of the dialog, it's under the ondialogresponse. I tried this:

PHP код:
    if(dialogid == DIALOG_CMDS_ADMIN)
    {
        if(
response)
        {
            if(
PlayerInfo[playerid][pAdmin] == 1)
            {
                switch(
listitem)
                {
                    case 
0:    ShowPlayerDialog(playeridDIALOG_RP_CMDSDIALOG_STYLE_MSGBOX"Roleplay Commands""/me, /do, /s, /shout""Close","");
                    case 
1:    ShowPlayerDialog(playeridDIALOG_VEH_CMDSDIALOG_STYLE_MSGBOX"Vehicle Commands""/opendoors, /closedoors, /opencarwindows, /closecarwindows, /openboot, /closeboot, /openbonnet, /closebonnet, /engine, /lights, /kph, /mph, /hidspeedo, /showspeedo""Close","");
                    case 
2:    ShowPlayerDialog(playeridDIALOG_GEN_CMDSDIALOG_STYLE_MSGBOX"General Commands""/admins, /afk, /back, /help, /report, /ask, /commands, /actions, /changename, /password, /civil""Close","");
                    case 
3:    ShowPlayerDialog(playeridDIALOG_PH_CMDSDIALOG_STYLE_MSGBOX"House Commands""/buyprop, /sellprop, /lockprop, /propdoor""Close","");
                    case 
4:    ShowPlayerDialog(playeridDIALOG_PORG_CMDSDIALOG_STYLE_MSGBOX"Organization Commands""/org, /ochat, /lc, /orgs, /want""Close","");
                    case 
5:    ShowPlayerDialog(playeridDIALOG_PBUS_CMDSDIALOG_STYLE_MSGBOX"Business Commands""/bnear, /buybus, /sellbus, /lockbus, /busdoor""Close","");
                    case 
6:    ShowPlayerDialog(playeridDIALOG_SCMDSDIALOG_STYLE_MSGBOX"{00E5EE}Support Commands""/sc, /scolor, /reply, /declinehelp""Close","");
                    case 
7:    ShowPlayerDialog(playeridDIALOG_ACMDSDIALOG_STYLE_MSGBOX"{FF0000}Admininstrator Commands""{DB881A}Level 1{FFFFFF} - /asay, /kick, /freeze, /unfreeze, /ac, /clear, /disarm, /checkplayer, /spectate, /stopspec, /acceptreport, /declinereport, /reports, /weather""Close","");
                    case 
8ShowPlayerDialog(playeridDIALOG_VIP_CMDSDIALOG_STYLE_MSGBOX"{FF69B4}VIP Commands""Nothing here, yet""Close","");
                }
            }
            else if(
PlayerInfo[playerid][pAdmin] == 2)
            {
                switch(
listitem)
                {
                    case 
0:    ShowPlayerDialog(playeridDIALOG_RP_CMDSDIALOG_STYLE_MSGBOX"Roleplay Commands""/me, /do, /s, /shout""Close","");
                    case 
1:    ShowPlayerDialog(playeridDIALOG_VEH_CMDSDIALOG_STYLE_MSGBOX"Vehicle Commands""/opendoors, /closedoors, /opencarwindows, /closecarwindows, /openboot, /closeboot, /openbonnet, /closebonnet, /engine, /lights, /kph, /mph, /hidspeedo, /showspeedo""Close","");
                    case 
2:    ShowPlayerDialog(playeridDIALOG_GEN_CMDSDIALOG_STYLE_MSGBOX"General Commands""/admins, /afk, /back, /help, /report, /ask, /commands, /actions, /changename, /password, /civil""Close","");
                    case 
3:    ShowPlayerDialog(playeridDIALOG_PH_CMDSDIALOG_STYLE_MSGBOX"House Commands""/buyprop, /sellprop, /lockprop, /propdoor""Close","");
                    case 
4:    ShowPlayerDialog(playeridDIALOG_PORG_CMDSDIALOG_STYLE_MSGBOX"Organization Commands""/org, /ochat, /lc, /orgs, /want""Close","");
                    case 
5:    ShowPlayerDialog(playeridDIALOG_PBUS_CMDSDIALOG_STYLE_MSGBOX"Business Commands""/bnear, /buybus, /sellbus, /lockbus, /busdoor""Close","");
                    case 
6:    ShowPlayerDialog(playeridDIALOG_SCMDSDIALOG_STYLE_MSGBOX"{00E5EE}Support Commands""/sc, /scolor, /reply, /declinehelp""Close","");
                    case 
7:    ShowPlayerDialog(playeridDIALOG_ACMDSDIALOG_STYLE_MSGBOX"{FF0000}Admininstrator Commands""{DB881A}Level 1{FFFFFF} - /asay, /kick, /freeze, /unfreeze, /ac, /clear, /disarm, /checkplayer, /spectate, /stopspec, /acceptreport, /declinereport, /reports, /weather\n{1B1BE0}Level 2{FFFFFF} - /goto, /get, /banip, /ban, /listen, /settime""Close","");
                    case 
8ShowPlayerDialog(playeridDIALOG_VIP_CMDSDIALOG_STYLE_MSGBOX"{FF69B4}VIP Commands""Nothing here, yet""Close","");
                }
            }
            else if(
PlayerInfo[playerid][pAdmin] == 3)
            {
                switch(
listitem)
                {
                    case 
0:    ShowPlayerDialog(playeridDIALOG_RP_CMDSDIALOG_STYLE_MSGBOX"Roleplay Commands""/me, /do, /s, /shout""Close","");
                    case 
1:    ShowPlayerDialog(playeridDIALOG_VEH_CMDSDIALOG_STYLE_MSGBOX"Vehicle Commands""/opendoors, /closedoors, /opencarwindows, /closecarwindows, /openboot, /closeboot, /openbonnet, /closebonnet, /engine, /lights, /kph, /mph, /hidspeedo, /showspeedo""Close","");
                    case 
2:    ShowPlayerDialog(playeridDIALOG_GEN_CMDSDIALOG_STYLE_MSGBOX"General Commands""/admins, /afk, /back, /help, /report, /ask, /commands, /actions, /changename, /password, /civil""Close","");
                    case 
3:    ShowPlayerDialog(playeridDIALOG_PH_CMDSDIALOG_STYLE_MSGBOX"House Commands""/buyprop, /sellprop, /lockprop, /propdoor""Close","");
                    case 
4:    ShowPlayerDialog(playeridDIALOG_PORG_CMDSDIALOG_STYLE_MSGBOX"Organization Commands""/org, /ochat, /lc, /orgs, /want""Close","");
                    case 
5:    ShowPlayerDialog(playeridDIALOG_PBUS_CMDSDIALOG_STYLE_MSGBOX"Business Commands""/bnear, /buybus, /sellbus, /lockbus, /busdoor""Close","");
                    case 
6:    ShowPlayerDialog(playeridDIALOG_SCMDSDIALOG_STYLE_MSGBOX"{00E5EE}Support Commands""/sc, /scolor, /reply, /declinehelp""Close","");
                    case 
7:    ShowPlayerDialog(playeridDIALOG_ACMDSDIALOG_STYLE_MSGBOX"{FF0000}Admininstrator Commands""{DB881A}Level 1{FFFFFF} - /asay, /kick, /freeze, /unfreeze, /ac, /clear, /disarm, /checkplayer, /spectate, /stopspec, /acceptreport, /declinereport, /reports, /weather\n{1B1BE0}Level 2{FFFFFF} - /goto, /get, /banip, /ban, /listen, /settime\n{7340DB}Level 3{FFFFFF} - /vdestroy, /heal, /giveweapon, /setskin, /givemoney, /deleteport, /deleteallreports, /setfuel""Close","");
                    case 
8ShowPlayerDialog(playeridDIALOG_VIP_CMDSDIALOG_STYLE_MSGBOX"{FF69B4}VIP Commands""Nothing here, yet""Close","");
                }
            }
            else if(
PlayerInfo[playerid][pAdmin] == 4)
            {
                switch(
listitem)
                {
                    case 
0:    ShowPlayerDialog(playeridDIALOG_RP_CMDSDIALOG_STYLE_MSGBOX"Roleplay Commands""/me, /do, /s, /shout""Close","");
                    case 
1:    ShowPlayerDialog(playeridDIALOG_VEH_CMDSDIALOG_STYLE_MSGBOX"Vehicle Commands""/opendoors, /closedoors, /opencarwindows, /closecarwindows, /openboot, /closeboot, /openbonnet, /closebonnet, /engine, /lights, /kph, /mph, /hidspeedo, /showspeedo""Close","");
                    case 
2:    ShowPlayerDialog(playeridDIALOG_GEN_CMDSDIALOG_STYLE_MSGBOX"General Commands""/admins, /afk, /back, /help, /report, /ask, /commands, /actions, /changename, /password, /civil""Close","");
                    case 
3:    ShowPlayerDialog(playeridDIALOG_PH_CMDSDIALOG_STYLE_MSGBOX"House Commands""/buyprop, /sellprop, /lockprop, /propdoor""Close","");
                    case 
4:    ShowPlayerDialog(playeridDIALOG_PORG_CMDSDIALOG_STYLE_MSGBOX"Organization Commands""/org, /ochat, /lc, /orgs, /want""Close","");
                    case 
5:    ShowPlayerDialog(playeridDIALOG_PBUS_CMDSDIALOG_STYLE_MSGBOX"Business Commands""/bnear, /buybus, /sellbus, /lockbus, /busdoor""Close","");
                    case 
6:    ShowPlayerDialog(playeridDIALOG_SCMDSDIALOG_STYLE_MSGBOX"{00E5EE}Support Commands""/sc, /scolor, /reply, /declinehelp""Close","");
                    case 
7:    ShowPlayerDialog(playeridDIALOG_ACMDSDIALOG_STYLE_MSGBOX"{FF0000}Admininstrator Commands"
                    
"{DB881A}Level 1{FFFFFF} - /asay, /kick, /freeze, /unfreeze, /ac, /clear, /disarm, /checkplayer, /spectate, /stopspec, /acceptreport, /declinereport, /reports, /weather\n" \
                    
"{1B1BE0}Level 2{FFFFFF} - /goto, /get, /banip, /ban, /listen, /settime\n" \
                    
"{7340DB}Level 3{FFFFFF} - /vdestroy, /heal, /giveweapon, /setskin, /givemoney, /deleteport, /deleteallreports, /setfuel\n" \
                    
"{8CED15}Level 4{FFFFFF} - /oban, /unban, /sac, /vehicle, /healall, /dycmds, /setsmember, /setname""Close","");
                    case 
8ShowPlayerDialog(playeridDIALOG_VIP_CMDSDIALOG_STYLE_MSGBOX"{FF69B4}VIP Commands""Nothing here, yet""Close","");
                }
            }
            else
            {
                new 
pDialog[2048];
                
strcat(pDialog"{DB881A}Level 1{FFFFFF} - /asay, /kick, /freeze, /unfreeze, /ac, /clear, /disarm, /checkplayer, /spectate, /stopspec, /acceptreport, /declinereport, /reports, /weather\n" \
                
"{1B1BE0}Level 2{FFFFFF} - /goto, /get, /banip, /ban, /listen, /settime\n{7340DB}Level 3{FFFFFF} - /vdestroy, /heal, /giveweapon, /setskin, /givemoney, /deleteport, /deleteallreports, /setfuel\n" \
                
"{8CED15}Level 4{FFFFFF} - /oban, /unban, /sac, /vehicle, /healall, /dycmds, /setsmember, /setname\n{37DB45}Level 5{FFFFFF} - /setadmin, /setadminuc, /gmx, /asetpass"sizeof(pDialog));
                switch(
listitem)
                {
                    case 
0:    ShowPlayerDialog(playeridDIALOG_RP_CMDSDIALOG_STYLE_MSGBOX"Roleplay Commands""/me, /do, /s, /shout""Close","");
                    case 
1:    ShowPlayerDialog(playeridDIALOG_VEH_CMDSDIALOG_STYLE_MSGBOX"Vehicle Commands""/opendoors, /closedoors, /opencarwindows, /closecarwindows, /openboot, /closeboot, /openbonnet, /closebonnet, /engine, /lights, /kph, /mph, /hidspeedo, /showspeedo""Close","");
                    case 
2:    ShowPlayerDialog(playeridDIALOG_GEN_CMDSDIALOG_STYLE_MSGBOX"General Commands""/admins, /afk, /back, /help, /report, /ask, /commands, /actions, /changename, /password, /civil""Close","");
                    case 
3:    ShowPlayerDialog(playeridDIALOG_PH_CMDSDIALOG_STYLE_MSGBOX"House Commands""/buyprop, /sellprop, /lockprop, /propdoor""Close","");
                    case 
4:    ShowPlayerDialog(playeridDIALOG_PORG_CMDSDIALOG_STYLE_MSGBOX"Organization Commands""/org, /ochat, /lc, /orgs, /want""Close","");
                    case 
5:    ShowPlayerDialog(playeridDIALOG_PBUS_CMDSDIALOG_STYLE_MSGBOX"Business Commands""/bnear, /buybus, /sellbus, /lockbus, /busdoor""Close","");
                    case 
6:    ShowPlayerDialog(playeridDIALOG_SCMDSDIALOG_STYLE_MSGBOX"{00E5EE}Support Commands""/sc, /scolor, /reply, /declinehelp""Close","");
                    case 
7ShowPlayerDialog(playeridDIALOG_CMDS_ADMINDIALOG_STYLE_MSGBOX"{FF0000}Admininistrator Commands"pDialog"Close"""); 
                    case 
8ShowPlayerDialog(playeridDIALOG_VIP_CMDSDIALOG_STYLE_MSGBOX"{FF69B4}VIP Commands""Nothing here, yet""Close","");
                }
            }
        }
    }
    return 
1;

But it didn't work.
Reply
#6

Quote:
Originally Posted by Tass007
Посмотреть сообщение
I tried this however I still get
There are cases it fails because the limit was reached.

pawn Код:
case 7:
{
    new cmds_admin[462 + 65 + 1] =
    "{DB881A}Level 1{FFFFFF} - /asay, /kick, /freeze, /unfreeze, /ac, /clear, /disarm, /checkplayer, /spectate, /stopspec, /acceptreport, /declinereport, /reports, /weather\n" \
    "{1B1BE0}Level 2{FFFFFF} - /goto, /get, /banip, /ban, /listen, /settime\n" \
    "{7340DB}Level 3{FFFFFF} - /vdestroy, /heal, /giveweapon, /setskin, /givemoney, /deleteport, /deleteallreports, /setfuel\n" \
    "{8CED15}Level 4{FFFFFF} - /oban, /unban, /sac, /vehicle, /healall, /dycmds, /setsmember, /setname\n";

    strcat(cmds_admin, "{37DB45}Level 5{FFFFFF} - /setadmin, /setadminuc, /gmx, /asetpass");

    ShowPlayerDialog(playerid, DIALOG_CMDS_ADMIN, DIALOG_STYLE_MSGBOX, "{FF0000}Admininstrator Commands", cmds_admin, "Back", "Close");
}
Still, Zeex's compiler patch has many benefits and you avoid declaring big strings.
Reply
#7

I would use the patch, however I use notepad ++ for my scripting. Also can you please explain to me what this does so I know for next time?
Reply
#8

Notepad++ is the editor, it still uses pawncc.exe to compile the scripts.

You can declare a string with a default value (text for our case) so cmds_admin contains up to level 4 which doesn't give the error about too long line and the level 5 part which was left out is then "joined" along with the rest.

If you don't want to re-create the string over and over again if the listitem is 7, you may use static local but you will need another static local (they hold the previous value) so it can know when it was the first time called and joined the text once.

pawn Код:
case 7:
{
    static proceed, cmds_admin[528] =
    "{DB881A}Level 1{FFFFFF} - /asay, /kick, /freeze, /unfreeze, /ac, /clear, /disarm, /checkplayer, /spectate, /stopspec, /acceptreport, /declinereport, /reports, /weather\n" \
    "{1B1BE0}Level 2{FFFFFF} - /goto, /get, /banip, /ban, /listen, /settime\n" \
    "{7340DB}Level 3{FFFFFF} - /vdestroy, /heal, /giveweapon, /setskin, /givemoney, /deleteport, /deleteallreports, /setfuel\n" \
    "{8CED15}Level 4{FFFFFF} - /oban, /unban, /sac, /vehicle, /healall, /dycmds, /setsmember, /setname\n";

    if (!proceed)
    {
        strcat(cmds_admin, "{37DB45}Level 5{FFFFFF} - /setadmin, /setadminuc, /gmx, /asetpass");
        proceed = 1;
    }
   
    ShowPlayerDialog(playerid, DIALOG_CMDS_ADMIN, DIALOG_STYLE_MSGBOX, "{FF0000}Admininstrator Commands", cmds_admin, "Back", "Close");
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)