Command able to be used if RCON logged
#1

in my example will i be able to use this variant to process my admin commands

Код:
enum p_Info
{
     p_Admin
};
new UserInfo[MAX_PLAYERS][p_Info];
and i a command callback

Код:
CMD:setadminlevel(playerid, params[])
{
     //IsPlayerAdmin will Notify me am i logged as RCON
     //UserInfo[playerid][p_Admin] >= 7 only a level 7 admin can use this command
     if(IsPlayerAdmin(playerid) || UserInfo[playerid][p_Admin] >= 7)
     return 1;
}
lets say in my opinion.
This form of command will it be wrong porcessed or correctly proccessed
Reply
#2

correctly proccessed
Reply
#3

It's correct.
Anyway I suggest you to use the opposite of that if statement.

pawn Код:
CMD:setadminlevel(playerid, params[])
{
     if(!IsPlayerAdmin(playerid) || UserInfo[playerid][p_Admin] < 7)
     return SendClientMessage(playerid, -1, "You can't use this command.");
}
Reply
#4

Quote:
Originally Posted by Lucases
Посмотреть сообщение
It's correct.
Anyway I suggest you to use the opposite of that if statement.

pawn Код:
CMD:setadminlevel(playerid, params[])
{
     if(!IsPlayerAdmin(playerid) || UserInfo[playerid][p_Admin] < 7)
     return SendClientMessage(playerid, -1, "You can't use this command.");
}
That is wrong

pawn Код:
CMD:setadminlevel(playerid, params[])
{
     if(!IsPlayerAdmin(playerid) && UserInfo[playerid][p_Admin] < 7)
         return SendClientMessage(playerid, -1, "You can't use this command.");
}
And your indentation is bad
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)