summaryrefslogtreecommitdiff
path: root/doc/script_commands.txt
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2017-04-29 00:25:37 +0200
committerGitHub <noreply@github.com>2017-04-29 00:25:37 +0200
commit259a9768d5d13c4e2e84b216ec25d34f63c7d1c0 (patch)
treeaa4c12298fc94476b1e3a3b6476fcc7c8f3b6a69 /doc/script_commands.txt
parent109661e3d5fb4cc6ddde9b32f8c99012c8d17bce (diff)
parent7afb1a56559f4b1e35c68b20e282b923c4d7a0ba (diff)
downloadhercules-259a9768d5d13c4e2e84b216ec25d34f63c7d1c0.tar.gz
hercules-259a9768d5d13c4e2e84b216ec25d34f63c7d1c0.tar.bz2
hercules-259a9768d5d13c4e2e84b216ec25d34f63c7d1c0.tar.xz
hercules-259a9768d5d13c4e2e84b216ec25d34f63c7d1c0.zip
Merge pull request #1712 from mekolat/canuse2
add permission checking buildins, expose PC permission constants
Diffstat (limited to 'doc/script_commands.txt')
-rw-r--r--doc/script_commands.txt62
1 files changed, 62 insertions, 0 deletions
diff --git a/doc/script_commands.txt b/doc/script_commands.txt
index b68ac5c64..894b3fc2f 100644
--- a/doc/script_commands.txt
+++ b/doc/script_commands.txt
@@ -7763,6 +7763,68 @@ scripts-atcommands this way.
---------------------------------------
+*can_use_command("<command>"{, <account id>})
+
+Checks if the attached or specified player can use the specified
+atcommand and returns true or false accordingly.
+
+---------------------------------------
+
+*has_permission(<permission>{, <account id>})
+*has_permission("<permission>"{, <account id>})
+
+Check if the attached or specified player has the specified permission
+and returns true or false accordingly. See doc/permissions.txt for
+details about permissions.
+
+Valid <permission> are:
+
+ PERM_TRADE
+ PERM_PARTY
+ PERM_ALL_SKILL
+ PERM_USE_ALL_EQUIPMENT
+ PERM_SKILL_UNCONDITIONAL
+ PERM_JOIN_ALL_CHAT
+ PERM_NO_CHAT_KICK
+ PERM_HIDE_SESSION
+ PERM_WHO_DISPLAY_AID
+ PERM_RECEIVE_HACK_INFO
+ PERM_WARP_ANYWHERE
+ PERM_VIEW_HPMETER
+ PERM_VIEW_EQUIPMENT
+ PERM_USE_CHECK
+ PERM_USE_CHANGEMAPTYPE
+ PERM_USE_ALL_COMMANDS
+ PERM_RECEIVE_REQUESTS
+ PERM_SHOW_BOSS
+ PERM_DISABLE_PVM
+ PERM_DISABLE_PVP
+ PERM_DISABLE_CMD_DEAD
+ PERM_HCHSYS_ADMIN
+ PERM_TRADE_BOUND
+ PERM_DISABLE_PICK_UP
+ PERM_DISABLE_STORE
+ PERM_DISABLE_EXP
+ PERM_DISABLE_SKILL_USAGE
+
+Example:
+
+ if (has_permission(PERM_WARP_ANYWHERE)) {
+ //do something
+ }
+
+It is also possible to pass a string for plugin permissions:
+
+ if (has_permission("show_version")) {
+ //do something
+ }
+
+** Passing a string is slower than passing a constant because
+ the engine has to loop through the array to find the permission.
+ In most cases you should use the PERM_ constants.
+
+---------------------------------------
+
*unitskilluseid(<GID>, <skill id>, <skill lvl>{, <target id>})
*unitskilluseid(<GID>, "<skill name>", <skill lvl>{, <target id>})
*unitskillusepos(<GID>, <skill id>, <skill lvl>, <x>, <y>)