Squirrel/Server/Functions/Cheats/SetFlyingCars
From Liberty Unleashed Wiki
(Difference between revisions)
Line 1: | Line 1: | ||
− | + | {{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 ); | |
+ | |||
+ | return 1; | ||
} | } | ||
</code> | </code> |
Revision as of 18:43, 24 September 2010
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:
bool SetFlyingCars( bool enabled )
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'.
function onPlayerCommand( player, command, text ) { if ( command == "flycars" ) SetFlyingCars( true ); return 1; }
Notes
The event onPlayerCommand was used in in this example. More info about it in the corresponding page.
Related Functions
- GetFlyingCars
- GetHandlingCheat
- SetFlyingCars
- SetHandlingCheat