Help Command makes Pawno Compiler stop responding...
#1

Here I have my /help command
Everytime I try to compile my script with it,it makes pawno stop responding
pawn Код:
YCMD:help(playerid,params[],help)
{
    switch (pInfo[playerid][Adminlevel])
    {
        case 0:
        {
            new Commands[512];
            strcat(Commands,"|***Server Commands***|\n\n[ /Rules] [ /ServerFeatures ] [ /Credits ] [ /Admins ] [ /Report ]\n\n|***Chat Commands***|\n\n[ /G(Text) ]\n\n|***Team Commands***|\n\n[ /Teams ] [ /MyTeam ] [ /ChangeTeam ]\n\n|***Player Commands***|\n\n[ /Stats ] [ /Pm ] [ /Kill ] [/Pay] [ /Shop ]\n\n|***Radio Commands***|\n\n[ /RadioHelp ] [ /SetRadio ]\n\n",sizeof(Commands));
            ShowPlayerDialog(playerid,COMMANDS_DIALOG, DIALOG_STYLE_MSGBOX, ""COL_BLUE"Sniper War Commands",Commands, "OK", "");
        }
        case 1:
        {
            new Commands1[512];
            strcat(Commands1,"|***Server Commands***|\n\n[ /Rules] [ /ServerFeatures ] [ /Credits ] [ /Admins ] [ /Report ]\n\n|***Chat Commands***|\n\n[ /G(Text) ]\n\n|***Team Commands***|\n\n[ /Teams ] [ /MyTeam ] [ /ChangeTeam ]\n\n|***Player Commands***|\n\n[ /Stats ] [ /Pm ] [ /Kill ] [/Pay] [ /Shop ]\n\n|***Radio Commands***|\n\n[ /RadioHelp ] [ /SetRadio ]\n\n|***Admin LvL 1 Commands***|\n\n[ #(Text) ] [ /GetIp ] [ /Warn ] [ /Heal ] [ /Get ]\n\n[ /Goto ] [ /Armour ] [ /Ann ] [ /Fix ] [ /Flip ] [ /PlayerInfo ]\n\n", sizeof(Commands1));
            ShowPlayerDialog(playerid,COMMANDS_DIALOG, DIALOG_STYLE_MSGBOX, ""COL_BLUE"Sniper War Commands",Commands1, "OK", "Cancel");
        }
        case 2:
        {
            new Commands2[512];
            strcat(Commands2,"|***Server Commands***|\n\n[ /Rules] [ /ServerFeatures ] [ /Credits ] [ /Admins ] [ /Report ]\n\n|***Chat Commands***|\n\n[ /G(Text) ]\n\n|***Team Commands***|\n\n[ /Teams ] [ /MyTeam ] [ /ChangeTeam ]\n\n|***Player Commands***|\n\n[ /Stats ] [ /Pm ] [ /Kill ] [/Pay] [ /Shop ]\n\n|***Radio Commands***|\n\n[ /RadioHelp ] [ /SetRadio ]\n\n|***Admin LvL 1 Commands***|\n\n[ #(Text) ] [ /GetIp ] [ /Warn ] [ /Heal ] [ /Get ]\n\n[ /Goto ] [ /Armour ] [ /Ann ] [ /Fix ] [ /Flip ] [ /PlayerInfo ]\n\n|***Admin LvL 2 Commands***|\n\n[ /Banwarn ] [ /Kick ] [ /Cchat ] [ /Sethealth ] [ /Givemoney ]\n\n[ /Burn ] [ /Mute ] [ /Unmute ] [ /Armour ] [ /Setweather ] [ /Settime ]\n\n", sizeof(Commands2));
            ShowPlayerDialog(playerid,COMMANDS_DIALOG, DIALOG_STYLE_MSGBOX, ""COL_BLUE"Sniper War Commands",Commands2, "OK", "Cancel");
        }
        case 3:
        {
            new Commands3[512];
            strcat(Commands3,"|***Server Commands***|\n\n[ /Rules] [ /ServerFeatures ] [ /Credits ] [ /Admins ] [ /Report ]\n\n|***Chat Commands***|\n\n[ /G(Text) ]\n\n|***Team Commands***|\n\n[ /Teams ] [ /MyTeam ] [ /ChangeTeam ]\n\n|***Player Commands***|\n\n[ /Stats ] [ /Pm ] [ /Kill ] [/Pay] [ /Shop ]\n\n|***Radio Commands***|\n\n[ /RadioHelp ] [ /SetRadio ]\n\n|***Admin LvL 1 Commands***|\n\n[ #(Text) ] [ /GetIp ] [ /Warn ] [ /Heal ] [ /Get ]\n\n[ /Goto ] [ /Armour ] [ /Ann ] [ /Fix ] [ /Flip ] [ /PlayerInfo ]\n\n|***Admin LvL 2 Commands***|\n\n[ /Banwarn ] [ /Kick ] [ /Cchat ] [ /Sethealth ] [ /Givemoney ]\n\n[ /Burn ] [ /Mute ] [ /Unmute ] [ /Armour ] [ /Setweather ] [ /Settime ]\n\n|***Admin LvL 3 Commands***|\n\n[ /Ban ] [ /Explode ] [ /Setscore ] [ /Slap ] [ /Setskin ] [ /Setarmour ] [ /Giveweap ] [ /Disarm ] [ /Healall ] [ /Armourall ] [ /Freeze ] [ /Unfreeze ]\n\n", sizeof(Commands3));
            ShowPlayerDialog(playerid,COMMANDS_DIALOG, DIALOG_STYLE_MSGBOX, ""COL_BLUE"Sniper War Commands",Commands3, "OK", "Cancel");
        }
        case 4:
        {
            new Commands4[512];
            strcat(Commands4,"|***Server Commands***|\n\n[ /Rules] [ /ServerFeatures ] [ /Credits ] [ /Admins ] [ /Report ]\n\n|***Chat Commands***|\n\n[ /G(Text) ]\n\n|***Team Commands***|\n\n[ /Teams ] [ /MyTeam ] [ /ChangeTeam ]\n\n|***Player Commands***|\n\n[ /Stats ] [ /Pm ] [ /Kill ] [/Pay] [ /Shop ]\n\n|***Radio Commands***|\n\n[ /RadioHelp ] [ /SetRadio ]\n\n|***Admin LvL 1 Commands***|\n\n[ #(Text) ] [ /GetIp ] [ /Warn ] [ /Heal ] [ /Get ]\n\n[ /Goto ] [ /Armour ] [ /Ann ] [ /Fix ] [ /Flip ] [ /PlayerInfo ]\n\n|***Admin LvL 2 Commands***|\n\n[ /Banwarn ] [ /Kick ] [ /Cchat ] [ /Sethealth ] [ /Givemoney ]\n\n[ /Burn ] [ /Mute ] [ /Unmute ] [ /Armour ] [ /Setweather ] [ /Settime ]\n\n|***Admin LvL 3 Commands***|\n\n[ /Ban ] [ /Explode ] [ /Setscore ] [ /Slap ] [ /Setskin ] [ /Setarmour ] [ /Giveweap ] [ /Disarm ] [ /Healall ] [ /Armourall ] [ /Freeze ] [ /Unfreeze ]\n\n|***Admin LvL 4 Commands***|\n\n[ /Akill ] [ /Resetscore ] [ /Resetmoney ]\n\n", sizeof(Commands4));
            ShowPlayerDialog(playerid,COMMANDS_DIALOG, DIALOG_STYLE_MSGBOX, ""COL_BLUE"Sniper War Commands",Commands4, "OK", "Cancel");
        }
        case 5:
        {
            new Commands5[512];
            strcat(Commands5,"|***Server Commands***|\n\n[ /Rules] [ /ServerFeatures ] [ /Credits ] [ /Admins ] [ /Report ]\n\n|***Chat Commands***|\n\n[ /G(Text) ]\n\n|***Team Commands***|\n\n[ /Teams ] [ /MyTeam ] [ /ChangeTeam ]\n\n|***Player Commands***|\n\n[ /Stats ] [ /Pm ] [ /Kill ] [/Pay] [ /Shop ]\n\n|***Radio Commands***|\n\n[ /RadioHelp ] [ /SetRadio ]\n\n|***Admin LvL 1 Commands***|\n\n[ #(Text) ] [ /GetIp ] [ /Warn ] [ /Heal ] [ /Get ]\n\n[ /Goto ] [ /Armour ] [ /Ann ] [ /Fix ] [ /Flip ] [ /PlayerInfo ]\n\n|***Admin LvL 2 Commands***|\n\n[ /Banwarn ] [ /Kick ] [ /Cchat ] [ /Sethealth ] [ /Givemoney ]\n\n[ /Burn ] [ /Mute ] [ /Unmute ] [ /Armour ] [ /Setweather ] [ /Settime ]\n\n|***Admin LvL 3 Commands***|\n\n[ /Ban ] [ /Explode ] [ /Setscore ] [ /Slap ] [ /Setskin ] [ /Setarmour ] [ /Giveweap ] [ /Disarm ] [ /Healall ] [ /Armourall ] [ /Freeze ] [ /Unfreeze ]\n\n|***Admin LvL 4 Commands***|\n\n[ /Akill ] [ /Resetscore ] [ /Resetmoney ]\n\n|***Admin LvL 5 Commands***|\n\n[ /Setadmin ] [ /Makevip ]\n\n", sizeof(Commands5));
            ShowPlayerDialog(playerid,COMMANDS_DIALOG, DIALOG_STYLE_MSGBOX, ""COL_BLUE"Sniper War Commands",Commands5, "OK", "Cancel");
        }
    }
    return 1;
}
Reply
#2

make
pawn Код:
YCMD:help(playerid,params[],help)
to
pawn Код:
CMD:help(playerid,params[],help)
Reply
#3

No,I use Y_commands
it was working till I added more commands into the list
Reply
#4

You're using large strings at every command, which you could only use 1 string for it. and I prefer using
format than strcat

Code


pawn Код:
YCMD:help(playerid,params[],help)
{
    new string[528];
    switch (pInfo[playerid][Adminlevel])
    {
        case 0:
        {
            format(string, sizeof(string),"|***Server Commands***|\n\n[ /Rules] [ /ServerFeatures ] [ /Credits ] [ /Admins ] [ /Report ]\n\n|***Chat Commands***|\n\n[ /G(Text) ]\n\n|***Team Commands***|\n\n[ /Teams ] [ /MyTeam ] [ /ChangeTeam ]\n\n|***Player Commands***|\n\n[ /Stats ] [ /Pm ] [ /Kill ] [/Pay] [ /Shop ]\n\n|***Radio Commands***|\n\n[ /RadioHelp ] [ /SetRadio ]\n\n");
            ShowPlayerDialog(playerid,COMMANDS_DIALOG, DIALOG_STYLE_MSGBOX, ""COL_BLUE"Sniper War Commands",Commands, "OK", "");
        }
        case 1:
        {
            format(string, sizeof(string),"|***Server Commands***|\n\n[ /Rules] [ /ServerFeatures ] [ /Credits ] [ /Admins ] [ /Report ]\n\n|***Chat Commands***|\n\n[ /G(Text) ]\n\n|***Team Commands***|\n\n[ /Teams ] [ /MyTeam ] [ /ChangeTeam ]\n\n|***Player Commands***|\n\n[ /Stats ] [ /Pm ] [ /Kill ] [/Pay] [ /Shop ]\n\n|***Radio Commands***|\n\n[ /RadioHelp ] [ /SetRadio ]\n\n|***Admin LvL 1 Commands***|\n\n[ #(Text) ] [ /GetIp ] [ /Warn ] [ /Heal ] [ /Get ]\n\n[ /Goto ] [ /Armour ] [ /Ann ] [ /Fix ] [ /Flip ] [ /PlayerInfo ]\n\n");
            ShowPlayerDialog(playerid,COMMANDS_DIALOG, DIALOG_STYLE_MSGBOX, ""COL_BLUE"Sniper War Commands",Commands1, "OK", "Cancel");
        }
        case 2:
        {
            format(string, sizeof(string),"|***Server Commands***|\n\n[ /Rules] [ /ServerFeatures ] [ /Credits ] [ /Admins ] [ /Report ]\n\n|***Chat Commands***|\n\n[ /G(Text) ]\n\n|***Team Commands***|\n\n[ /Teams ] [ /MyTeam ] [ /ChangeTeam ]\n\n|***Player Commands***|\n\n[ /Stats ] [ /Pm ] [ /Kill ] [/Pay] [ /Shop ]\n\n|***Radio Commands***|\n\n[ /RadioHelp ] [ /SetRadio ]\n\n|***Admin LvL 1 Commands***|\n\n[ #(Text) ] [ /GetIp ] [ /Warn ] [ /Heal ] [ /Get ]\n\n[ /Goto ] [ /Armour ] [ /Ann ] [ /Fix ] [ /Flip ] [ /PlayerInfo ]\n\n|***Admin LvL 2 Commands***|\n\n[ /Banwarn ] [ /Kick ] [ /Cchat ] [ /Sethealth ] [ /Givemoney ]\n\n[ /Burn ] [ /Mute ] [ /Unmute ] [ /Armour ] [ /Setweather ] [ /Settime ]\n\n", sizeof(Commands2));
            ShowPlayerDialog(playerid,COMMANDS_DIALOG, DIALOG_STYLE_MSGBOX, ""COL_BLUE"Sniper War Commands",Commands2, "OK", "Cancel");
        }
        case 3:
        {
            format(string, sizeof(string),"|***Server Commands***|\n\n[ /Rules] [ /ServerFeatures ] [ /Credits ] [ /Admins ] [ /Report ]\n\n|***Chat Commands***|\n\n[ /G(Text) ]\n\n|***Team Commands***|\n\n[ /Teams ] [ /MyTeam ] [ /ChangeTeam ]\n\n|***Player Commands***|\n\n[ /Stats ] [ /Pm ] [ /Kill ] [/Pay] [ /Shop ]\n\n|***Radio Commands***|\n\n[ /RadioHelp ] [ /SetRadio ]\n\n|***Admin LvL 1 Commands***|\n\n[ #(Text) ] [ /GetIp ] [ /Warn ] [ /Heal ] [ /Get ]\n\n[ /Goto ] [ /Armour ] [ /Ann ] [ /Fix ] [ /Flip ] [ /PlayerInfo ]\n\n|***Admin LvL 2 Commands***|\n\n[ /Banwarn ] [ /Kick ] [ /Cchat ] [ /Sethealth ] [ /Givemoney ]\n\n[ /Burn ] [ /Mute ] [ /Unmute ] [ /Armour ] [ /Setweather ] [ /Settime ]\n\n|***Admin LvL 3 Commands***|\n\n[ /Ban ] [ /Explode ] [ /Setscore ] [ /Slap ] [ /Setskin ] [ /Setarmour ] [ /Giveweap ] [ /Disarm ] [ /Healall ] [ /Armourall ] [ /Freeze ] [ /Unfreeze ]\n\n");
            ShowPlayerDialog(playerid,COMMANDS_DIALOG, DIALOG_STYLE_MSGBOX, ""COL_BLUE"Sniper War Commands",Commands3, "OK", "Cancel");
        }
        case 4:
        {
            format(string, sizeof(string),"|***Server Commands***|\n\n[ /Rules] [ /ServerFeatures ] [ /Credits ] [ /Admins ] [ /Report ]\n\n|***Chat Commands***|\n\n[ /G(Text) ]\n\n|***Team Commands***|\n\n[ /Teams ] [ /MyTeam ] [ /ChangeTeam ]\n\n|***Player Commands***|\n\n[ /Stats ] [ /Pm ] [ /Kill ] [/Pay] [ /Shop ]\n\n|***Radio Commands***|\n\n[ /RadioHelp ] [ /SetRadio ]\n\n|***Admin LvL 1 Commands***|\n\n[ #(Text) ] [ /GetIp ] [ /Warn ] [ /Heal ] [ /Get ]\n\n[ /Goto ] [ /Armour ] [ /Ann ] [ /Fix ] [ /Flip ] [ /PlayerInfo ]\n\n|***Admin LvL 2 Commands***|\n\n[ /Banwarn ] [ /Kick ] [ /Cchat ] [ /Sethealth ] [ /Givemoney ]\n\n[ /Burn ] [ /Mute ] [ /Unmute ] [ /Armour ] [ /Setweather ] [ /Settime ]\n\n|***Admin LvL 3 Commands***|\n\n[ /Ban ] [ /Explode ] [ /Setscore ] [ /Slap ] [ /Setskin ] [ /Setarmour ] [ /Giveweap ] [ /Disarm ] [ /Healall ] [ /Armourall ] [ /Freeze ] [ /Unfreeze ]\n\n|***Admin LvL 4 Commands***|\n\n[ /Akill ] [ /Resetscore ] [ /Resetmoney ]\n\n");
            ShowPlayerDialog(playerid,COMMANDS_DIALOG, DIALOG_STYLE_MSGBOX, ""COL_BLUE"Sniper War Commands",Commands4, "OK", "Cancel");
        }
        case 5:
        {
            format(string, sizeof(string),"|***Server Commands***|\n\n[ /Rules] [ /ServerFeatures ] [ /Credits ] [ /Admins ] [ /Report ]\n\n|***Chat Commands***|\n\n[ /G(Text) ]\n\n|***Team Commands***|\n\n[ /Teams ] [ /MyTeam ] [ /ChangeTeam ]\n\n|***Player Commands***|\n\n[ /Stats ] [ /Pm ] [ /Kill ] [/Pay] [ /Shop ]\n\n|***Radio Commands***|\n\n[ /RadioHelp ] [ /SetRadio ]\n\n|***Admin LvL 1 Commands***|\n\n[ #(Text) ] [ /GetIp ] [ /Warn ] [ /Heal ] [ /Get ]\n\n[ /Goto ] [ /Armour ] [ /Ann ] [ /Fix ] [ /Flip ] [ /PlayerInfo ]\n\n|***Admin LvL 2 Commands***|\n\n[ /Banwarn ] [ /Kick ] [ /Cchat ] [ /Sethealth ] [ /Givemoney ]\n\n[ /Burn ] [ /Mute ] [ /Unmute ] [ /Armour ] [ /Setweather ] [ /Settime ]\n\n|***Admin LvL 3 Commands***|\n\n[ /Ban ] [ /Explode ] [ /Setscore ] [ /Slap ] [ /Setskin ] [ /Setarmour ] [ /Giveweap ] [ /Disarm ] [ /Healall ] [ /Armourall ] [ /Freeze ] [ /Unfreeze ]\n\n|***Admin LvL 4 Commands***|\n\n[ /Akill ] [ /Resetscore ] [ /Resetmoney ]\n\n|***Admin LvL 5 Commands***|\n\n[ /Setadmin ] [ /Makevip ]\n\n");
            ShowPlayerDialog(playerid,COMMANDS_DIALOG, DIALOG_STYLE_MSGBOX, ""COL_BLUE"Sniper War Commands",Commands5, "OK", "Cancel");
        }
    }
    return 1;
}
Reply
#5

Quote:
Originally Posted by pds2012
Посмотреть сообщение
You're using large strings at every command, which you could only use 1 string for it. and I prefer using
format than strcat

Code


pawn Код:
YCMD:help(playerid,params[],help)
{
    new string[528];
    switch (pInfo[playerid][Adminlevel])
    {
        case 0:
        {
            format(string, sizeof(string),"|***Server Commands***|\n\n[ /Rules] [ /ServerFeatures ] [ /Credits ] [ /Admins ] [ /Report ]\n\n|***Chat Commands***|\n\n[ /G(Text) ]\n\n|***Team Commands***|\n\n[ /Teams ] [ /MyTeam ] [ /ChangeTeam ]\n\n|***Player Commands***|\n\n[ /Stats ] [ /Pm ] [ /Kill ] [/Pay] [ /Shop ]\n\n|***Radio Commands***|\n\n[ /RadioHelp ] [ /SetRadio ]\n\n");
            ShowPlayerDialog(playerid,COMMANDS_DIALOG, DIALOG_STYLE_MSGBOX, ""COL_BLUE"Sniper War Commands",Commands, "OK", "");
        }
        case 1:
        {
            format(string, sizeof(string),"|***Server Commands***|\n\n[ /Rules] [ /ServerFeatures ] [ /Credits ] [ /Admins ] [ /Report ]\n\n|***Chat Commands***|\n\n[ /G(Text) ]\n\n|***Team Commands***|\n\n[ /Teams ] [ /MyTeam ] [ /ChangeTeam ]\n\n|***Player Commands***|\n\n[ /Stats ] [ /Pm ] [ /Kill ] [/Pay] [ /Shop ]\n\n|***Radio Commands***|\n\n[ /RadioHelp ] [ /SetRadio ]\n\n|***Admin LvL 1 Commands***|\n\n[ #(Text) ] [ /GetIp ] [ /Warn ] [ /Heal ] [ /Get ]\n\n[ /Goto ] [ /Armour ] [ /Ann ] [ /Fix ] [ /Flip ] [ /PlayerInfo ]\n\n");
            ShowPlayerDialog(playerid,COMMANDS_DIALOG, DIALOG_STYLE_MSGBOX, ""COL_BLUE"Sniper War Commands",Commands1, "OK", "Cancel");
        }
        case 2:
        {
            format(string, sizeof(string),"|***Server Commands***|\n\n[ /Rules] [ /ServerFeatures ] [ /Credits ] [ /Admins ] [ /Report ]\n\n|***Chat Commands***|\n\n[ /G(Text) ]\n\n|***Team Commands***|\n\n[ /Teams ] [ /MyTeam ] [ /ChangeTeam ]\n\n|***Player Commands***|\n\n[ /Stats ] [ /Pm ] [ /Kill ] [/Pay] [ /Shop ]\n\n|***Radio Commands***|\n\n[ /RadioHelp ] [ /SetRadio ]\n\n|***Admin LvL 1 Commands***|\n\n[ #(Text) ] [ /GetIp ] [ /Warn ] [ /Heal ] [ /Get ]\n\n[ /Goto ] [ /Armour ] [ /Ann ] [ /Fix ] [ /Flip ] [ /PlayerInfo ]\n\n|***Admin LvL 2 Commands***|\n\n[ /Banwarn ] [ /Kick ] [ /Cchat ] [ /Sethealth ] [ /Givemoney ]\n\n[ /Burn ] [ /Mute ] [ /Unmute ] [ /Armour ] [ /Setweather ] [ /Settime ]\n\n", sizeof(Commands2));
            ShowPlayerDialog(playerid,COMMANDS_DIALOG, DIALOG_STYLE_MSGBOX, ""COL_BLUE"Sniper War Commands",Commands2, "OK", "Cancel");
        }
        case 3:
        {
            format(string, sizeof(string),"|***Server Commands***|\n\n[ /Rules] [ /ServerFeatures ] [ /Credits ] [ /Admins ] [ /Report ]\n\n|***Chat Commands***|\n\n[ /G(Text) ]\n\n|***Team Commands***|\n\n[ /Teams ] [ /MyTeam ] [ /ChangeTeam ]\n\n|***Player Commands***|\n\n[ /Stats ] [ /Pm ] [ /Kill ] [/Pay] [ /Shop ]\n\n|***Radio Commands***|\n\n[ /RadioHelp ] [ /SetRadio ]\n\n|***Admin LvL 1 Commands***|\n\n[ #(Text) ] [ /GetIp ] [ /Warn ] [ /Heal ] [ /Get ]\n\n[ /Goto ] [ /Armour ] [ /Ann ] [ /Fix ] [ /Flip ] [ /PlayerInfo ]\n\n|***Admin LvL 2 Commands***|\n\n[ /Banwarn ] [ /Kick ] [ /Cchat ] [ /Sethealth ] [ /Givemoney ]\n\n[ /Burn ] [ /Mute ] [ /Unmute ] [ /Armour ] [ /Setweather ] [ /Settime ]\n\n|***Admin LvL 3 Commands***|\n\n[ /Ban ] [ /Explode ] [ /Setscore ] [ /Slap ] [ /Setskin ] [ /Setarmour ] [ /Giveweap ] [ /Disarm ] [ /Healall ] [ /Armourall ] [ /Freeze ] [ /Unfreeze ]\n\n");
            ShowPlayerDialog(playerid,COMMANDS_DIALOG, DIALOG_STYLE_MSGBOX, ""COL_BLUE"Sniper War Commands",Commands3, "OK", "Cancel");
        }
        case 4:
        {
            format(string, sizeof(string),"|***Server Commands***|\n\n[ /Rules] [ /ServerFeatures ] [ /Credits ] [ /Admins ] [ /Report ]\n\n|***Chat Commands***|\n\n[ /G(Text) ]\n\n|***Team Commands***|\n\n[ /Teams ] [ /MyTeam ] [ /ChangeTeam ]\n\n|***Player Commands***|\n\n[ /Stats ] [ /Pm ] [ /Kill ] [/Pay] [ /Shop ]\n\n|***Radio Commands***|\n\n[ /RadioHelp ] [ /SetRadio ]\n\n|***Admin LvL 1 Commands***|\n\n[ #(Text) ] [ /GetIp ] [ /Warn ] [ /Heal ] [ /Get ]\n\n[ /Goto ] [ /Armour ] [ /Ann ] [ /Fix ] [ /Flip ] [ /PlayerInfo ]\n\n|***Admin LvL 2 Commands***|\n\n[ /Banwarn ] [ /Kick ] [ /Cchat ] [ /Sethealth ] [ /Givemoney ]\n\n[ /Burn ] [ /Mute ] [ /Unmute ] [ /Armour ] [ /Setweather ] [ /Settime ]\n\n|***Admin LvL 3 Commands***|\n\n[ /Ban ] [ /Explode ] [ /Setscore ] [ /Slap ] [ /Setskin ] [ /Setarmour ] [ /Giveweap ] [ /Disarm ] [ /Healall ] [ /Armourall ] [ /Freeze ] [ /Unfreeze ]\n\n|***Admin LvL 4 Commands***|\n\n[ /Akill ] [ /Resetscore ] [ /Resetmoney ]\n\n");
            ShowPlayerDialog(playerid,COMMANDS_DIALOG, DIALOG_STYLE_MSGBOX, ""COL_BLUE"Sniper War Commands",Commands4, "OK", "Cancel");
        }
        case 5:
        {
            format(string, sizeof(string),"|***Server Commands***|\n\n[ /Rules] [ /ServerFeatures ] [ /Credits ] [ /Admins ] [ /Report ]\n\n|***Chat Commands***|\n\n[ /G(Text) ]\n\n|***Team Commands***|\n\n[ /Teams ] [ /MyTeam ] [ /ChangeTeam ]\n\n|***Player Commands***|\n\n[ /Stats ] [ /Pm ] [ /Kill ] [/Pay] [ /Shop ]\n\n|***Radio Commands***|\n\n[ /RadioHelp ] [ /SetRadio ]\n\n|***Admin LvL 1 Commands***|\n\n[ #(Text) ] [ /GetIp ] [ /Warn ] [ /Heal ] [ /Get ]\n\n[ /Goto ] [ /Armour ] [ /Ann ] [ /Fix ] [ /Flip ] [ /PlayerInfo ]\n\n|***Admin LvL 2 Commands***|\n\n[ /Banwarn ] [ /Kick ] [ /Cchat ] [ /Sethealth ] [ /Givemoney ]\n\n[ /Burn ] [ /Mute ] [ /Unmute ] [ /Armour ] [ /Setweather ] [ /Settime ]\n\n|***Admin LvL 3 Commands***|\n\n[ /Ban ] [ /Explode ] [ /Setscore ] [ /Slap ] [ /Setskin ] [ /Setarmour ] [ /Giveweap ] [ /Disarm ] [ /Healall ] [ /Armourall ] [ /Freeze ] [ /Unfreeze ]\n\n|***Admin LvL 4 Commands***|\n\n[ /Akill ] [ /Resetscore ] [ /Resetmoney ]\n\n|***Admin LvL 5 Commands***|\n\n[ /Setadmin ] [ /Makevip ]\n\n");
            ShowPlayerDialog(playerid,COMMANDS_DIALOG, DIALOG_STYLE_MSGBOX, ""COL_BLUE"Sniper War Commands",Commands5, "OK", "Cancel");
        }
    }
    return 1;
}
How would this work,see the dialog code has eg "Commands5" as the text input,but there is no text for commands5 anymore without strcat :/ I dont believe this would work
Reply
#6

The string is too long across the line I think cause I still cant figure it out,sooo how would I be able to break this all down into more lines of code,I simply dont care about lines right now,so if I can use more lines it would be okay.
Reply
#7

Instead of calling strcat once, split it. Use strcat two times and use the half of the text to the first and the rest to the second. I also recommend using strcat than format - format is very slow. However, pds2012 was correct about the string. Don't declare 6 arrays with size of 512, you can use re-use the same string again and again.
Reply
#8

May you show me a code like that but comment out an explanation about it too please? or even convert the first code I posted at the top and explain,cause I am totally lost right now XD sorry..its okay if you cant do that.
Reply
#9

pawn Код:
YCMD:help(playerid,params[],help)
{
    new Commands[ 1000 ]; // The last message has lenght 999 + null character
    switch (pInfo[playerid][Adminlevel])
    {
        case 0:
        {
            strcat(Commands,"|***Server Commands***|\n\n[ /Rules] [ /ServerFeatures ] [ /Credits ] [ /Admins ] [ /Report ]\n\n|***Chat Commands***|\n\n[ /G(Text) ]\n\n|***Team Commands***|\n\n[ /Teams ] [ /MyTeam ] [ /ChangeTeam ]\n\n|***Player Commands***|\n\n[ /Stats ] [ /Pm ] [ /Kill ] [/Pay] [ /Shop ]\n\n|***Radio Commands***|\n\n[ /RadioHelp ] [ /SetRadio ]\n\n");
            ShowPlayerDialog(playerid,COMMANDS_DIALOG, DIALOG_STYLE_MSGBOX, ""COL_BLUE"Sniper War Commands",Commands, "OK", "");
        }
        case 1:
        {
            strcat(Commands,"|***Server Commands***|\n\n[ /Rules] [ /ServerFeatures ] [ /Credits ] [ /Admins ] [ /Report ]\n\n|***Chat Commands***|\n\n[ /G(Text) ]\n\n|***Team Commands***|\n\n[ /Teams ] [ /MyTeam ] [ /ChangeTeam ]\n\n|***Player Commands***|\n\n[ /Stats ] [ /Pm ] [ /Kill ] [/Pay] [ /Shop ]\n\n|***Radio Commands***|\n\n[ /RadioHelp ] [ /SetRadio ]\n\n");
            strcat(Commands,"|***Admin LvL 1 Commands***|\n\n[ #(Text) ] [ /GetIp ] [ /Warn ] [ /Heal ] [ /Get ]\n\n[ /Goto ] [ /Armour ] [ /Ann ] [ /Fix ] [ /Flip ] [ /PlayerInfo ]\n\n");
            ShowPlayerDialog(playerid,COMMANDS_DIALOG, DIALOG_STYLE_MSGBOX, ""COL_BLUE"Sniper War Commands",Commands, "OK", "Cancel");
        }
        case 2:
        {
            strcat(Commands,"|***Server Commands***|\n\n[ /Rules] [ /ServerFeatures ] [ /Credits ] [ /Admins ] [ /Report ]\n\n|***Chat Commands***|\n\n[ /G(Text) ]\n\n|***Team Commands***|\n\n[ /Teams ] [ /MyTeam ] [ /ChangeTeam ]\n\n|***Player Commands***|\n\n[ /Stats ] [ /Pm ] [ /Kill ] [/Pay] [ /Shop ]\n\n|***Radio Commands***|\n\n[ /RadioHelp ] [ /SetRadio ]\n\n");
            strcat(Commands,"|***Admin LvL 1 Commands***|\n\n[ #(Text) ] [ /GetIp ] [ /Warn ] [ /Heal ] [ /Get ]\n\n[ /Goto ] [ /Armour ] [ /Ann ] [ /Fix ] [ /Flip ] [ /PlayerInfo ]\n\n");
            strcat(Commands,"|***Admin LvL 2 Commands***|\n\n[ /Banwarn ] [ /Kick ] [ /Cchat ] [ /Sethealth ] [ /Givemoney ]\n\n[ /Burn ] [ /Mute ] [ /Unmute ] [ /Armour ] [ /Setweather ] [ /Settime ]\n\n");
            ShowPlayerDialog(playerid,COMMANDS_DIALOG, DIALOG_STYLE_MSGBOX, ""COL_BLUE"Sniper War Commands",Commands, "OK", "Cancel");
        }
        case 3:
        {
            strcat(Commands,"|***Server Commands***|\n\n[ /Rules] [ /ServerFeatures ] [ /Credits ] [ /Admins ] [ /Report ]\n\n|***Chat Commands***|\n\n[ /G(Text) ]\n\n|***Team Commands***|\n\n[ /Teams ] [ /MyTeam ] [ /ChangeTeam ]\n\n|***Player Commands***|\n\n[ /Stats ] [ /Pm ] [ /Kill ] [/Pay] [ /Shop ]\n\n|***Radio Commands***|\n\n[ /RadioHelp ] [ /SetRadio ]\n\n");
            strcat(Commands,"|***Admin LvL 1 Commands***|\n\n[ #(Text) ] [ /GetIp ] [ /Warn ] [ /Heal ] [ /Get ]\n\n[ /Goto ] [ /Armour ] [ /Ann ] [ /Fix ] [ /Flip ] [ /PlayerInfo ]\n\n");
            strcat(Commands,"|***Admin LvL 2 Commands***|\n\n[ /Banwarn ] [ /Kick ] [ /Cchat ] [ /Sethealth ] [ /Givemoney ]\n\n[ /Burn ] [ /Mute ] [ /Unmute ] [ /Armour ] [ /Setweather ] [ /Settime ]\n\n");
            strcat(Commands,"|***Admin LvL 3 Commands***|\n\n[ /Ban ] [ /Explode ] [ /Setscore ] [ /Slap ] [ /Setskin ] [ /Setarmour ] [ /Giveweap ] [ /Disarm ] [ /Healall ] [ /Armourall ] [ /Freeze ] [ /Unfreeze ]\n\n");
            ShowPlayerDialog(playerid,COMMANDS_DIALOG, DIALOG_STYLE_MSGBOX, ""COL_BLUE"Sniper War Commands",Commands, "OK", "Cancel");
        }
        case 4:
        {
            strcat(Commands,"|***Server Commands***|\n\n[ /Rules] [ /ServerFeatures ] [ /Credits ] [ /Admins ] [ /Report ]\n\n|***Chat Commands***|\n\n[ /G(Text) ]\n\n|***Team Commands***|\n\n[ /Teams ] [ /MyTeam ] [ /ChangeTeam ]\n\n|***Player Commands***|\n\n[ /Stats ] [ /Pm ] [ /Kill ] [/Pay] [ /Shop ]\n\n|***Radio Commands***|\n\n[ /RadioHelp ] [ /SetRadio ]\n\n");
            strcat(Commands,"|***Admin LvL 1 Commands***|\n\n[ #(Text) ] [ /GetIp ] [ /Warn ] [ /Heal ] [ /Get ]\n\n[ /Goto ] [ /Armour ] [ /Ann ] [ /Fix ] [ /Flip ] [ /PlayerInfo ]\n\n");
            strcat(Commands,"|***Admin LvL 2 Commands***|\n\n[ /Banwarn ] [ /Kick ] [ /Cchat ] [ /Sethealth ] [ /Givemoney ]\n\n[ /Burn ] [ /Mute ] [ /Unmute ] [ /Armour ] [ /Setweather ] [ /Settime ]\n\n");
            strcat(Commands,"|***Admin LvL 3 Commands***|\n\n[ /Ban ] [ /Explode ] [ /Setscore ] [ /Slap ] [ /Setskin ] [ /Setarmour ] [ /Giveweap ] [ /Disarm ] [ /Healall ] [ /Armourall ] [ /Freeze ] [ /Unfreeze ]\n\n");
            strcat(Commands,"|***Admin LvL 4 Commands***|\n\n[ /Akill ] [ /Resetscore ] [ /Resetmoney ]\n\n");
            ShowPlayerDialog(playerid,COMMANDS_DIALOG, DIALOG_STYLE_MSGBOX, ""COL_BLUE"Sniper War Commands",Commands, "OK", "Cancel");
        }
        case 5:
        {
            strcat(Commands,"|***Server Commands***|\n\n[ /Rules] [ /ServerFeatures ] [ /Credits ] [ /Admins ] [ /Report ]\n\n|***Chat Commands***|\n\n[ /G(Text) ]\n\n|***Team Commands***|\n\n[ /Teams ] [ /MyTeam ] [ /ChangeTeam ]\n\n|***Player Commands***|\n\n[ /Stats ] [ /Pm ] [ /Kill ] [/Pay] [ /Shop ]\n\n|***Radio Commands***|\n\n[ /RadioHelp ] [ /SetRadio ]\n\n");
            strcat(Commands,"|***Admin LvL 1 Commands***|\n\n[ #(Text) ] [ /GetIp ] [ /Warn ] [ /Heal ] [ /Get ]\n\n[ /Goto ] [ /Armour ] [ /Ann ] [ /Fix ] [ /Flip ] [ /PlayerInfo ]\n\n");
            strcat(Commands,"|***Admin LvL 2 Commands***|\n\n[ /Banwarn ] [ /Kick ] [ /Cchat ] [ /Sethealth ] [ /Givemoney ]\n\n[ /Burn ] [ /Mute ] [ /Unmute ] [ /Armour ] [ /Setweather ] [ /Settime ]\n\n");
            strcat(Commands,"|***Admin LvL 3 Commands***|\n\n[ /Ban ] [ /Explode ] [ /Setscore ] [ /Slap ] [ /Setskin ] [ /Setarmour ] [ /Giveweap ] [ /Disarm ] [ /Healall ] [ /Armourall ] [ /Freeze ] [ /Unfreeze ]\n\n");
            strcat(Commands,"|***Admin LvL 4 Commands***|\n\n[ /Akill ] [ /Resetscore ] [ /Resetmoney ]\n\n");
            strcat(Commands,"|***Admin LvL 5 Commands***|\n\n[ /Setadmin ] [ /Makevip ]\n\n");
            ShowPlayerDialog(playerid,COMMANDS_DIALOG, DIALOG_STYLE_MSGBOX, ""COL_BLUE"Sniper War Commands",Commands, "OK", "Cancel");
        }
    }
    return 1;
}
Reply
#10

Ohhh I see,thank you very much I get it now,so I can constantly use Strcat(Commands for as long as needed,cool much appreciated
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)