summaryrefslogtreecommitdiff
path: root/npc/functions
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2018-03-20 08:56:38 -0300
committerJesusaves <cpntb1@ymail.com>2018-03-20 08:56:38 -0300
commitfa768d6b1301c8ed5806b36ea2671d8c672a572f (patch)
tree71489fd6cb8a7bc0ae8cd0f652231e103d70bb2f /npc/functions
parent45d0d0bcc1104d56304d6df15a0904d93e60bcb6 (diff)
downloadserverdata-fa768d6b1301c8ed5806b36ea2671d8c672a572f.tar.gz
serverdata-fa768d6b1301c8ed5806b36ea2671d8c672a572f.tar.bz2
serverdata-fa768d6b1301c8ed5806b36ea2671d8c672a572f.tar.xz
serverdata-fa768d6b1301c8ed5806b36ea2671d8c672a572f.zip
Stop using getgmlevel() and use is_gm() is_admin() and is_staff().
Our four power levels: getgmlevel() → Sponsors, etc. is_staff() → GM 5, Developers, test server, etc. is_gm() → GM 80, Game Master, controls the world is_admin() → GM 99, Administrator, controls the uniserver (pun intended)
Diffstat (limited to 'npc/functions')
-rw-r--r--npc/functions/permissions.txt36
1 files changed, 9 insertions, 27 deletions
diff --git a/npc/functions/permissions.txt b/npc/functions/permissions.txt
index 62e0da6b7..99094bb43 100644
--- a/npc/functions/permissions.txt
+++ b/npc/functions/permissions.txt
@@ -1,35 +1,17 @@
-// Evol scripts.
+// TMW2 scripts.
// Author:
-// gumi
+// Jesusalva
// Description:
-// checks player permissions
-// ** admins are implicitly everything
+// Checks player GM levels
-// administrator
-function script is_admin {
- return has_permission(PERM_USE_ALL_COMMANDS, getarg(0, getcharid(CHAR_ID_ACCOUNT)));
-}
-
-// any staff member
-function script is_trusted {
- return is_admin(getarg(0, getcharid(CHAR_ID_ACCOUNT))) ||
- has_permission("show_client_version", getarg(0, getcharid(CHAR_ID_ACCOUNT)));
-}
-
-// developer
-function script is_dev {
- return is_admin(getarg(0, getcharid(CHAR_ID_ACCOUNT))) ||
- has_permission(PERM_RECEIVE_REQUESTS, getarg(0, getcharid(CHAR_ID_ACCOUNT)));
+function script is_gm {
+ return (getgmlevel() >= 80);
}
-// event coordinator
-function script is_evtc {
- return is_admin(getarg(0, getcharid(CHAR_ID_ACCOUNT))) ||
- can_use_command("@monster", getarg(0, getcharid(CHAR_ID_ACCOUNT)));
+function script is_admin {
+ return (getgmlevel() >= 99);
}
-// game master
-function script is_gm {
- return is_admin(getarg(0, getcharid(CHAR_ID_ACCOUNT))) ||
- has_permission("send_gm", getarg(0, getcharid(CHAR_ID_ACCOUNT)));
+function script is_staff {
+ return (getgmlevel() >= 5);
}