/acmds help. -
Glossy42O - 08.01.2015
I have a little problem.
The commands looks good to me. So here's the problem:
No matter what level i am it says "You're not authorized to use that command"
Here is my command.
PHP код:
CMD:acmds(playerid, params[])
{
if(pInfo[playerid][Adminlevel] == 1) return SendClientMessage(playerid, -1, "{FF0000}Error: You are not authorized to use this command.");
{
ShowPlayerDialog(playerid, -1, DIALOG_STYLE_MSGBOX, "Admin commands", "{FFFF33}TRIAL ADMINISTRATOR COMMANDS\n/kick, /clearc, /setskin", "OK", "Exit");
}
if(pInfo[playerid][Adminlevel] == 2) return SendClientMessage(playerid, -1, "{FF0000}Error: You are not authorized to use this command.");
{
ShowPlayerDialog(playerid, -1, DIALOG_STYLE_MSGBOX, "Admin commands", "{00CC00}MODERATOR COMMANDS\n/ban", "OK", "Exit");
}
if(pInfo[playerid][Adminlevel] == 3) return SendClientMessage(playerid, -1, "{FF0000}Error: You are not authorized to use this command.");
{
ShowPlayerDialog(playerid, -1, DIALOG_STYLE_MSGBOX, "Admin commands", "{99CCFF}ADMIN COMMANDS\n/pheal", "OK","EXIT");
}
if(pInfo[playerid][Adminlevel] == 4) return SendClientMessage(playerid, -1, "{FF0000}Error: You are not authorized to use this command.");
{
ShowPlayerDialog(playerid, -1, DIALOG_STYLE_MSGBOX, "Admin commands", "{FFCCFF}HEAD ADMINISTRATOR COMMANDS\n/akill", "OK","EXIT");
}
if(pInfo[playerid][Adminlevel] == 5) return SendClientMessage(playerid, -1, "{FF0000}Error: You are not authorized to use this command.");
{
ShowPlayerDialog(playerid, -1, DIALOG_STYLE_MSGBOX, "Admin commands", "","OK","EXIT");
}
if(pInfo[playerid][Adminlevel] == 6) return SendClientMessage(playerid, -1, "{FF0000}Error: You are not authorized to use this command.");
{
ShowPlayerDialog(playerid, -1, DIALOG_STYLE_MSGBOX, "Admin commands", "{FF0000}SERVER OWNER COMMANDS\n/setlevel", "OK", "EXIT");
}
return 1;
}
Re: /acmds help. -
nezo2001 - 08.01.2015
lol
remove all
PHP код:
return SendClientMessage
And add at the beginning
PHP код:
if(PlayerInfo[playerid][pAdmin] == 0) return SendClientMessage(playerid, COLOR_RED,"You message);
This may work
Re: /acmds help. -
Glossy42O - 08.01.2015
What do you mean?
Re: /acmds help. -
UltraScripter - 08.01.2015
Bro like nezoo said remove the
pawn Код:
return SendClientMessage(playerid, COLOR_RED,"You message);
the == 1 checks if player is lvl 1 not if he isnt!
and the return is usless when you do
Re: /acmds help. -
UltraScripter - 08.01.2015
Try This :
pawn Код:
CMD:acmds(playerid, params[])
{
if(pInfo[playerid][Adminlevel] == 1)
{
ShowPlayerDialog(playerid, -1, DIALOG_STYLE_MSGBOX, "Admin commands", "{FFFF33}TRIAL ADMINISTRATOR COMMANDS\n/kick, /clearc, /setskin", "OK", "Exit");
}
if(pInfo[playerid][Adminlevel] == 2)
{
ShowPlayerDialog(playerid, -1, DIALOG_STYLE_MSGBOX, "Admin commands", "{00CC00}MODERATOR COMMANDS\n/ban", "OK", "Exit");
}
if(pInfo[playerid][Adminlevel] == 3)
{
ShowPlayerDialog(playerid, -1, DIALOG_STYLE_MSGBOX, "Admin commands", "{99CCFF}ADMIN COMMANDS\n/pheal", "OK","EXIT");
}
if(pInfo[playerid][Adminlevel] == 4)
{
ShowPlayerDialog(playerid, -1, DIALOG_STYLE_MSGBOX, "Admin commands", "{FFCCFF}HEAD ADMINISTRATOR COMMANDS\n/akill", "OK","EXIT");
}
if(pInfo[playerid][Adminlevel] == 5)
{
ShowPlayerDialog(playerid, -1, DIALOG_STYLE_MSGBOX, "Admin commands", "","OK","EXIT");
}
if(pInfo[playerid][Adminlevel] == 6)
{
ShowPlayerDialog(playerid, -1, DIALOG_STYLE_MSGBOX, "Admin commands", "{FF0000}SERVER OWNER COMMANDS\n/setlevel", "OK", "EXIT");
}
else
{
SendClientMessage(playerid, -1, "{FF0000}Error: You are not authorized to use this command.");
}
return 1;
}
Re: /acmds help. -
Glossy42O - 08.01.2015
Oh, thank you :P