20.02.2012, 14:44
(
Последний раз редактировалось Programie; 20.02.2012 в 15:41.
)
Quote:
Yes and no. You can't make "makeadmin" upper-case, so you can only generate code with "PERMISSION_COMMAND_makeadmin". If that will do you have:
pawn Код:
|
Код:
ACMD:MAKEADMIN(playerid, params[])
Код:
#define ACMD:%0(%1,%2,%3) CMD:%0(%1, %2) if (!IsAdmin(playerid, %3)) return COMMAND_PERMISSION_DENIED; else
Contra: I have to add the required permission constant to each command.
//EDIT: Ok, that works.
But this will crash the compiler:
Код:
#define ACMD:%0(%1,%2,%3) COMMAND:%0(%1, %2) if (!HasPermission(%1, PERMISSION_%3)) return COMMAND_PERMISSION_DENIED; else
If I change "PERMISSION_%3" to "%3" it works...
// EDIT 2: I found the problem. There is a space before %3... Is there a way to remove it without removing the space everywhere?