05.07.2016, 18:12
What exactly is wrong with this? It doesn't seem to detect the flags for my commands, and thus non-admins can use those commands.
Код:
enum(<<=1)
{
CMD_ADMIN,
};
public OnPlayerCommandReceived(playerid, cmd[], params[], flags)
{
if((flags & CMD_ADMIN) && !IsPlayerAdmin(playerid))
{
SendErrorMessage(playerid, "You do not have permission in order to use this command!");
return 0;
}
return 1;
}
cmd:unstuck(playerid, params[])
{
new player;
if(sscanf(params, "u", player))
return SendSyntaxMessage(playerid, "/unstuck [playerid]");
new Float:cX, Float:cY, Float:cZ;
GetPlayerPos(player, cX, cY, cZ);
SetPlayerPos(player, cX, cY, cZ+2.0);
return 1;
}
flags:unstuck(CMD_ADMIN);

