Scripting/Squirrel/Functions/Player.Admin: Difference between revisions

From Vice City Multiplayer
Jump to navigation Jump to search
Caution icon
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>


*''Set's player as admin''
== Arguments ==
<pre>Player.Admin
* ''bool'' '''toggle''' Set Admin true/false
Player.Admin = true (1) / false (0)</pre>


== Description ==
== Example ==
<pre>
<source lang="squirrel">
This function is just a variable.  
function onPlayerCommand(cmd, args, player) {
There are no built-in commands for admins, like they used to be in earlier versions.
  if (cmd == "heal") {
</pre>
    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.

Related Functions