Squirrel/Functions/Server/GetPassword

From VC-MP Wiki

Jump to: navigation, search

This returns the password needed to join the server, or 'none' if no password has been set.

Syntax

string GetPassword()

Arguments

  • None

Example

This command will return the server password when someone types '/c serverpass'.

function onPlayerCommand( player, cmd, text )
{
     if ( cmd == "serverpass" )
     {
          MessagePlayer( "Server password is: " + GetPassword(), player );
     }
}

Notes

The function MessagePlayer and call onPlayerCommand were used in in this example. More info about them in corresponding pages.

Related Functions

squirrel scripting