You are not authorized to use this command. - 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: You are not authorized to use this command. (
/showthread.php?tid=618685)
You are not authorized to use this command. -
iamjems - 08.10.2016
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.
Re: You are not authorized to use this command. -
DTV - 09.10.2016
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;
}
Re: You are not authorized to use this command. -
iamjems - 09.10.2016
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