Witam ponownie, spotykam sie zn?w z kolejnym b??dem u?ywaj?c funkcji isElementWithinMarker.
[b]C-SIDE[/b]
[lua]
Marker = createMarker( 1871.1986083984, -1857.5452880859, 13.663543701172-0.9, 'cylinder', 2.0, 255, 0, 0, 150 )-- marker
function changeCarLightsColor( thePlayer )
outputChatBox ( "Aby zamontowa? swiat?a musisz u?y? jednej z poni?szych komend." )
outputChatBox ( "/swiatlared - Czerwone ?wiat?a", source )
outputChatBox ( "/swiatlaorange - Pomaranczowe ?wiat?a", source )
outputChatBox ( "/swiatlablue - Niebieskie ?wiat?a", source )
outputChatBox ( "/swiatlagreen - Zielone ?wiat?a", source )
end
addCommandHandler ("swiatla", changeCarLightsColor )
addEventHandler("onClientMarkerHit", Marker, function(el, md)
if not md or getElementType(el) ~= "player" then return end
if el ~= localPlayer then return end
outputChatBox ("Wpisz /swiatla aby ujrze? informacje, oraz cennik nt. monta?u ?wiate?", 250, 250, 250, true )
end)
function red( thePlayer )
if isElementWithinMarker(thePlayer, Marker) then
triggerServerEvent ("red", localPlayer, localPlayer)
end
end
addCommandHandler ("swiatlared", red)
function orange( thePlayer )
if isElementWithinMarker(thePlayer, Marker) then
triggerServerEvent ("orange", localPlayer, localPlayer)
end
end
addCommandHandler ("swiatlaorange", orange)