getPedTargetCollision | Multi Theft Auto: Wiki Skip to content

getPedTargetCollision

Client-side
Server-side
Shared

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


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

getPedTargetCollision ( )

Code Examples

client

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