Squirrel/Server/Functions/Cheats/GetFlyingCars

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(Example)
Line 1: Line 1:
__NOTOC__
+
{{Squirrel/Title|GetFlyingCars}}
This function returns whether the flying cars cheat code (''chittychittybb'' in GTA III / ''comeflywithme'' in GTA:VC) has been activated.
+
This function returns whether the flying cars cheat code (''chittychittybb'' in GTA III / ''comeflywithme'' in GTA:VC) has been activated for a certain player or the server.
  
 
== Syntax ==
 
== Syntax ==
  
<code>bool GetFlyingCars()</code>
+
<code>bool GetFlyingCars( [ Player plr ] )</code>
  
 
== Arguments ==
 
== Arguments ==
  
* '''none'''
+
* '''plr''' - With this optional argument you can check the cheat status for an individual player. Without it the function will return the global server status
  
 
== Example ==
 
== Example ==
 +
 +
This command returns whether the flying cars cheat has been globally activated.
  
 
<code lang="squirrel">
 
<code lang="squirrel">
 
function onPlayerCommand( player, command, text )
 
function onPlayerCommand( player, command, text )
 
{
 
{
if ( command == "flyingcars" ) MessagePlayer( "Flying vehicles are currently set to " + GetFlyingCars(), player );
+
    if ( command == "flyingcars" ) MessagePlayer( "Flying vehicles are currently set to " + GetFlyingCars(), player );
 +
   
 +
    return 1;
 
}
 
}
 
</code>
 
</code>
Line 21: Line 25:
 
=== Notes ===
 
=== Notes ===
  
This function returns a simple true/false value.
+
The function [[Squirrel/Server/Functions/Messages/MessagePlayer|MessagePlayer]] and event [[Squirrel/Server/Events/Player/onPlayerCommand|onPlayerCommand]] were used in in this example. More info about them in the corresponding pages.
  
 
== Related Functions ==
 
== Related Functions ==
  
 
{{Squirrel/Server/Functions/Cheats}}
 
{{Squirrel/Server/Functions/Cheats}}

Revision as of 18:19, 24 September 2010

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

This function returns whether the flying cars cheat code (chittychittybb in GTA III / comeflywithme in GTA:VC) has been activated for a certain player or the server.

Syntax

  1. bool GetFlyingCars( [ Player plr ] )

Arguments

  • plr - With this optional argument you can check the cheat status for an individual player. Without it the function will return the global server status

Example

This command returns whether the flying cars cheat has been globally activated.

  1.  
  2. function onPlayerCommand( player, command, text )
  3. {
  4. if ( command == "flyingcars" ) MessagePlayer( "Flying vehicles are currently set to " + GetFlyingCars(), player );
  5. return 1;
  6. }
  7.  

Notes

The function MessagePlayer and event onPlayerCommand were used in in this example. More info about them in the corresponding pages.

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox