Squirrel/Server/Functions/Server/SetServerRule

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(Created page with '{{Squirrel/Title|SetServerRule}} Sets a custom server rule visible in the server browser. == Syntax == <code>bool SetServerRule( string ruleName, string ruleValue )</code> == …')
 
m (Redirect issue fix)
 
Line 31: Line 31:
 
== Related Functions ==
 
== Related Functions ==
  
{{Squirrel/Functions/Server}}
+
{{Squirrel/Server/Functions/Server}}

Latest revision as of 18:34, 15 January 2012

Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

Sets a custom server rule visible in the server browser.

[edit] Syntax

  1. bool SetServerRule( string ruleName, string ruleValue )

[edit] Arguments

  • ruleName - The name of the rule you want to set
  • ruleValue - The value of the custom rule

[edit] Example

This example will make a custom server rule when someone types '/testrule'

  1.  
  2. function onPlayerCommand( id, cmd, text )
  3. {
  4. if ( cmd == "testrule" )
  5. {
  6. SetServerRule("Test Rule", "Test Value");
  7. }
  8. }
  9.  

[edit] Notes

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

[edit] Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox