AmLotte.
Wiek: 21 Na forum: 2183 dni Posty: 134
Nick w MP: AmLotte
Piwa : 443
nie rozumiem dlaczego wyskakuje mi druga pozycja w tabeli w ka?dym markerze wejscie b?d? wyj?cie.. dawno nie bawi?em si? w lua wi?c zwracam si? o pomoc w tym dziale. z g?ry dzi?kuje i stawiam
Kod: local sx, sy = guiGetScreenSize()
local zoom = 1
if sx < 1920 then
zoom = math.min(2, 1920 / sx)
end
local table = { -- x,y,z pozcja w kt?rej wchodze, x2,y2,z2-- pozycja do kt?rej tepa, int - interior, dim - dimension
{"Urz?d miasta", -2242.76855, -405.89798, 50.86719, -2249.63696, -392.19766, 50.86719, 0,0, 1},
{"Szko?a jazdy", -2238.04126, -402.31439, 50.86719, -2243.21973, -389.35394, 50.86719, 0,0, 2},
}
local sxsy = {
{sx/2- (626/2)/zoom, sy/2- -251/zoom, 626/zoom, 181/zoom},
{sx / 2 - 480 / zoom, sy / 2 - -430 / zoom, 1350 / zoom + sx / 2 - 875 / zoom, 580 / zoom + sy / 2 - 280 / zoom},
{sx / 2 - 480 / zoom, sy / 2 - -335 / zoom, 1350 / zoom + sx / 2 - 875 / zoom, 580 / zoom + sy / 2 - 280 / zoom},
}
function createTexture(path)
return dxCreateTexture("files/grafy/"..path, "argb", true, "clamp")
end
local g = {
createTexture("bg.png"),
}
function interpulacja (w,a,r,t,o,s,c,x)
return interpolateBetween(w, a, r, t, o, s, c, x)
end
function createFont(name,scale)
return dxCreateFont(name, scale)
end
local font = {
createFont("files/fonts/czcionka.ttf", 27/zoom),
createFont("files/fonts/czcionka.ttf", 16/zoom),
}
for i,v in ipairs(table) do
local wejscie = createMarker(v[2],v[3],v[4]+1.1, "arrow", 1.3, 0,0,255,255)
local wyjscie = createMarker(v[5],v[6],v[7]+1.1, "arrow", 1.3, 0,0,255,255)
setElementInterior(wyjscie, v[8])
setElementDimension(wyjscie, v[9])
addEventHandler("onClientMarkerHit", wejscie, function (el,md)
if el ~= localPlayer and md then return end
addEventHandler("onClientRender", root, gui)
tick = getTickCount()
end)
addEventHandler("onClientMarkerHit", wyjscie, function (el,md)
if el ~= localPlayer and md then return end
addEventHandler("onClientRender", root, gui)
tick = getTickCount()
end)
function gui (el,md)
if el ~= localPlayer and md then return end
if i >= 0 and i <= 2 then
local int = interpulacja(330, 0, 0, 0, 0, 0, (getTickCount() - tick)/3000, 'OutQuad')
dxDrawImage(sxsy[1][1],sxsy[1][2]+int, sxsy[1][3], sxsy[1][4], g[1], 0,0,0)
dxDrawText("#3399ff'"..v[1].."'",sxsy[3][1],sxsy[3][2]+(int*2), sxsy[3][3],sxsy[3][4] , white, 1, font[1], 'center', 'center', false, false, true, true, false)
--if isElementWithinMarker(localPlayer, wejscie) then
dxDrawText("Aby wej?? do pomieszczenia naci?nij #3399ff'E'",sxsy[2][1],sxsy[2][2]+(int*2), sxsy[2][3],sxsy[2][4] , white, 1, font[2], 'center', 'center', false, false, true, true, false)
-- elseif isElementWithinMarker(localPlayer, wyjscie) then
-- dxDrawText("Aby wyj?? z pomieszczenia naci?nij #00ffb2'E'",sxsy[2][1],sxsy[2][2]+(int*2), sxsy[2][3],sxsy[2][4] , white, 1, font[2], 'center', 'center', false, false, true, true, false)
--end
end
end
end