Squirrel/Functions/Server/SetPassword

From VC-MP Wiki

Jump to: navigation, search

This will change the password required to connect the server and lock the server, or unlock if no parameters/a null parameter is given.

Syntax

bool SetPassword( string pass )

Arguments

  • pass - The new password needed to join the server

Example

This command will change the server password when a player types '/c setpass ubersecret'.

function onPlayerCommand( player, cmd, text )
{
     if ( cmd == "setpass" )
     {
          SetPassword( text );
     }
}

Notes

The call onPlayerCommand was also used in the example. More info about this in the corresponding page.

Related Functions

squirrel scripting