CMD:aheal(playerid, params[]) { f(PlayerInfo[playerid][Level] >= 2) return SCM(playerid,0xFF8284FF,"[ERROR]: You are not allowed to use this command!"); SetPlayerHealth(playerid, 100); return 1; }
I have problem in this command! When i am admin lvl 6 or 5,4,3,2 i am not allowed to use this command but i am admin lol
When i set my level to 0 or 1 i can use it! What is the problem! This command must be allowed only the use admin level 2 to 6! How to fix that Код:
CMD:aheal(playerid, params[]) { f(PlayerInfo[playerid][Level] >= 2) return SCM(playerid,0xFF8284FF,"[ERROR]: You are not allowed to use this command!"); SetPlayerHealth(playerid, 100); return 1; } |
if(PlayerInfo[playerid][Level] <= 1) return SCM(playerid,0xFF8284FF,"[ERROR]: You are not allowed to use this command!");
<= 1 |
>= 2 |
CMD:aheal(playerid, params[])
{
if(PlayerInfo[playerid][Level] <= 2) return SCM(playerid,0xFF8284FF,"[ERROR]: You are not allowed to use this command!");
SetPlayerHealth(playerid, 100);
return 1;
}
CMD:aheal(playerid, params[])
{
if(PlayerInfo[playerid][Level] < 2)
{
return SCM(playerid,0xFF8284FF,"[ERROR]: You are not allowed to use this command!");
}
//ELSE
SetPlayerHealth(playerid, 100);
return 1;
}
In addition to what the others said, i suggest you to format your code a littlebit more, because it is easier to read:
PHP код:
|
CMD:aheal(playerid, params[])
{
if(PlayerInfo[playerid][Level] < 2)
return SCM(playerid,0xFF8284FF,"[ERROR]: You are not allowed to use this command!");
//ELSE
SetPlayerHealth(playerid, 100);
return 1;
}