Squirrel/Server/Functions/Vehicles/Wrecked

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
m (Forgot title)
(Example)
 
Line 12: Line 12:
 
== Example ==
 
== Example ==
  
-- Example explanation here
 
{{Squirrel/NeedsExample}}
 
 
<code lang="squirrel">
 
<code lang="squirrel">
-- todo
+
function onPlayerCommand( pPlayer, szCommand, szText )
 +
{
 +
if ( szCommand == "wrecked" )
 +
{
 +
local pVehicle = FindVehicle( 0 );
 +
if ( pVehicle ) MessagePlayer( "Vehicle ID (0) wrecked status is currently - " + pVehicle.Wrecked, pPlayer );
 +
}
 +
 +
return 1;
 +
}
 
</code>
 
</code>
  
 
=== Notes ===
 
=== Notes ===
  
--Example notes and used functions here.
+
The functions [[Squirrel/Server/Functions/Messages/MessagePlayer|MessagePlayer]] and [[Squirrel/Server/Functions/Vehicles/FindVehicle|FindVehicle]] and event [[Squirrel/Server/Events/Player/onPlayerCommand|onPlayerCommand]] were used in this example. More info about them in the corresponding pages.
  
 
== Related Functions ==
 
== Related Functions ==
  
 
{{Squirrel/Server/Functions/Vehicles}}
 
{{Squirrel/Server/Functions/Vehicles}}

Latest revision as of 17:46, 29 September 2010

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

This Vehicle class member returns whether the vehicle has been wrecked (aka. it has not yet respawned after its destruction).

[edit] Syntax

  1. bool Vehicle.Wrecked

[edit] Arguments

  • none

[edit] Example

  1.  
  2. function onPlayerCommand( pPlayer, szCommand, szText )
  3. {
  4. if ( szCommand == "wrecked" )
  5. {
  6. local pVehicle = FindVehicle( 0 );
  7. if ( pVehicle ) MessagePlayer( "Vehicle ID (0) wrecked status is currently - " + pVehicle.Wrecked, pPlayer );
  8. }
  9. return 1;
  10. }
  11.  

[edit] Notes

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

[edit] Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox