20.02.2012, 13:53
Hi,
I'm using zcmd for the player commands in my script.
Now I want to add some admin commands. In every script I have to check if the player has the required permission.
Currently I'm doing it this way:
That's unsafe because I can forget to add the IsAdmin check.
So I want to convert this code into a macro. I want to use something like this to write my admin commands:
IsAdmin should be called in the macro and use the constant "PERMISSION_COMMAND_{command}" as the second parameter.
Is that possible?
I'm using zcmd for the player commands in my script.
Now I want to add some admin commands. In every script I have to check if the player has the required permission.
Currently I'm doing it this way:
Код:
CMD:makeadmin(playerid, params[]) { if (IsAdmin(playerid, PERMISSION_COMMAND_MAKEADMIN)) { // Some code executed if the player has the permission } else { return COMMAND_PERMISSION_DENIED; } }
So I want to convert this code into a macro. I want to use something like this to write my admin commands:
Код:
ACMD:makeadmin(playerid, params[]) { // Some code executed if the player has the permission }
Is that possible?