Squirrel/Server/Functions/Cheats/SetHandlingCheat

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
 
Line 1: Line 1:
__NOTOC__
+
{{Squirrel/Title|SetHandlingCheat}}
This function enables or disables the improved handling cheat code (''cornerslikemad'' in GTA III / ''gripiseverything'' in GTA:VC).
+
This function enables or disables the improved handling cheat code (''cornerslikemad'' in GTA III / ''gripiseverything'' in GTA:VC) for an individual player or the server globally.
  
 
== Syntax ==
 
== Syntax ==
  
 
<code>bool SetHandlingCheat( bool enabled )</code>
 
<code>bool SetHandlingCheat( bool enabled )</code>
 +
<code>bool SetHandlingCheat( Player plr, bool enabled )</code>
  
 
== Arguments ==
 
== Arguments ==
  
 
* '''enabled''' - A boolean to either enable (true) or disable (false) this cheat code
 
* '''enabled''' - A boolean to either enable (true) or disable (false) this cheat code
 +
* '''plr''' - The player to enable/disable this cheat code for. Without this argument the function will change the global status
  
 
== Example ==
 
== Example ==
  
This example enables the handling cheat if someone types '/handlinghax'.
+
This example enables the handling cheat globally if someone types '/handlinghax'.
  
 
<code lang="squirrel">
 
<code lang="squirrel">
 
function onPlayerCommand( player, command, text )
 
function onPlayerCommand( player, command, text )
 
{
 
{
if ( command == "handlinghax" ) SetHandlingCheat( true );
+
    if ( command == "handlinghax" ) SetHandlingCheat( true );
 +
   
 +
    return 1;
 
}
 
}
 
</code>
 
</code>

Latest revision as of 18:48, 24 September 2010

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

This function enables or disables the improved handling cheat code (cornerslikemad in GTA III / gripiseverything in GTA:VC) for an individual player or the server globally.

[edit] Syntax

  1. bool SetHandlingCheat( bool enabled )
  1. bool SetHandlingCheat( Player plr, bool enabled )

[edit] Arguments

  • enabled - A boolean to either enable (true) or disable (false) this cheat code
  • plr - The player to enable/disable this cheat code for. Without this argument the function will change the global status

[edit] Example

This example enables the handling cheat globally if someone types '/handlinghax'.

  1.  
  2. function onPlayerCommand( player, command, text )
  3. {
  4. if ( command == "handlinghax" ) SetHandlingCheat( true );
  5. return 1;
  6. }
  7.  

[edit] Notes

The event onPlayerCommand was used in in this example. More info about it in the corresponding page.

[edit] Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox