Squirrel/Server/Functions/Vehicles/PassengerCount

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(Created page with '{{Squirrel/Title|Vehicle.PassengerCount}} This ''Vehicle'' class member returns the passenger count of the vehicle. == Syntax == <code>int Vehicle.PassengerCount</code> == Arg…')
 
(Example)
Line 12: Line 12:
 
== Example ==
 
== Example ==
  
{{Squirrel/NeedsExample}}
 
 
<code lang="squirrel">
 
<code lang="squirrel">
-- todo
+
function onPlayerCommand( pPlayer, szCommand, szText )
 +
{
 +
if ( szCommand == "passengers" )
 +
{
 +
if ( pPlayer.Vehicle ) MessagePlayer( "Vehicle passenger count is " + pPlayer.Vehicle.PassengerCount, pPlayer );
 +
}
 +
 
 +
return 1;
 +
}
 
</code>
 
</code>
  

Revision as of 17:29, 29 September 2010

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

This Vehicle class member returns the passenger count of the vehicle.

Syntax

  1. int Vehicle.PassengerCount

Arguments

  • none

Example

  1.  
  2. function onPlayerCommand( pPlayer, szCommand, szText )
  3. {
  4. if ( szCommand == "passengers" )
  5. {
  6. if ( pPlayer.Vehicle ) MessagePlayer( "Vehicle passenger count is " + pPlayer.Vehicle.PassengerCount, pPlayer );
  7. }
  8.  
  9. return 1;
  10. }
  11.  

Notes

Example notes and used functions here.

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox