Mam tu taki fragment skryptu po stronie klienta, który ustawia teksturę w konkretnym miejscu. Tekstura jest ustawiona, jednak kiedy postać zmienia położenie to zmienia się też kierunek tej tekstury. Czy wie ktoś jak ustawić żeby tekstura była ustawiona cały czas pozioma i skierowana w górę?
[code]-- Ustawienie pozycji tarczy
local targetPosition = {1290.50659, -1119.45020, 53.00852}
local targetTexture = nil
local isDrawingTarget = false
local targetBlip = nil
-- Funkcja rysująca poziomą teksturę
local function drawHorizontalTexture(x, y, z, texture, size)
local x1, y1, z1 = x - size, y, z
local x2, y2, z2 = x + size, y, z
dxDrawMaterialLine3D(x1, y1, z1, x2, y2, z2, texture, size * 2, tocolor(255, 255, 255, 255))
end
-- Funkcja do sprawdzenia, czy gracz jest w strefie tarczy
local function isPlayerInTargetZone()
local x, y, z = getElementPosition(localPlayer)
local tx, ty, tz = targetPosition[1], targetPosition[2], targetPosition[3]
local distance = getDistanceBetweenPoints3D(x, y, z, tx, ty, tz)
return distance <= 3
end
-- Funkcja do obsługi lądowania gracza
local function handlePlayerLanding()
if isDrawingTarget then
if isPlayerInTargetZone() then
-- Gracz wylądował w strefie tarczy
isDrawingTarget = false
if targetTexture then
destroyElement(targetTexture)
targetTexture = nil
end
if targetBlip then
... |