Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local sx, sy = guiGetScreenSize()
- local font = dxCreateFont("cz.ttf", 15)
- local przebiera = false
- local aktualnySkin = 1
- local rodzaj = 1
- local wisniackie = {0, 1, 2}
- local prestiz = {7, 9, 10}
- local lump = {11, 12, 13, 4, 3, 2, 1, 7, 6, 19, 21, 22, 23, 28, 29, 30, 37, 38, 36, 47, 53, 60, 65, 68, 69, 94, 98, 101, 180, 184, 188, 195, 211, 222, 225, 226, 223, 245, 250, 259, 297, }
- local przebieralnie = {
- -- marker, ped, rotp, int, dim, typ(1-3), cameramatrix
- {207.08, -129.50, 1003.51, 199.80, -126.70, 1003.52, 131, 3, 0, 3, 198.04209899902, -128.55949401855, 1004.9876098633, 198.66702270508, -127.90451812744, 1004.5627441406},
- {2291.58, -1715.72, 17.67, 2286.23, -1716.86, 17.67, 270, 0, 1, 3, 2289.5336914063, -1716.9119873047, 18.923700332642, 2288.5798339844, -1716.9051513672, 18.623567581177},
- }
- for i, v in ipairs(przebieralnie) do
- marker = createMarker(v[1], v[2], v[3]-.95, "cylinder", 1, 255, 255, 255)
- --setElementData(marker, "pedx", v[4])
- --setElementData(marker, "pedy", v[5])
- --setElementData(marker, "pedz", v[6])
- setElementData(marker, "pedxyz", v[4]..","..v[5]..","..v[6])
- setElementData(marker, "pedr", v[7])
- setElementData(marker, "int", v[8])
- setElementData(marker, "dim", v[9])
- setElementData(marker, "typ", v[10])
- setElementData(marker, "camxyz", v[11]..","..v[12]..","..v[13]..","..v[14]..","..v[15]..","..v[16]) -- dodać
- setElementInterior(marker, v[8])
- setElementDimension(marker, v[9])
- addEventHandler("onClientMarkerHit", marker, function(gracz)
- if gracz ~= localPlayer then return end
- local kordy = split(getElementData(source, "pedxyz"), ",")
- local cam = split(getElementData(source, "camxyz"), ",")
- ped = createPed(0, kordy[1], kordy[2], kordy[3], getElementData(source, "pedr"))
- setElementDimension(ped, getElementData(source, "dim"))
- setElementInterior(ped, getElementData(source, "int"))
- setCameraMatrix(cam[1], cam[2], cam[3], cam[4], cam[5], cam[6])
- addEventHandler("onClientRender", root, gui)
- przebiera = true
- rodzaj = getElementData(source, "typ")
- setElementFrozen(localPlayer, true)
- setElementData(localPlayer, "hud", true)
- showChat(false)
- triggerEvent("radar:onClientHudComponent", localPlayer, "radar", false)
- end)
- end
- function gui()
- dxDrawText("Backspace - opuszczenie przebieralni\nStrzalka w prawo - nastepny skin\nStrzalka w lewo - wczesniejszy skin\nEnter - akceptacja wyboru", scale_x(37), scale_y(32), scale_x(529), scale_y(289), tocolor(0, 0, 0, 255), 1.00, font, "left", "top", false, false, false, false, false)
- dxDrawText("#1ab185Backspace#ffffff - opuszczenie przebieralni\n#1ab185Strzalka w prawo#ffffff - nastepny skin\n#1ab185Strzalka w lewo#ffffff - wczesniejszy skin\n#1ab185Enter#ffffff - akceptacja wyboru", scale_x(36), scale_y(31), scale_x(528), scale_y(288), tocolor(255, 255, 255, 255), 1.00, font, "left", "top", false, false, false, true, false)
- end
- bindKey("enter", "down", function()
- if przebiera == false then return end
- exports["np-notyfikacje"]:noti("Zmieniono skin.")
- triggerServerEvent("zapiszSkin:przebieralnia", resourceRoot, localPlayer, getElementModel(ped))
- destroyElement(ped)
- aktualnySkin = 1
- przebiera = false
- setElementFrozen(localPlayer, false)
- setCameraTarget(localPlayer)
- removeEventHandler("onClientRender", root, gui)
- setElementData(localPlayer, "hud", false)
- showChat(true)
- triggerEvent("radar:onClientHudComponent", localPlayer, "radar", true)
- end)
- bindKey("backspace", "down", function()
- if przebiera == false then return end
- exports["np-notyfikacje"]:noti("Opuszczono przebieralnie.")
- destroyElement(ped)
- aktualnySkin = 1
- przebiera = false
- setElementFrozen(localPlayer, false)
- setCameraTarget(localPlayer)
- removeEventHandler("onClientRender", root, gui)
- setElementData(localPlayer, "hud", false)
- showChat(true)
- triggerEvent("radar:onClientHudComponent", localPlayer, "radar", true)
- end)
- bindKey("arrow_l", "both", function(k, s)
- if s ~= "down" then return end
- if przebiera == false then return end
- if aktualnySkin == 1 then return end
- aktualnySkin = aktualnySkin-1
- if rodzaj == 1 then
- setElementModel(ped, wisniackie[aktualnySkin])
- elseif rodzaj == 2 then
- setElementModel(ped, prestiz[aktualnySkin])
- elseif rodzaj == 3 then
- setElementModel(ped, lump[aktualnySkin])
- end
- end)
- bindKey("arrow_r", "both", function(k, s)
- if s ~= "down" then return end
- if przebiera == false then return end
- if rodzaj == 1 and aktualnySkin < #wiesniackie then
- aktualnySkin = aktualnySkin+1
- setElementModel(ped, wisniackie[aktualnySkin])
- elseif rodzaj == 2 and aktualnySkin < #prestiz then
- aktualnySkin = aktualnySkin+1
- setElementModel(ped, prestiz[aktualnySkin])
- elseif rodzaj == 3 and aktualnySkin < #lump then
- aktualnySkin = aktualnySkin+1
- setElementModel(ped, lump[aktualnySkin])
- end
- end)
- function scale_x(value)
- local result = (value / 1440) * sx
- return result
- end
- function scale_y(value)
- local result = (value / 900) * sy
- return result
- end
- function shadowText(text,x,y,w,h,color,size,font,xx,yy,x1,x2,x3,x4,x5)
- dxDrawText(text,x+1,y+1,w+1,h+1,tocolor(0,0,0),size,font,xx,yy,x1,x2,x3,x4,x5)
- dxDrawText(text,x,y,w,h,color,size,font,xx,yy,x1,x2,x3,x4,x5)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement