Scripting/Squirrel/Functions/Player.StandingOnVehicle: 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 "== Syntax == *'''Returns the instance of the vehicle player is standing on.''' <pre>player.StandingOnVehicle</pre> == Description == This function will return the instance...")
 
mNo edit summary
 
Line 1: Line 1:
== Syntax ==
== Syntax ==
*'''Returns the instance of the vehicle player is standing on.'''
<pre>player.StandingOnVehicle</pre>
<pre>player.StandingOnVehicle</pre>



Latest revision as of 13:43, 12 December 2018

Syntax

player.StandingOnVehicle

Description

This function will return the instance of the vehicle player is standing on.

Example

function onPlayerCommand( player, cmd, text )
{
    if( cmd == "model" )
    {
        local veh = player.StandingOnVehicle;
        if( veh ) return MessagePlayer( "The vehicle model you are standing on: " + GetVehicleNameFromModel( veh.Model ), player );
        else return MessagePlayer( "There is no vehicle under your feet.", player );
    }
}

Notes

Call onPlayerCommand were used in this example. More info about them in the corresponding pages.

Related Functions

Player Game Functions

These functions exist for compatibility with the R2 Squirrel server.