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
mNo edit summary |
(Restructure) |
||
(One intermediate revision 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 == | |||
if( cmd == "heal" ) | <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.