I'd rather make it like this for now:
PHP Code:
new essentials_tp, essentials_tphere
new const g_Permissions[][] = { "essentials.tp", "essentials.tphere" }
essentials_tp = register_cvar(g_Permissions[0], "d")
essentials_tphere = register_cvar(g_Permissions[1], "d")
Adding a simple function for this would be quite useful.
PS: Is something like this possible?
PHP Code:
new essentials_tp, essentials_tphere
new const g_Permissions[][] = {
essentials_tp, "essentials.tp", "d"
essentials_tphere, "essentials.tphere", "d"
}
for new(i = 0; i < sizeof(g_Permissions) - 2; i += 3)
g_Permissions[i] = register_cvar(i+1; i+2)
//Edit: nevermind, I found a somewhat simple way:
PHP Code:
if(!user_permission(id, essentials_tphere, "essentials.tphere", 1))
return PLUGIN_HANDLED