Macro - Code after body
#7

OK, I've done it this way:

Writing PERMISSION_{permission} everytime in the command definition.

Код:
ACMD:makeadmin(playerid, params[], PERMISSION_COMMAND_MAKEADMIN)
Hey, that's shorter then writing the following everytime:
Код:
CMD:makeadmin(playerid, params[])
{
	if (!HasPermission(playerid, PERMISSION_COMMAND_MAKEADMIN)) return COMMAND_PERMISSION_DENIED;
	// My code
}
And it's flexible enough to easily change the permission check code in the future.

Thanks for the helpful replies!
Reply


Messages In This Thread
Macro - Code after body - by Programie - 20.02.2012, 13:53
Re: Macro - Code after body - by MP2 - 20.02.2012, 13:55
Re: Macro - Code after body - by Programie - 20.02.2012, 13:56
Re: Macro - Code after body - by Cameltoe - 20.02.2012, 14:02
Re: Macro - Code after body - by Programie - 20.02.2012, 14:04
Re: Macro - Code after body - by Programie - 20.02.2012, 14:44
Re: Macro - Code after body - by Programie - 20.02.2012, 16:34
Re: Macro - Code after body - by Programie - 20.02.2012, 16:47

Forum Jump:


Users browsing this thread: 2 Guest(s)