PDA

View Full Version : Little Help


Sanady
15/05/2014, 05:40 PM
Hello I need help with one command when I type it it`s says unknown command here is the code

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?

Koala818
15/05/2014, 05:43 PM
Show us the cPanel() function.
What you wrote will work only if that function returns a string.

http://wiki.sa-mp.com/wiki/ShowPlayerDialog

Sanady
15/05/2014, 06:02 PM
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

ball
15/05/2014, 06:19 PM
Try to put another string instead of cPanel and check if it will work. If yes - the error is cPanel function, but check it.

Beckett
15/05/2014, 06:32 PM
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.
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;
}

Sanady
17/05/2014, 07:53 AM
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.
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..

JuanStone
17/05/2014, 08:49 AM
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;
}

:o :

if(!IsPlayerAdmin(playerid)) .. // wft what does this mean ?.

may work