Scripting/Squirrel/Functions/Player.Admin: Difference between revisions
Jump to navigation
Jump to search
This wiki is using an old backup from 2020
Some information may be old/missing
(Created page with "== Syntax == *''Set's player as admin'' <pre>Player.Admin Player.Admin = true (1) / false (0)</pre> == Description == <pre> This function is just a variable. There are no b...") |
(Restructure) |
||
(2 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
This function is just a variable. | |||
There are no built-in commands for admins, like they used to be in earlier versions. | |||
== Syntax == | == Syntax == | ||
<source lang="squirrel"> | |||
Player.Admin; | |||
Player.Admin = toggle; | |||
</source> | |||
*'' | == Arguments == | ||
* ''bool'' '''toggle''' Set Admin true/false | |||
== | == Example == | ||
< | <source lang="squirrel"> | ||
function onPlayerCommand(cmd, args, player) { | |||
if (cmd == "heal") { | |||
</ | if(player.Admin) { | ||
player.Health = 100; | |||
} | |||
} | |||
} | |||
</source> | |||
=== Notes === | |||
Call [[onPlayerCommand]] was used in this example. | |||
== Related Functions == | == Related Functions == |
Latest revision as of 10:59, 26 April 2019
This function is just a variable. There are no built-in commands for admins, like they used to be in earlier versions.
Syntax
Player.Admin;
Player.Admin = toggle;
Arguments
- bool toggle Set Admin true/false
Example
function onPlayerCommand(cmd, args, player) {
if (cmd == "heal") {
if(player.Admin) {
player.Health = 100;
}
}
}
Notes
Call onPlayerCommand was used in this example.