You are not authorized to use this command.
#1

Hey.

When i add this: if(!IsPlayerAdmin(playerid)) return sendclientmessage bla bla you are not authorized to use this command, it returns you are not authorized to use this command even if i type /sampisagreatgame. I also added this:
Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
	if(!success) SendClientMessage(playerid, COLORWHITE, "That command does not exist. Use {FFFF00}/help{FFFFFF} to see a list of available commands.");
	return 1;
}
at the end of my script, and it doesnt return that if i type a non-existing command, it returns "you are not authorized". only if i am a rcon admin, it returns "that command does not exist" normally.

please help. thank you.
Reply
#2

Well, it depends on what command processor you're using. If you're using Pawn.CMD, there's an explation on how to set up commands to only be used by admins and how to display the not authorized message under either OnPlayerCommandRecieved or OnPlayerCommandPerformed.

If you're using something like zcmd or izcmd, you'll have to go through each command that requires admin access and add the permissions there:

pawn Код:
CMD:examplecmd(playerid, params[])
{
    if(IsPlayerAdmin(playerid))
    {
        //rest of the command
    }
    else return SendClientMessage(playerid, COLORWHITE, "You are not authorized to use this command.");
    return 1;
}
Reply
#3

Quote:
Originally Posted by DTV
Посмотреть сообщение
Well, it depends on what command processor you're using. If you're using Pawn.CMD, there's an explation on how to set up commands to only be used by admins and how to display the not authorized message under either OnPlayerCommandRecieved or OnPlayerCommandPerformed.

If you're using something like zcmd or izcmd, you'll have to go through each command that requires admin access and add the permissions there:

pawn Код:
CMD:examplecmd(playerid, params[])
{
    if(IsPlayerAdmin(playerid))
    {
        //rest of the command
    }
    else return SendClientMessage(playerid, COLORWHITE, "You are not authorized to use this command.");
    return 1;
}
it works! im using zcmd. thank you so much bro! +rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)