Problem with DIALOG_STYLE_MSGBOX
#1

Hi, i have a problem with this code:
pawn Код:
CMD:acmds(playerid, params[])
{
    new level1[128], level2[128], level3[128], level4[128], level5[128];
    format(level1, sizeof(level1), "{336633}Level 1:{FFFFCC} /setskin");
    format(level2, sizeof(level2), "{336633}Level 2:{FFFFCC} No commands");
    format(level3, sizeof(level3), "{336633}Level 3:{FFFFCC} No commands");
    format(level4, sizeof(level4), "{336633}Level 4:{FFFFCC} /setcash");
    format(level5, sizeof(level5), "{336633}Level 5:{FFFFCC} /setadmin");
    if(PlayerInfo[playerid][pALevel] >= 1)
    {
        ShowPlayerDialog(playerid, DIALOG_ACMDS, DIALOG_STYLE_MSGBOX, "{336633}Fri's TDM Admin Commands", ""level1"\n\n"level2"\n\n"level3"\n\n"level4"\n\n"level5"", "Ok", "");
    }
    return 1;
}
It gives me these errors
Код:
C:\Users\Cretu\Desktop\Testing Server\gamemodes\fritdm.pwn(283) : error 001: expected token: "-string end-", but found "-identifier-"
C:\Users\Cretu\Desktop\Testing Server\gamemodes\fritdm.pwn(283) : error 001: expected token: "-string end-", but found "-identifier-"
C:\Users\Cretu\Desktop\Testing Server\gamemodes\fritdm.pwn(283) : warning 215: expression has no effect
C:\Users\Cretu\Desktop\Testing Server\gamemodes\fritdm.pwn(283) : error 001: expected token: ";", but found "-identifier-"
C:\Users\Cretu\Desktop\Testing Server\gamemodes\fritdm.pwn(283) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
on the showdialog line, please help i will +rep
Reply
#2

pawn Код:
CMD:acmds(playerid, params[])
{
    if(PlayerInfo[playerid][pALevel] >= 1)
    {
        new level1[128], level2[128], level3[128], level4[128], level5[128];
        format(level1, sizeof(level1), "{336633}Level 1:{FFFFCC} /setskin");
        format(level2, sizeof(level2), "{336633}Level 2:{FFFFCC} No commands");
        format(level3, sizeof(level3), "{336633}Level 3:{FFFFCC} No commands");
        format(level4, sizeof(level4), "{336633}Level 4:{FFFFCC} /setcash");
        format(level5, sizeof(level5), "{336633}Level 5:{FFFFCC} /setadmin");
        ShowPlayerDialog(playerid, DIALOG_ACMDS, DIALOG_STYLE_MSGBOX, "{336633}Fri's TDM Admin Commands", ""level1"\n\n"level2"\n\n"level3"\n\n"level4"\n\n"level5"", "Ok", "");
    }
    return 1;
}
Try this
Reply
#3

pawn Код:
CMD:acmds(playerid, params[])
{
    new str[500];
    format(str, sizeof(str), "{336633}Level 1:{FFFFCC} /setskin\n\n");
    strcat(str, "{336633}Level 2:{FFFFCC} No commands\n\n");
    strcat(str, "{336633}Level 3:{FFFFCC} No commands\n\n");
    strcat(str, "{336633}Level 4:{FFFFCC} /setcash\n\n");
    strcat(str, "{336633}Level 5:{FFFFCC} /setadmin");
    if(PlayerInfo[playerid][pALevel] >= 1)
    {
        ShowPlayerDialog(playerid, DIALOG_ACMDS, DIALOG_STYLE_MSGBOX, "{336633}Fri's TDM Admin Commands", str, "Ok", "");
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)