OnPlayerEnterVehicle: Difference between revisions

From Vice City Multiplayer
Jump to navigation Jump to search
Caution icon
This wiki is using an old backup from 2020
Some information may be old/missing
(Created page with "This is called when a player enters any Vehicle. == Syntax == function onPlayerEnterVehicle( player, vehicle, door ) == Example == <source lang="squirrel"> function onPlay...")
 
No edit summary
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
This is called when a player enters any Vehicle.
This event is called when a player enters a Vehicle.


== Syntax ==
== Syntax ==
function onPlayerEnterVehicle( player, vehicle, door )
<pre>onPlayerEnterVehicle( player, vehicle, door )</pre>


== Arguments ==
* ''CPlayer'' '''player''' - The player instance, or the one who is trying to enter.
* ''CVehicle'' '''vehicle''' - The vehicle instance, or the vehicle which is being entered by the player.
* ''int'' '''door''' - The door in which the player is entering, i.e, 0 for driver, 1 for passenger.


== Example ==  
== Example ==  
Line 9: Line 13:
function onPlayerEnterVehicle( player, vehicle, door )
function onPlayerEnterVehicle( player, vehicle, door )
{
{
ClientMessage("You Have Entered "+GetVehicleNameFromModel( vehicle.Model )+".",player,0,205,0);
Message( player.Name + " has Entered "+GetVehicleNameFromModel( vehicle.Model ) + "." );
}
}
</source>
</source>
== Related Functions ==
{{Scripting/Squirrel/Events/Vehicle_Events}}
[[Category:Scripting/Squirrel/Events/Vehicle_Events]]

Latest revision as of 22:21, 30 January 2017

This event is called when a player enters a Vehicle.

Syntax

onPlayerEnterVehicle( player, vehicle, door )

Arguments

  • CPlayer player - The player instance, or the one who is trying to enter.
  • CVehicle vehicle - The vehicle instance, or the vehicle which is being entered by the player.
  • int door - The door in which the player is entering, i.e, 0 for driver, 1 for passenger.

Example

function onPlayerEnterVehicle( player, vehicle, door )
{
Message( player.Name + " has Entered "+GetVehicleNameFromModel( vehicle.Model ) + "." );
}

Related Functions