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
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>


*''Sets player as admin''
== Arguments ==
<pre>Player.Admin
* ''bool'' '''toggle''' Set Admin true/false
Player.Admin = true (1) / false (0)</pre>
 
== Description ==
<pre>
This function is just a variable.
There are no built-in commands for admins, like they used to be in earlier versions.


So you can make a player admin, then create command for him, like:
== Example ==
if( cmd == "heal" )
<source lang="squirrel">
{
function onPlayerCommand(cmd, args, player) {
    if( player.Admin )
  if (cmd == "heal") {
    {
    if(player.Admin) {
          player.Health = 100;
      player.Health = 100;
    }
    }
  }
}
}
</pre>
</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