SA-MP Forums Archive
little bug - 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: little bug (/showthread.php?tid=588239)



little bug - saffierr - 06.09.2015

Well, I am working on my own admin system, and I've got an issue.
Examples:
PHP код:
CMD:setarmour(playeridparams[])
{
    if(
PlayerInfo[playerid][AdminLevel] < 1) return 0
it displays a SERVER: Unknown command to a regular player(which is what I want))

PHP код:
CMD:getip(playeridparams[])
{
    if(
PlayerInfo[playerid][AdminLevel] < 2) return SendClientMessage(playeridCOLOR_YELLOWGREEN"Error: You are not authorized to use this command."); 
I did not do
PHP код:
return 0
here because I want it like: When a player is Admin Level 1, he has to see that message with, You're not authorized to use this command. BUT THE BUG IS, when a regular player enters the cmd /getip he receives the message also like the Admin lvl 1. So, my question is how do I make it like, that a regular player ALWAYS has to receive a message with SERVER: Unknown command. When they try to enter an admin cmd.

Conclusion: If an admin lvl 1 enters a cmd from admin lvl 2(or higher) he should receive the message with "You are not authorized to use this command"
And if a regular player enters a cmd which is for ADMINS only, he should receive SERVER: Unknown command.

NOTE: If you need more explanation, reply.


Re: little bug - jlalt - 06.09.2015

try:
PHP код:
CMD:getip(playeridparams[])
{
    if(
PlayerInfo[playerid][AdminLevel] == || PlayerInfo[playerid][AdminLevel] == 2) return SendClientMessage(playeridCOLOR_YELLOWGREEN"Error: You are not authorized to use this command.");
    else if(
PlayerInfo[playerid][AdminLevel] == 0) return 0



Re: little bug - saffierr - 06.09.2015

Thank you for your reply, but it didn't solve the problem.


Re: little bug - Jefff - 06.09.2015

pawn Код:
CMD:getip(playerid, params[])
{
    // regular player
    if(PlayerInfo[playerid][AdminLevel] < 1) return 0;

    // admin lvl 1
    if(PlayerInfo[playerid][AdminLevel] < 2) return SendClientMessage(playerid, COLOR_YELLOWGREEN, "Error: You are not authorized to use this command.");



Re: little bug - saffierr - 06.09.2015

Thank you Jeff, Your code has fixed it!