WarpPlayerIntoVehicle: Difference between revisions
Jump to navigation
Jump to search
m (WarpPlayerintoVehicle moved to WarpPlayerIntoVehicle) |
(Deprecated function) |
||
(7 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Server function}} | |||
{{Deprecated|warpPedIntoVehicle}} | |||
This function is used to warp or force a player into a vehicle. There are no animations involved when this happens. | This function is used to warp or force a player into a vehicle. There are no animations involved when this happens. | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
bool | bool warpPlayerIntoVehicle ( player thePlayer, vehicle theVehicle, [ int seat=0 ] ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
===Required Arguments=== | ===Required Arguments=== | ||
*''' | *'''thePlayer:''' The player which you wish to force inside the vehicle | ||
*''' | *'''theVehicle:''' The vehicle you wish to force the player into | ||
===Optional Arguments=== | ===Optional Arguments=== | ||
{{OptionalArg}} | {{OptionalArg}} | ||
*'''seat:''' An integer representing the seat ID. ''0'' represents the driver, any higher represent passenger seats | *'''seat:''' An integer representing the seat ID. ''0'' represents the driver, any higher represent passenger seats. | ||
===Returns=== | ===Returns=== | ||
Line 21: | Line 24: | ||
This example creates a vehicle and warps a player inside immediately | This example creates a vehicle and warps a player inside immediately | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function createstartvehicles ( playerSource, commandName, car, x, y, z ) -- the function allows specification of your car, and the position | |||
function createstartvehicles ( playerSource, commandName, car, x, y, z ) --the function allows specification of your car, and the position | local racevehicle = createVehicle ( car, x, y, z ) -- create a vehicle at the position specified by the startrace command | ||
racevehicle = createVehicle ( car, x, y, z ) --create a vehicle at | warpPlayerIntoVehicle ( playerSource, racevehicle ) -- warp them straight into the vehicle | ||
end | end | ||
addCommandHandler ( "startrace", createstartvehicles ) -- add a command to start race | |||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | ==See Also== | ||
{{Player functions}} | {{Player functions}} |
Latest revision as of 17:42, 16 October 2016
This function is deprecated. This means that its use is discouraged and that it might not exist in future versions. | |
Please use warpPedIntoVehicle instead. |
This function is used to warp or force a player into a vehicle. There are no animations involved when this happens.
Syntax
bool warpPlayerIntoVehicle ( player thePlayer, vehicle theVehicle, [ int seat=0 ] )
Required Arguments
- thePlayer: The player which you wish to force inside the vehicle
- theVehicle: The vehicle you wish to force the player into
Optional Arguments
NOTE: When using optional arguments, you might need to supply all arguments before the one you wish to use. For more information on optional arguments, see optional arguments.
- seat: An integer representing the seat ID. 0 represents the driver, any higher represent passenger seats.
Returns
Returns true if the operation is successful, false otherwise.
Example
This example creates a vehicle and warps a player inside immediately
function createstartvehicles ( playerSource, commandName, car, x, y, z ) -- the function allows specification of your car, and the position local racevehicle = createVehicle ( car, x, y, z ) -- create a vehicle at the position specified by the startrace command warpPlayerIntoVehicle ( playerSource, racevehicle ) -- warp them straight into the vehicle end addCommandHandler ( "startrace", createstartvehicles ) -- add a command to start race
See Also
- getPlayerTeam
- getPlayerBlurLevel
- setPlayerBlurLevel
- getPlayerSerial
- forcePlayerMap
- getPlayerScriptDebugLevel
- getPlayerFromName
- getPlayerMoney
- getPlayerName
- getPlayerNametagColor
- getPlayerNametagText
- getPlayerPing
- getPlayerWantedLevel
- givePlayerMoney
- isPlayerMapForced
- isPlayerNametagShowing
- setPlayerHudComponentVisible
- setPlayerMoney
- setPlayerNametagColor
- setPlayerNametagShowing
- setPlayerNametagText
- takePlayerMoney
- countPlayersInTeam
- getPlayersInTeam
- isVoiceEnabled
- setControlState
- getControlState