05.07.2016, 18:18
Quote:
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); |
PHP код:
enum(<<=1)
{
CMD_ADMIN = 1,
};