little bug
#1

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.
Reply
#2

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
Reply
#3

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

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.");
Reply
#5

Thank you Jeff, Your code has fixed it!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)