Little Help
#1

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?
Reply
#2

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

https://sampwiki.blast.hk/wiki/ShowPlayerDialog
Reply
#3

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
Reply
#4

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

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;
}
Reply
#6

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..
Reply
#7

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)