Lua
local ABSArea = createColRectangle ( -1892, -858.5, 32 , 150 )
function ABS_Enter ( thePlayer, matchingDimension )
if getElementType ( thePlayer ) == "player" then
local abs_veh = getPedOccupiedVehicle(player)
if abs_veh ~= false then
for i, abs_veh in pairs( getElementsByType("vehicle") ) do
if vioGetElementData ( abs_veh, "owner" ) == getPlayerName ( player ) and getElementData(abs_veh, "towed") then
local arrowMarker = createMarker ( 0, 0, 0, "arrow", .75, 0, 0, 255, 170 )
attachElements ( arrowMarker, abs_veh, 0, 0, 3 )
end
end
end
end
end
addEventHandler ( "onColShapeHit", ABSArea, ABS_Enter )
function ABS_Exit ( thePlayer, matchingDimension )
if getElementType ( thePlayer ) == "player" then
if isPedDead ( thePlayer ) ~= true then
if vioGetElementData ( abs_veh, "owner" ) == getPlayerName ( player ) and getElementData(abs_veh, "towed") then
for i, abs_veh in pairs( getElementsByType("vehicle") ) do
if getElementData(abs_veh, "towed") then
detachElements ( arrowMarker )
end
end
end
end
end
end
addEventHandler ( "onColShapeLeave", ABSArea, ABS_Exit )
Alles anzeigen
beim verlassen der ABSArea wird der Pfeil nicht gelöscht, und nur manchmal geht das mit dem verlassen, was mache ich falsch?
Danke im vorraus.
MfG: Jan