SA-MP Forums Archive
Little Help - 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: Little Help (/showthread.php?tid=513325)



Little Help - Sanady - 15.05.2014

Hello I need help with one command when I type it it`s says unknown command here is the code
pawn Код:
CMD:serverpanel(playerid,params[])
{
    if(pInfo[playerid][pAdmin] < 5 &&!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,0xFFFFFFFF,""embed_red"[ERROR] "embed_white"You are not authorized to use this command!");

    ShowPlayerDialog(playerid,1421,DIALOG_STYLE_LIST,""embed_white"Server Panel",cPanel(),"Submit","Cancel");
    return 1;
}
Anyone know why?


Re: Little Help - Koala818 - 15.05.2014

Show us the cPanel() function.
What you wrote will work only if that function returns a string.

https://sampwiki.blast.hk/wiki/ShowPlayerDialog


Re: Little Help - Sanady - 15.05.2014

pawn Код:
cPanel()
{
    new ServerStats[1024];
    format(ServerStats,sizeof(ServerStats),""embed_white"Double-Score\t\t\t%s\n\
                                            "
embed_white"Car Capture\t\t\t%s\n\
                                            "
embed_white"Connect Messages\t\t%s\n\
                                            "
embed_white"Watch PMs\t\t\t%s\n\
                                            "
embed_white"Zones Debug\t\t\t%s",
                                            sPanel[Doublescore]     ? (""embed_green"Enabled") : (""embed_orange"Disabled"),
                                            sPanel[CarCapture]      ? (""embed_green"Enabled") : (""embed_orange"Disabled"),
                                            sPanel[ConnectMessage]      ? (""embed_green"Enabled") : (""embed_orange"Disabled"),
                                            sPanel[WatchPM]     ? (""embed_green"Enabled") : (""embed_orange"Disabled"),
                                            sPanel[ZonesDebug]      ? (""embed_green"Enabled") : (""embed_orange"Disabled"));
    return ServerStats;
}
Here you got


Re: Little Help - ball - 15.05.2014

Try to put another string instead of cPanel and check if it will work. If yes - the error is cPanel function, but check it.


Re: Little Help - Beckett - 15.05.2014

pawn Код:
CMD:serverpanel(playerid,params[])
{
    if(pInfo[playerid][pAdmin] < 5 &&!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,0xFFFFFFFF,""embed_red"[ERROR] "embed_white"You are not authorized to use this command!");

    ShowPlayerDialog(playerid,1421,DIALOG_STYLE_LIST,""embed_white"Server Panel",cPanel(),"Submit","Cancel");
    return 1;
}
Try removing the restriction for now to know that the issue is in the dialog or the restriction.
pawn Код:
CMD:serverpanel(playerid,params[])
{
    //if(pInfo[playerid][pAdmin] < 5 &&!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,0xFFFFFFFF,""embed_red"[ERROR] "embed_white"You are not authorized to use this command!");

    ShowPlayerDialog(playerid,1421,DIALOG_STYLE_LIST,""embed_white"Server Panel",cPanel(),"Submit","Cancel");
    return 1;
}



Re: Little Help - Sanady - 17.05.2014

Quote:
Originally Posted by DaniceMcHarley
Посмотреть сообщение
pawn Код:
CMD:serverpanel(playerid,params[])
{
    if(pInfo[playerid][pAdmin] < 5 &&!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,0xFFFFFFFF,""embed_red"[ERROR] "embed_white"You are not authorized to use this command!");

    ShowPlayerDialog(playerid,1421,DIALOG_STYLE_LIST,""embed_white"Server Panel",cPanel(),"Submit","Cancel");
    return 1;
}
Try removing the restriction for now to know that the issue is in the dialog or the restriction.
pawn Код:
CMD:serverpanel(playerid,params[])
{
    //if(pInfo[playerid][pAdmin] < 5 &&!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,0xFFFFFFFF,""embed_red"[ERROR] "embed_white"You are not authorized to use this command!");

    ShowPlayerDialog(playerid,1421,DIALOG_STYLE_LIST,""embed_white"Server Panel",cPanel(),"Submit","Cancel");
    return 1;
}
I tried to do that and still same problem..


Re: Little Help - JuanStone - 17.05.2014

pawn Код:
CMD:serverpanel(playerid, params[])
{
    if(pInfo[playerid][pAdmin] < 5)
    {
        ShowPlayerDialog(playerid,1421,DIALOG_STYLE_LIST,""embed_white"Server Panel",cPanel(),"Submit","Cancel");
    }
    else
    {
        SendClientMessage(playerid,0xFFFFFFFF,""embed_red"[ERROR] "embed_white"You are not authorized to use this command!");
    }
    return 1;
}
:

pawn Код:
if(!IsPlayerAdmin(playerid)) .. // wft ї what does this mean ?.
may work