Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Autor: Malentas
- ]]
- if getElementData(localPlayer, "zalogowany") then return end
- local screenW, screenH = guiGetScreenSize()
- local rozx, rozy = screenW/1440, screenH/900
- local tlo = dxCreateTexture("img/tlo.png", "argb", true, "clamp")
- sx,sy = guiGetScreenSize()
- x,y = (sx/1366), (sy/768)
- messages = {}
- editBox = {}
- editBox.__index = editBox
- editBox.instances = {}
- local sm = {}
- sm.moov = 0
- sm.object1,sm.object2 = nil,nil
- local muzyka = false
- local zapamietaj = true
- local domki = { }
- local sx, sy = guiGetScreenSize()
- function mysz(psx,psy,pssx,pssy,abx,aby)
- if not isCursorShowing() then return end
- cx,cy=getCursorPosition()
- cx,cy=cx*sx,cy*sy
- if cx >= psx and cx <= psx+pssx and cy >= psy and cy <= psy+pssy then
- return true,cx,cy
- else
- return false
- end
- end
- panel = false
- logowanie = false
- rejestracja = false
- changelog = false
- regulamin = false
- addEventHandler("onClientClick", root, function(button, state)
- local login = g.nick.text
- local haslo = g.haslo.text
- if button == "left" and state == "down" and mysz(1249*rozx, 526*rozy, 1357*rozx, 557*rozy) and logowanie == true then
- if login:len() < 3 then
- zmienPowiadomienie("Podany login ma za mało znaków.")
- return
- end
- if haslo:len() < 3 then
- zmienPowiadomienie("Podane hasło ma za mało znaków.")
- return
- end
- login = string.gsub(login, "[ ]", "")
- haslo = string.gsub(haslo, "[ ]", "")
- triggerServerEvent("zaloguj", localPlayer, login, haslo)
- elseif button == "left" and state == "down" and mysz(1249*rozx, 526*rozy, 1357*rozx, 557*rozy) and rejestracja == true then
- if login:len() < 3 then
- zmienPowiadomienie("Podany login ma za mało znaków.")
- return
- end
- if haslo:len() < 3 then
- zmienPowiadomienie("Podany hasło ma za mało znaków.")
- return
- end
- login = string.gsub(login, "[ ]", "")
- haslo = string.gsub(haslo, "[ ]", "")
- triggerServerEvent("zarejestruj", localPlayer, login, haslo)
- end
- end)
- local czcionka = dxCreateFont("cz.ttf", 10)
- local czcionka2 = dxCreateFont("cz.ttf", 12)
- local czcionka3 = dxCreateFont("cz.ttf", 22)
- function gui()
- setCameraMatrix(1283.2510986328, -2005.490234375, 97.91300201416, 1282.3190917969, -2005.6629638672, 97.594230651855)
- if muzyka then
- local bit = getSoundFFTData(muzyka, 2048, 3)
- for i,v in ipairs(bit) do
- rytm = math.round((v*320),0)>100 and 100 or math.round((v*320),0)
- dxDrawImage(535*rozx, 255*rozy, 400*rozx, 400*rozy, "img/podswietlenie.png", 0, 0, 0, tocolor(26, 177, 133, rytm), false)
- end
- end
- local alph = interpolateBetween(0, 0, 0, 255, 0, 0, (getTickCount() - tick)/1000, "Linear")
- dxDrawImage(580*rozx, 302*rozy, 826*rozx, 297*rozy, tlo, 0, 0, 0, tocolor(255, 255, 255, alph), false)
- if mysz(61*rozx, 52*rozy, 188*rozx, 188*rozy) or logowanie == true then
- dxDrawImage(61*rozx, 52*rozy, 188*rozx, 188*rozy, ":np-logowanie/img/logowanie_on.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
- else
- dxDrawImage(61*rozx, 52*rozy, 188*rozx, 188*rozy, ":np-logowanie/img/logowanie_off.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
- end
- if mysz(61*rozx, 250*rozy, 188*rozx, 188*rozy) or rejestracja == true then
- dxDrawImage(61*rozx, 250*rozy, 188*rozx, 188*rozy, ":np-logowanie/img/rejestracja_on.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
- else
- dxDrawImage(61*rozx, 250*rozy, 188*rozx, 188*rozy, ":np-logowanie/img/rejestracja_off.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
- end
- if mysz(61*rozx, 448*rozy, 188*rozx, 188*rozy) or changelog == true then
- dxDrawImage(61*rozx, 448*rozy, 188*rozx, 188*rozy, ":np-logowanie/img/changelog_on.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
- else
- dxDrawImage(61*rozx, 448*rozy, 188*rozx, 188*rozy, ":np-logowanie/img/changelog_off.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
- end
- if mysz(61*rozx, 646*rozy, 188*rozx, 188*rozy) or regulamin == true then
- dxDrawImage(61*rozx, 646*rozy, 188*rozx, 188*rozy, ":np-logowanie/img/regulamin_on.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
- else
- dxDrawImage(61*rozx, 646*rozy, 188*rozx, 188*rozy, ":np-logowanie/img/regulamin_off.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
- end
- if logowanie == true then
- dxDrawImage(902*rozx, 453*rozy, 275*rozx, 45*rozy, ":np-logowanie/img/editbox.png", 0, 0, 0, tocolor(255, 255, 255, alph), false)
- dxDrawImage(902*rozx, 376*rozy, 275*rozx, 45*rozy, ":np-logowanie/img/editbox.png", 0, 0, 0, tocolor(255, 255, 255, alph), false)
- if zapamietaj == true then
- dxDrawImage(1029*rozx, 514*rozy, 148*rozx, 26*rozy, ":np-logowanie/img/save_on.png", 0, 0, 0, tocolor(255, 255, 255, alph), false)
- else
- dxDrawImage(1029*rozx, 514*rozy, 148*rozx, 26*rozy, ":np-logowanie/img/save_off.png", 0, 0, 0, tocolor(255, 255, 255, alph), false)
- end
- dxDrawText("NewPlace", 1198*rozx, 393*rozy, 1396*rozx, 438*rozy, tocolor(255, 255, 255, alph), 1.00, czcionka2, "center", "center", false, false, false, false, false)
- dxDrawText("Życzymy miłej rozgrywki", 1198*rozx, 448*rozy, 1396*rozx, 493*rozy, tocolor(255, 255, 255, alph), 1.00, czcionka, "center", "center", false, false, false, false, false)
- dxDrawImage(1239*rozx, 521*rozy, 119*rozx, 42*rozy, ":np-logowanie/img/button_off.png", 0, 0, 0, tocolor(255, 255, 255, alph), false)
- dxDrawText("Zaloguj", 1245*rozx, 526*rozy, 1357*rozx, 557*rozy, tocolor(255, 255, 255, alph), 1.00, czcionka, "center", "center", false, false, false, false, false)
- end
- if rejestracja == true then
- dxDrawImage(902*rozx, 453*rozy, 275*rozx, 45*rozy, ":np-logowanie/img/editbox.png", 0, 0, 0, tocolor(255, 255, 255, alph), false)
- dxDrawImage(902*rozx, 376*rozy, 275*rozx, 45*rozy, ":np-logowanie/img/editbox.png", 0, 0, 0, tocolor(255, 255, 255, alph), false)
- dxDrawText("NewPlace", 1198*rozx, 393*rozy, 1396*rozx, 438*rozy, tocolor(255, 255, 255, alph), 1.00, czcionka2, "center", "center", false, false, false, false, false)
- dxDrawText("Życzymy miłej rozgrywki", 1198*rozx, 448*rozy, 1396*rozx, 493*rozy, tocolor(255, 255, 255, alph), 1.00, czcionka, "center", "center", false, false, false, false, false)
- dxDrawImage(1239*rozx, 521*rozy, 119*rozx, 42*rozy, ":np-logowanie/img/button_off.png", 0, 0, 0, tocolor(255, 255, 255, alph), false)
- dxDrawText("Zarejestruj", 1245*rozx, 526*rozy, 1357*rozx, 557*rozy, tocolor(255, 255, 255, alph), 1.00, czcionka, "center", "center", false, false, false, false, false)
- end
- if regulamin == true then
- dxDrawText("Regulamin serwera NewPlace", 885*rozx, 308*rozy, 1404*rozx, 357*rozy, tocolor(255, 255, 255, alph), 0.75, czcionka2, "center", "center", false, false, false, false, false)
- dxDrawText("Do Aktualizacji", 885*rozx, 357*rozy, 1404*rozx, 579*rozy, tocolor(255, 255, 255, alph), 0.75, czcionka, "center", "center", false, false, false, false, false)
- end
- if changelog == true then
- dxDrawText("Aktualizacje", 885*rozx, 308*rozy, 1404*rozx, 357*rozy, tocolor(255, 255, 255, alph), 1.00, czcionka2, "center", "center", false, false, false, false, false)
- dxDrawText("25.05.2018 - Oficjalny start serwera", 885*rozx, 357*rozy, 1404*rozx, 579*rozy, tocolor(255, 255, 255, alph), 1.00, czcionka, "center", "center", false, false, false, false, false)
- end
- --
- for k,self in pairs(editBox.instances) do
- if self.visible then
- local px,py,pw,ph = self:getPosition()
- local text = self.masked and string.gsub(self.text,".","•") or self.text
- local alignX = dxGetTextWidth(text,self.scale,self.font) <= pw and "left" or "right"
- --roundedRectangle(px, py, pw, ph, tocolor(unpack(self.color)), false)
- dxDrawText(text,px+x*5, py,px-x*5+pw, py+ph,tocolor(255, 255, 255, alph),self.scale,self.font, alignX, "center",true)
- if self.input and dxGetTextWidth(text,self.scale,self.font) <= pw then
- local lx = dxGetTextWidth(text,self.scale,self.font)+px+x*8
- local lx = dxGetTextWidth(text,self.scale,self.font)+px+x*8
- dxDrawLine(lx, py+y*10, lx, py+ph-y*10, tocolor(255,255,255,math.abs(math.sin(getTickCount()/300))*200), 2)
- end
- end
- end
- ---
- if getKeyState("backspace") then
- for k,self in pairs(editBox.instances) do
- if self.visible and self.input then
- if not keyState then
- keyState = getTickCount() + 400
- self.text = string.sub(self.text,1,string.len(self.text)-1)
- elseif keyState and keyState < getTickCount() then
- keyState = getTickCount()+100
- self.text = string.sub(self.text,1,string.len(self.text)-1)
- end
- return
- end
- end
- keyState = nil
- end
- --
- end
- function math.round(number, decimals, method)
- decimals = decimals or 0
- local factor = 10 ^ decimals
- if (method == "ceil" or method == "floor") then return math[method](number * factor) / factor
- else return tonumber(("%."..decimals.."f"):format(number)) end
- end
- local font = dxCreateFont("cz.ttf", 13)
- function onClientClick(button,state,cX,cY)
- if not isCursorShowing() then
- return
- end
- if button == "left" and state == "up" then
- for k,self in pairs(editBox.instances) do
- if self.visible then
- if self.input then
- self.input = nil
- self.onOutput()
- end
- local x,y,w,h = self:getPosition()
- if mysz(x,y,w,h) then
- self.input = true
- self.onInput()
- tick222 = getTickCount()
- end
- end
- end
- end
- end
- addEventHandler("onClientClick", root, onClientClick)
- addEventHandler("onClientClick", root, function(btn, state)
- if btn == "left" and state == "down" then
- if mysz(1032*rozx, 516*rozy, 20*rozx, 23*rozy) and logowanie == true then
- playSound("click.mp3", false)
- if zapamietaj == true then
- zapamietaj = false
- elseif zapamietaj == false then
- zapamietaj = true
- end
- --panel
- elseif mysz(61*rozx, 52*rozy, 188*rozx, 188*rozy) and panel == true and logowanie ~= true then
- logowanie = true
- g.nick.visible = true
- g.haslo.visible = true
- rejestracja = false
- changelog = false
- regulamin = false
- tick = getTickCount()
- elseif mysz(61*rozx, 250*rozy, 188*rozx, 188*rozy) and panel == true and rejestracja ~= true then
- logowanie = false
- rejestracja = true
- g.nick.visible = true
- g.haslo.visible = true
- changelog = false
- regulamin = false
- tick = getTickCount()
- elseif mysz(61*rozx, 448*rozy, 188*rozx, 188*rozy) and panel == true and changelog ~= true then
- logowanie = false
- rejestracja = false
- changelog = true
- regulamin = false
- g.nick.visible = false
- g.haslo.visible = false
- tick = getTickCount()
- elseif mysz(61*rozx, 646*rozy, 188*rozx, 188*rozy) and panel == true and regulamin ~= true then
- logowanie = false
- rejestracja = false
- changelog = false
- regulamin = true
- g.nick.visible = false
- g.haslo.visible = false
- tick = getTickCount()
- end
- end
- end)
- okno1 = false
- local spawn = 1
- local gui2s = false
- local spawn1 = "Urząd miasta, Los Santos"
- function usun()
- removeEventHandler("onClientRender", root, gui2)
- gui2s = false
- showChat(true)
- showCursor(false)
- stopSound(muzyka)
- destroyElement(ped)
- if samolocik == true then
- local samolot = createVehicle(592, 2071.44, -2494.35, 16.74, 350, 0, 90)
- setCameraMatrix(2030.5219726563, -2531.9909667969, 20.844900131226, 2031.2567138672, -2531.3178710938, 20.759534835815)
- setElementData(samolot, "samolot", true)
- setElementFrozen(samolot, true)
- setElementData(localPlayer, "hud", true)
- showChat(false)
- showPlayerHudComponent("all", false)
- showPlayerHudComponent ("health", false)
- showPlayerHudComponent ("clock", false)
- showPlayerHudComponent ("breath", false)
- showPlayerHudComponent ("weapon", false)
- showPlayerHudComponent ("armour", false)
- showPlayerHudComponent ("ammo", false)
- end
- end
- function gui2()
- local alph = interpolateBetween(0, 0, 0, 255, 0, 0, (getTickCount() - tick2)/1000, "Linear")
- dxDrawImage(322*rozx, 214*rozy, 275*rozx, 376*rozy, ":np-gui/grafiki/tlo.png", 0, 0, 0, tocolor(255, 255, 255, alph), false)
- dxDrawImage(891*rozx, 214*rozy, 275*rozx, 376*rozy, ":np-gui/grafiki/tlo.png", 0, 0, 0, tocolor(255, 255, 255, alph), false)
- dxDrawImage(929*rozx, 277*rozy, 201*rozx, 49*rozy, ":np-gui/grafiki/button_off.png", 0, 0, 0, tocolor(255, 255, 255, alph), false)
- dxDrawText("Wybór spawnu", 891*rozx, 214*rozy, 1166*rozx, 263*rozy, tocolor(255, 255, 255, 255), 1.00, czcionka2, "center", "center", false, false, false, false, false)
- dxDrawImage(929*rozx, 336*rozy, 201*rozx, 49*rozy, ":np-gui/grafiki/button_off.png", 0, 0, 0, tocolor(255, 255, 255, alph), false)
- dxDrawImage(929*rozx, 395*rozy, 201*rozx, 49*rozy, ":np-gui/grafiki/button_off.png", 0, 0, 0, tocolor(255, 255, 255, alph), false)
- dxDrawImage(929*rozx, 454*rozy, 201*rozx, 49*rozy, ":np-gui/grafiki/button_off.png", 0, 0, 0, tocolor(255, 255, 255, alph), false)
- --dxDrawImage(929*rozx, 513*rozy, 201*rozx, 49*rozy, ":np-gui/grafiki/button_off.png", 0, 0, 0, tocolor(255, 255, 255, alph), false)
- dxDrawText("Spawn Los Santos", 929*rozx, 278*rozy, 1130*rozx, 326*rozy, tocolor(255, 255, 255, alph), 1.00, czcionka2, "center", "center", false, false, false, false, false)
- dxDrawText("Przechowalnia", 929*rozx, 336*rozy, 1130*rozx, 384*rozy, tocolor(255, 255, 255, alph), 1.00, czcionka2, "center", "center", false, false, false, false, false)
- dxDrawText("Ostatnia pozycja", 929*rozx, 395*rozy, 1130*rozx, 443*rozy, tocolor(255, 255, alph, alph), 1.00, czcionka2, "center", "center", false, false, false, false, false)
- dxDrawText("Spawn Las Venturas", 929*rozx, 454*rozy, 1130*rozx, 502*rozy, tocolor(255, 255, 255, alph), 1.00, czcionka2, "center", "center", false, false, false, false, false)
- --dxDrawText("Gdzies2", 929*rozx, 512*rozy, 1130*rozx, 560*rozy, tocolor(255, 255, 255, alph), 1.00, czcionka2, "center", "center", false, false, false, false, false)
- dxDrawText("Informacje o postaci", 321*rozx, 213*rozy, 597*rozx, 278*rozy, tocolor(255, 255, 255, alph), 1.00, czcionka2, "center", "center", false, false, false, false, false)
- dxDrawText("Nickname: "..getPlayerName(localPlayer).."\nDBID: "..getElementData(localPlayer, "dbid").."\nPieniądze: "..getElementData(localPlayer, "pieniadze").." PLN\nBankomat: "..getElementData(localPlayer, "bankomat").." PLN", 321*rozx, 276*rozy, 597*rozx, 590*rozy, tocolor(255, 255, 255, alph), 1.00, czcionka2, "center", "center", false, false, false, false, false)
- if #domki > 0 then
- dxDrawImage(1187*rozx, 214*rozy, 239*rozx, 375*rozy, ":np-gui/grafiki/tlo.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
- dxDrawText("Dodatkowe spawny", 1186*rozx, 214*rozy, 1426*rozx, 252*rozy, tocolor(255, 255, 255, 255), 1.00, czcionka2, "center", "center", false, false, false, false, false)
- for i, v in ipairs(domki) do
- local dodatekY = (50*rozy)*(i-1)
- dxDrawImage(1205*rozx, 262*rozy+dodatekY, 200*rozx, 45*rozy, ":np-gui/grafiki/button_off.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
- dxDrawText(v[1], 1205*rozx, 262*rozy+(dodatekY*2), 1405*rozx, 307*rozy, tocolor(255, 255, 255, 255), 1.00, czcionka2, "center", "center", false, false, false, false, false)
- end
- end
- end
- addEventHandler("onClientClick", root, function(btn, state)
- if btn == "left" and state == "down" then
- if mysz(929*rozx, 277*rozy, 201*rozx, 49*rozy) and gui2s == true then
- triggerServerEvent("spawn", localPlayer, "spawn")
- usun()
- elseif mysz(929*rozx, 336*rozy, 201*rozx, 49*rozy) and gui2s == true then
- triggerServerEvent("spawn", localPlayer, "przecho")
- usun()
- elseif mysz(929*rozx, 395*rozy, 201*rozx, 49*rozy) and gui2s == true then
- triggerServerEvent("spawn", localPlayer, "pozi")
- usun()
- elseif mysz(929*rozx, 454*rozy, 201*rozx, 49*rozy) and gui2s == true then
- triggerServerEvent("spawn", localPlayer, "lv")
- usun()
- end
- if gui2s == true and #domki > 0 then
- for i, v in ipairs(domki) do
- local dodatekY = (50*rozy)*(i-1)
- if mysz(1205*rozx, 262*rozy+dodatekY, 200*rozx, 45*rozy) and gui2s == true and #domki > 0 then
- local pos = split(v[2], ",")
- triggerServerEvent("spawn", localPlayer, "dom", pos[1], pos[2], pos[3])
- usun()
- end
- end
- end
- end
- end)
- addEventHandler("onClientResourceStart", resourceRoot, function()
- addEventHandler("onClientRender", root, gui)
- logowanie = true
- panel = true
- showCursor(true)
- showChat(false)
- fadeCamera(true)
- muzyka = playSound("muzyka.mp3", true)
- setSoundVolume(muzyka, 0.6)
- tick = getTickCount()
- setPlayerHudComponentVisible("all", false)
- setPlayerHudComponentVisible("radar", false)
- triggerEvent("usunPobieranie", localPlayer)
- triggerServerEvent("sprawdzBana", localPlayer)
- g = {}
- g.nick = editBox.new()
- g.nick:setPosition(902*rozx, 376*rozy, 275*rozx, 35*rozy)
- g.nick.color = {26, 177, 133, 130}
- g.nick.font = font
- g.nick.text = loadLoginFromXML()
- g.nick.onInput = function()
- g.nick.color = {26, 177, 133, 220}
- end
- g.nick.onOutput = function()
- g.nick.color = {26, 177, 133, 130}
- end
- g.haslo = editBox.new()
- g.haslo:setPosition(902*rozx, 453*rozy, 275*rozx, 35*rozy)
- g.haslo.color = {26, 177, 133, 130}
- g.haslo.font = font
- g.haslo.text = loadLoginFromXML2()
- g.haslo.masked = true
- g.haslo.onInput = function()
- g.haslo.color = {26, 177, 133, 220}
- end
- g.haslo.onOutput = function()
- g.haslo.color = {26, 177, 133, 130}
- end
- g.nick.visible = true
- g.haslo.visible = true
- end)
- addEvent("bShowedLogin", true)
- addEventHandler("bShowedLogin", root, function()
- g.nick.visible = false
- g.haslo.visible = false
- removeEventHandler("onClientRender", root, gui)
- logowanie = false
- rejestracja = false
- wyb_reg = false
- wyb_log = false
- setTimer(function()
- triggerServerEvent("banWyrzuc", localPlayer)
- end, 14000, 1)
- end)
- local ile = 0.1
- local d = false
- addEventHandler("onClientRender", root, function()
- for i,v in ipairs(getElementsByType("vehicle")) do
- if getElementData(v, "samolot") then
- triggerEvent("radar:onClientHudComponent", localPlayer, "radar", false)
- local x,y,z = getElementPosition(v)
- local rx,ry,rz = getElementRotation(v)
- if x < 1950 and d ~= true then
- dolecial()
- d = true
- return
- end
- setElementPosition(v, x-ile,y,z)
- if rx > 90 then
- setElementRotation(v, rx+0.05,ry,rz)
- end
- if z > 14.5 then
- setElementPosition(v, x-ile,y,z-0.01)
- else
- setElementPosition(v, x-ile,y,z)
- end
- if d == false then
- setTime(2,0)
- --dxDrawRectangle(screenW * 0.0000, screenH * 0.0000, screenW * 1.0000, screenH * 0.2380, tocolor(15,15,15,125), false)
- --dxDrawRectangle(screenW * 0.0000, screenH * 0.7620, screenW * 1.0000, screenH * 0.2380, tocolor(15,15,15,125), false)
- dxDrawRectangle(0, 783*rozy, 1500*rozx, 123*rozy, tocolor(0, 0, 0, 140), false)
- dxDrawRectangle(0, 0, 1500*rozx, 123*rozy, tocolor(0, 0, 0, 140), false)
- dxDrawText("Witaj w Los Santos", 328*rozx, 783*rozy, 1125*rozx, 896*rozy, tocolor(255, 255, 255, 255), 1.00, czcionka3, "center", "center", false, false, false, false, false)
- end
- local x,y,z,x1,y1,z1 = getCameraMatrix(localPlayer)
- setCameraMatrix(x-ile,y,z,x1-ile,y1,z1)
- end
- end
- end)
- function dolecial()
- fadeCamera(false)
- setTimer(function()
- fadeCamera(true)
- setCameraTarget(localPlayer)
- setElementData(localPlayer, "hud", false)
- showChat(true)
- local x,y,z = getElementPosition(localPlayer)
- setElementPosition(localPlayer, x, y, 69.2)
- for i,v in ipairs(getElementsByType("vehicle")) do
- if getElementData(v, "samolot") then
- setElementData(v, "samolot", false)
- destroyElement(v)
- end
- end
- local time = getRealTime()
- setTime(time.hour,time.minute)
- triggerEvent("radar:onClientHudComponent", localPlayer, "radar", true)
- end, 1500, 1)
- end
- addEvent("usunElementyLogowania", true)
- addEventHandler("usunElementyLogowania", root, function(onest)
- if onest == "true" then
- samolocik = true
- end
- g.nick.visible = false
- g.haslo.visible = false
- removeEventHandler("onClientRender", root, gui)
- smoothMoveCamera(1283.2510986328, -2005.490234375, 97.91300201416, 1282.3190917969, -2005.6629638672, 97.594230651855, 1121.2890625, -2039.5078125, 79.85050201416, 1120.4855957031, -2038.9918212891, 79.553489685059, 1500)
- setTimer(function()
- addEventHandler("onClientRender", root, gui2)
- gui2s = true
- removeEventHandler("onClientPreRender",root,camRender)
- tick2 = getTickCount( )
- end, 1500, 1)
- panel = false
- logowanie = false
- rejestracja = false
- changelog = false
- regulamin = false
- setTimer(function()
- local skin = getElementData(localPlayer, "skin") or 0
- ped = createPed(tonumber(skin), 1117.61, -2036.99, 78.75, 225)
- end, 100, 1)
- if zapamietaj == true then
- saveLoginToXML(g.nick.text, g.haslo.text)
- end
- end)
- addEvent("pokaz:domki", true)
- addEventHandler("pokaz:domki", root, function(tab)
- for i, v in ipairs(tab) do
- table.insert(domki, {v.name.." (ID: "..v.id..")", v.wejscie})
- end
- end)
- function zmienPowiadomienie(text)
- exports["np-notyfikacje"]:noti(text)
- end
- addEvent("zmienPowiadomienie", true)
- addEventHandler("zmienPowiadomienie", root, zmienPowiadomienie)
- function roundedRectangle(x, y, w, h, color)
- dxDrawRectangle(x, y, w, h, color, false)
- dxDrawRectangle(x + 2, y - 1, w - 4, 1, color, false)
- dxDrawRectangle(x + 2, y + h, w - 4, 1, color, false)
- dxDrawRectangle(x - 1, y + 2, 1, h - 4, color, false)
- dxDrawRectangle(x + w, y + 2, 1, h - 4, color, false)
- end
- function onClientCharacter(character)
- if not isCursorShowing() then
- return
- end
- for k,self in pairs(editBox.instances) do
- if self.visible and self.input then
- if (string.len(self.text)) < self.maxLength then
- self.text = self.text..character
- end
- end
- end
- end
- addEventHandler("onClientCharacter", root, onClientCharacter)
- function editBox.new()
- local self = setmetatable({}, editBox)
- self.text = ""
- self.maxLength = 20
- self.scale = y*0.8
- self.state = "normal"
- self.font = "sans"
- self.color = {255,255,255,220}
- self.textColor = {255,255,255,220}
- table.insert(editBox.instances, self)
- return self
- end
- function editBox:getPosition()
- return self.x, self.y, self.w, self.h
- end
- function editBox:setPosition(x,y,w,h)
- self.x, self.y, self.w, self.h = x,y,w,h
- return true
- end
- function loadLoginFromXML()
- local XML = xmlLoadFile ("zapis.xml")
- if not XML then
- XML = xmlCreateFile("zapis.xml", "konto")
- end
- local usernameNode = xmlFindChild (XML, "login", 0)
- if usernameNode then
- return xmlNodeGetValue(usernameNode)
- else
- return ""
- end
- xmlUnloadFile ( XML )
- end
- function loadLoginFromXML2()
- local XML = xmlLoadFile ("zapis.xml")
- if not XML then
- XML = xmlCreateFile("zapis.xml", "konto")
- end
- local hasloNode = xmlFindChild (XML, "haslo", 0)
- if hasloNode then
- return xmlNodeGetValue(hasloNode)
- else
- return ""
- end
- xmlUnloadFile ( XML )
- end
- function saveLoginToXML(username, hasloo)
- local XML = xmlLoadFile ("zapis.xml")
- if not XML then
- XML = xmlCreateFile("zapis.xml", "konto")
- end
- if (username ~= "") then
- local usernameNode = xmlFindChild (XML, "login", 0)
- if not usernameNode then
- usernameNode = xmlCreateChild(XML, "login")
- end
- xmlNodeSetValue (usernameNode, tostring(username))
- end
- if (hasloo ~= "") then
- local haslo = xmlFindChild (XML, "haslo", 0)
- if not haslo then
- haslo = xmlCreateChild(XML, "haslo")
- end
- xmlNodeSetValue (haslo, tostring(hasloo))
- end
- xmlSaveFile(XML)
- xmlUnloadFile (XML)
- end
- addEvent("saveLoginToXML", true)
- addEventHandler("saveLoginToXML", root, saveLoginToXML)
- function removeCamHandler()
- if(sm.moov == 1)then
- sm.moov = 0
- end
- end
- function camRender()
- if (sm.moov == 1) then
- local x1,y1,z1 = getElementPosition(sm.object1)
- local x2,y2,z2 = getElementPosition(sm.object2)
- setCameraMatrix(x1,y1,z1,x2,y2,z2)
- end
- end
- addEventHandler("onClientPreRender",root,camRender)
- function smoothMoveCamera(x1,y1,z1,x1t,y1t,z1t,x2,y2,z2,x2t,y2t,z2t,time)
- if(sm.moov == 1)then return false end
- sm.object1 = createObject(1337,x1,y1,z1)
- sm.object2 = createObject(1337,x1t,y1t,z1t)
- setElementAlpha(sm.object1,0)
- setElementAlpha(sm.object2,0)
- setObjectScale(sm.object1,0.01)
- setObjectScale(sm.object2,0.01)
- moveObject(sm.object1,time,x2,y2,z2,0,0,0,"InOutQuad")
- moveObject(sm.object2,time,x2t,y2t,z2t,0,0,0,"InOutQuad")
- sm.moov = 1
- --setTimer(removeCamHandler,time,1)
- setTimer(destroyElement,time,1,sm.object1)
- setTimer(destroyElement,time,1,sm.object2)
- return true
- 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,color[4]),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