Command able to be used if RCON logged - 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: Command able to be used if RCON logged (
/showthread.php?tid=645524)
Command able to be used if RCON logged -
Mobtiesgangsa - 28.11.2017
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
Re: Command able to be used if RCON logged -
Meller - 28.11.2017
correctly proccessed
Re: Command able to be used if RCON logged -
Lucases - 28.11.2017
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.");
}
Re: Command able to be used if RCON logged -
OneDay - 29.11.2017
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