Squirrel/Server/Functions/Cheats/SetFlyingCars

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
Line 1: Line 1:
__NOTOC__
+
{{Squirrel/Title|SetFlyingCars}}
This function enables or disables the flying cars cheat code (''chittychittybb'' in GTA III / ''comeflywithme'' in GTA:VC).
+
This function enables or disables the flying cars cheat code (''chittychittybb'' in GTA III / ''comeflywithme'' in GTA:VC) for an individual player or the server globally.
  
 
== Syntax ==
 
== Syntax ==
 +
 +
''SetFlyingCars'' can take 2 different lists of parameters:
  
 
<code>bool SetFlyingCars( bool enabled )</code>
 
<code>bool SetFlyingCars( bool enabled )</code>
 +
<code>bool SetFlyingCars( 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 lobal status
  
 
== Example ==
 
== Example ==
  
This example enables the flying cars cheat if someone types '/flycars'.
+
This example enables the flying cars cheat globally if someone types '/flycars'.
  
 
<code lang="squirrel">
 
<code lang="squirrel">
 
function onPlayerCommand( player, command, text )
 
function onPlayerCommand( player, command, text )
 
{
 
{
if ( command == "flycars" ) SetFlyingCars( true );
+
    if ( command == "flycars" ) SetFlyingCars( true );
 +
   
 +
    return 1;
 
}
 
}
 
</code>
 
</code>

Revision as of 18:43, 24 September 2010

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

This function enables or disables the flying cars cheat code (chittychittybb in GTA III / comeflywithme in GTA:VC) for an individual player or the server globally.

Syntax

SetFlyingCars can take 2 different lists of parameters:

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

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 lobal status

Example

This example enables the flying cars cheat globally if someone types '/flycars'.

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

Notes

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

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox