Jump to content

Szymixo

Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by Szymixo

  1. It's not working, it's all of my meta.xml <meta> <info author="Szymixo" name="Panel logowania" version="1.0" type="script" /> <script src="login_s.lua" type="server" /> <script src="client.lua" type="client" /> <file src="images/tlo.png" /> <file src="images/zaloguj.png" /> <file src="images/zarejestruj.png" /> </meta> and it's my client.lua: local sX, sY = guiGetScreenSize() local data = { showed = nil, button = {}, info = nil, misc = nil } ------------------------------------------------------------------------- function isMouseIn(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 ------------------------------------------------------------------------- GUIEditor = { staticimage = {}, label = {}, button = {} } function drawPanel() GUIEditor.staticimage[1] = guiCreateStaticImage(sX*0/1280, sY*0/720, sX*1280/1280, sY*720/720, ":truck_login/images/tlo.png", false) GUIEditor.login = guiCreateEdit(sX*526/1280, sY*322/720, sX*228/1280, sY*52/720, "", false, GUIEditor.staticimage[1]) GUIEditor.pass = guiCreateEdit(sX*525/1280, sY*414/720, sX*229/1280, sY*53/720, "", false, GUIEditor.staticimage[1]) guiEditSetMasked(GUIEditor.pass, true) GUIEditor.button[1] = guiCreateStaticImage(sX*579/1280, sY*475/720, sX*124/1280, sY*32/720, ":truck_login/images/zaloguj.png", false, GUIEditor.staticimage[1]) GUIEditor.button[2] = guiCreateStaticImage(sX*579/1280, sY*509/720, sX*124/1280, sY*32/720, ":truck_login/images/zarejestruj.png", false, GUIEditor.staticimage[1]) if data.info then GUIEditor.label[1] = guiCreateLabel(sX*483, sY*248/720, sX*314/1280, sY*22/720, "Dokonałeś pomyślnej rejestracji!", false, GUIEditor.staticimage[1]) end guiSetFont(GUIEditor.label[1], "default-bold-small") guiLabelSetHorizontalAlign(GUIEditor.label[1], "center", false) end addCommandHandler("panel", function(plr, cmd) outputChatBox("Uzywasz /panel, "..name) end) ------------------------------------------------------------------------- addEventHandler("onClientGUIClick", GUIEditor.button[1], resourceRoot, function() local login = guiGetText(GUIEditor.login) local pass = guiGetText(GUIEditor.pass) if string.len(login) < 2 or string.len(pass) < 2 then data.info = "Wypełnij wszystkie pola!" return end triggerServerEvent("checkAccount", resourceRoot, login, pass) end) addEventHandler("onClientGUIClick", GUIEditor.button[2], resourceRoot, function() local login = guiGetText(GUIEditor.login) local pass = guiGetText(GUIEditor.pass) if string.len(login) < 2 and string.len(pass) < 2 then data.info = "Wypełnij wszystkie pola!" return end triggerServerEvent("createAccount", resourceRoot, login, pass) end) ------------------------------------------------------------------------- addEventHandler( "onClientResourceStart", getResourceRootElement(getThisResource()), function() outputChatBox("Resource started"); setPlayerHudComponentVisible("all", false); showCursor(true); showChat(false); addEventHandler("onClientRender", getResourceRootElement(), drawPanel); end); ------------------------------------------------------------------------- addEvent("loginResult", true) addEventHandler("loginResult", resourceRoot, function(value, info) if not info then info = "" end if value then removeEventHandler("onClientRender", resourceRoot, drawPanel) else data.info = tostring(info) setTimer(function() data.info = nil end, 3000, 1) end end) ------------------------------------------------------------------------- all of client.lua doesn't work. /panel command too.
  2. Hello, i have small problem. My event 'onClientResourceStart' doesn't work correctly. i have this code in client-side: function starts() outputChatBox("Resource started") setPlayerHudComponentVisible("all", false) showCursor(true) showChat(false) addEventHandler("onClientRender", getResourceRootElement(), drawPanel) end addEventHandler("onClientResourceStart", getResourceRootElement(), starts) it's doesn't work. For testing i add this code for server-side and it's work correctly: addEventHandler("onResourceStart", resourceRoot, function() outputDebugString("Resource login started") end) Where is the problem? Thank you for the help
×
×
  • Create New...