SA-MP Forums Archive
Problem with DIALOG_STYLE_MSGBOX - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Problem with DIALOG_STYLE_MSGBOX (/showthread.php?tid=525339)



Problem with DIALOG_STYLE_MSGBOX - friezakinght - 11.07.2014

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


Re: Problem with DIALOG_STYLE_MSGBOX - KayJ - 11.07.2014

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


Re: Problem with DIALOG_STYLE_MSGBOX - BroZeus - 11.07.2014

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;
}