Scripting/Squirrel/Functions/Player.StandingOnVehicle

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

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.