WarpPedIntoVehicle: Difference between revisions
Jump to navigation
Jump to search
(New page: __NOTOC__ {{Server function}} This function is used to warp or force a ped into a vehicle. There are no animations involved when this happens. ==Syntax== <syntaxhighlight lang="lua"> bool warpPedIntoV...) |
|||
Line 20: | Line 20: | ||
==Example== | ==Example== | ||
This example creates a vehicle and warps a ped inside immediately | This example creates a vehicle and warps a ped inside immediately. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function | function setupForRace ( ) | ||
local | local RacerPed = createPed ( 252, 0, 0, 3 ) | ||
warpPedIntoVehicle ( | local RaceVehicle = createVehicle ( 411, 4, 0, 3 ) -- create a vehicle. | ||
warpPedIntoVehicle ( RacerPed, RaceVehicle ) -- warp the ped straight into the vehicle | |||
end | end | ||
addCommandHandler ( "startrace", | addCommandHandler ( "startrace", setupForRace ) -- add a command to start race | ||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | ==See Also== | ||
{{Ped functions}} | {{Ped functions}} |
Revision as of 09:55, 3 June 2008
This function is used to warp or force a ped into a vehicle. There are no animations involved when this happens.
Syntax
bool warpPedIntoVehicle ( ped thePed, vehicle theVehicle, [ int seat=0 ] )
Required Arguments
- thePed: The ped which you wish to force inside the vehicle
- theVehicle: The vehicle you wish to force the ped 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 ped inside immediately.
function setupForRace ( ) local RacerPed = createPed ( 252, 0, 0, 3 ) local RaceVehicle = createVehicle ( 411, 4, 0, 3 ) -- create a vehicle. warpPedIntoVehicle ( RacerPed, RaceVehicle ) -- warp the ped straight into the vehicle end addCommandHandler ( "startrace", setupForRace ) -- add a command to start race
See Also
- addPedClothes
- getPedClothes
- removePedClothes
- createPed
- getPedAmmoInClip
- getPedArmor
- getPedFightingStyle
- getPedOccupiedVehicle
- getPedOccupiedVehicleSeat
- getPedStat
- getPedTarget
- getPedTotalAmmo
- getPedWalkingStyle
- getPedWeapon
- getPedWeaponSlot
- getPedContactElement
- getValidPedModels
- isPedChoking
- isPedDead
- isPedDoingGangDriveby
- isPedDucked
- isPedHeadless
- isPedInVehicle
- isPedOnFire
- isPedOnGround
- isPedWearingJetpack
- killPed
- removePedFromVehicle
- setPedAnimation
- setPedAnimationProgress
- setPedAnimationSpeed
- setPedArmor
- setPedDoingGangDriveby
- setPedFightingStyle
- setPedHeadless
- setPedOnFire
- setPedStat
- setPedWalkingStyle
- setPedWeaponSlot
- warpPedIntoVehicle