getPedTargetEnd
Client-side
Server-side
Shared
Manual Review Required
Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.
This function allows retrieval of the position where a ped's target range ends, when he is aiming with a weapon.
OOP Syntax Help! I don't understand this!
- Method:ped:getTargetEnd(...)
Syntax
float float float getPedTargetEnd ( ped targetingPed )Required Arguments
- targetingPed: the ped who is targeting whose target end you wish to retrieve
Returns
- float float float: value
Returns three floats, x , y , z , representing the position where the ped's target ends according to his range, or false if it was unsuccessful.
Code Examples
shared
This Example draws a line from where the Ped´s Target Starts to the Point where the Target Ends
addEventHandler("onClientPreRender", root, -- Adds the Handler function () if getPedTargetStart(localPlayer) then --Checks if there is a Point to start From.
local x, y, z = getPedTargetStart(localPlayer) -- Gets the Point to start From local sx, sy, sz = getPedTargetEnd(localPlayer) -- Gets the Point where the Target Ends
dxDrawLine3D(x, y, z, sx, sy, sz) -- Draws the Line endend)See Also
Ped Functions
- addPedClothes
- canPedBeKnockedOffBike
- createPed
- getPedAmmoInClip
- getPedAnalogControlState
- getPedAnimation
- getPedArmor
- getPedBonePosition
- getPedCameraRotation
- getPedClothes
- getPedContactElement
- getPedControlState
- getPedFightingStyle
- getPedGravity
- getPedMoveState
- getPedOccupiedVehicle
- getPedOccupiedVehicleSeat
- getPedOxygenLevel
- getPedSimplestTask
- getPedStat
- getPedTarget
- getPedTargetCollision
- getPedTargetEnd
- getPedTargetStart
- getPedTask
- getPedTotalAmmo
- getPedVoice
- getPedWalkingStyle
- getPedWeapon
- getPedWeaponMuzzlePosition
- getPedWeaponSlot
- getValidPedModels
- givePedWeapon
- isPedBleeding
- isPedChoking
- isPedDead
- isPedDoingGangDriveby
- isPedDoingTask
- isPedDucked
- IsPedFootBloodEnabled
- isPedHeadless
- isPedInVehicle
- isPedOnGround
- isPedReloadingWeapon
- isPedTargetingMarkerEnabled
- isPedWearingJetpack
- killPed
- playPedVoiceLine
- reloadPedWeapon
- removePedClothes
- removePedFromVehicle
- resetPedVoice
- setPedAimTarget
- setPedAnalogControlState
- setPedAnimation
- setPedAnimationProgress
- setPedAnimationSpeed
- setPedArmor
- setPedBleeding
- setPedCameraRotation
- setPedCanBeKnockedOffBike
- setPedChoking
- setPedControlState
- setPedDoingGangDriveby
- setPedEnterVehicle
- setPedExitVehicle
- setPedFightingStyle
- setPedFootBloodEnabled
- setPedGravity
- setPedHeadless
- setPedLookAt
- setPedOxygenLevel
- setPedStat
- setPedTargetingMarkerEnabled
- setPedVoice
- setPedWalkingStyle
- setPedWeaponSlot
- setPedWearingJetpack
- warpPedIntoVehicle