Scripting/Squirrel/Functions/SetServerPassword: 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 "This function will set the server password. == Syntax == <pre>SetServerPassword( password )</pre> == Arguments == * ''string'' '''password''' - The password to set == Exa...")
 
Line 9: Line 9:
* ''string'' '''password''' - The password to set
* ''string'' '''password''' - The password to set


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


{{Scripting/Needs_Example}}
<source lang="squirrel">
function onPlayerCommand( player, cmd, text )
{
    if ( cmd == "setpass" )
    {
          SetServerPassword( text );
    }
}
</source>


=== Notes ===
=== Notes ===


The call [[Scripting/Squirrel/Events/Player/onPlayerCommand|onPlayerCommand]] was also used in the example. More info about this in the corresponding page.


== Related Functions ==
== Related Functions ==


{{Scripting/Squirrel/Functions/Server_Settings}}
{{Scripting/Squirrel/Functions/Server_Settings}}

Revision as of 08:59, 14 August 2014

This function will set the server password.

Syntax

SetServerPassword( password )

Arguments

  • string password - The password to set

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

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

Notes

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

Related Functions