Squirrel/Server/Functions/Vehicles/SetWheelStatus

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(Example)
Line 15: Line 15:
 
== Example ==
 
== Example ==
  
{{Squirrel/NeedsExample}}
 
 
<code lang="squirrel">
 
<code lang="squirrel">
-- todo
+
function onPlayerCommand( pPlayer, szCommand, szText )
 +
{
 +
if ( szCommand == "setwheel" )
 +
{
 +
if ( pPlayer.Vehicle ) pPlayer.Vehicle.SetWheelStatus( WHEEL_FRONTLEFT, WHEELSTATUS_FLAT );
 +
}
 +
 +
return 1;
 +
}
 
</code>
 
</code>
  
 
=== Notes ===
 
=== Notes ===
  
Example notes and used functions here.
+
The event [[Squirrel/Server/Events/Player/onPlayerCommand|onPlayerCommand]] was used in this example. More info about this in the corresponding page.
  
 
== Related Functions ==
 
== Related Functions ==
  
 
{{Squirrel/Server/Functions/Vehicles}}
 
{{Squirrel/Server/Functions/Vehicles}}

Revision as of 17:36, 29 September 2010

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

This Vehicle class method will set the status of the given wheel.

Syntax

  1. bool Vehicle.SetWheelStatus( int wheel, int status )

Arguments

  • wheel - The wheel you wish to set the status of. A list of vehicle wheel constants can be found from here
  • status - The status code of the wheel:
    • WHEELSTATUS_OK - The wheel is fine
    • WHEELSTATUS_FLAT - Flat tyre
    • WHEELSTATUS_FUCKED - Completely missing a wheel

Example

  1.  
  2. function onPlayerCommand( pPlayer, szCommand, szText )
  3. {
  4. if ( szCommand == "setwheel" )
  5. {
  6. if ( pPlayer.Vehicle ) pPlayer.Vehicle.SetWheelStatus( WHEEL_FRONTLEFT, WHEELSTATUS_FLAT );
  7. }
  8. return 1;
  9. }
  10.  

Notes

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

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox