GetPedTargetCollision: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
(Replace to predefined variables.) |
||
(One intermediate revision by one other user not shown) | |||
Line 19: | Line 19: | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function drawline() | function drawline() | ||
local x, y, z = getPedTargetStart(localPlayer) -- Gets the Point to start From. | |||
if (x) then -- Checks if there is a Point to start From. | |||
local sx, sy, sz = getPedTargetCollision(localPlayer) -- Gets the Point where the Targets Collision is. | |||
local sx,sy,sz = getPedTargetCollision(localPlayer) -- Gets the Point where the Targets Collision is. | dxDrawLine3D(x, y, z, sx, sy, sz) -- Draws the Line | ||
dxDrawLine3D(x,y,z,sx,sy,sz) -- Draws the Line | |||
end | end | ||
end | end | ||
addEventHandler("onClientPreRender", | addEventHandler("onClientPreRender", root, drawline) -- Adds the Handler. | ||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | ==See Also== | ||
{{Client_ped_functions}} | {{Client_ped_functions}} |
Latest revision as of 11:12, 21 July 2023
This function allows retrieval of where a ped's target is blocked. It will only be blocked if there is an obstacle within a ped's target range.
Syntax
float float float getPedTargetCollision ( ped targetingPed )
Required Arguments
- targetingPed: This is the ped whose target collision you wish to retrieve
Returns
Returns three floats, x,y,z, representing the position where the ped's target collides, or false if it was unsuccessful.
Example
This Example draws a line from where the Ped´s Target Starts to the Point where the Targets Collision is.
function drawline() local x, y, z = getPedTargetStart(localPlayer) -- Gets the Point to start From. if (x) then -- Checks if there is a Point to start From. local sx, sy, sz = getPedTargetCollision(localPlayer) -- Gets the Point where the Targets Collision is. dxDrawLine3D(x, y, z, sx, sy, sz) -- Draws the Line end end addEventHandler("onClientPreRender", root, drawline) -- Adds the Handler.
See Also
- canPedBeKnockedOffBike
- getPedAnalogControlState
- getPedAnimation
- getPedBonePosition
- getPedCameraRotation
- getPedControlState
- getPedMoveState
- getPedOxygenLevel
- getPedSimplestTask
- getPedTargetCollision
- getPedTargetEnd
- getPedTargetStart
- getPedTask
- getPedVoice
- getPedWeaponMuzzlePosition
- givePedWeapon
- isPedBleeding
- isPedDoingTask
- isPedReloadingWeapon
- isPedTargetingMarkerEnabled
- setAnalogControlState
- setPedAimTarget
- setPedAnalogControlState
- setPedBleeding
- setPedCameraRotation
- setPedCanBeKnockedOffBike
- setPedControlState
- setPedEnterVehicle
- setPedExitVehicle
- IsPedFootBloodEnabled
- setPedFootBloodEnabled
- setPedLookAt
- setPedOxygenLevel
- setPedTargetingMarkerEnabled
- setPedVoice
- Shared
- 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