Jump to content

Razo

Members
  • Posts

    2
  • Joined

  • Last visited

Details

  • Occupation
    Just visiting

Razo's Achievements

I ordered some spaghetti with marinara sauce and I got egg noodles and ketchup. I'm an average nobody.

I ordered some spaghetti with marinara sauce and I got egg noodles and ketchup. I'm an average nobody. (2/54)

0

Reputation

  1. Thanks man I've figured out the problem right after debugging. In the gui.lua, line 34 and 35, I unintentionally used == instead of =. I probably didn't pay enough attention.
  2. Hi. I've just started learning scripting, and most of the time, I used the Wiki's introduction topics. I tried to create a simple login panel, following the tutorial, but it doesn't appear. I tried to change a few things, maybe I just made it worse, I don't know. Please don't be rude, I'm not used to this lang. I played and scripted SAMP before, for like, 5 years, so it's still a bit confusing to me. I don't know how the things work perfectly, but I followed the tutorial, and it's still not okay. If anyone has a solution, please help. Here are all the codes: meta.xml: <meta> <info author="Razo" type="script" name="LoginSys" version="1.0" /> <script src="gui.lua" type="client" /> <script src="sside.lua" type="server" /> </meta> gui.lua: function createLoginGUI() local X = 0.3 local Y = 0.3 local Width = 0.25 local Height = 0.25 wdwLogin = guiCreateWindow(X, Y, Width, Height, "Bejelentkezés", true) X = 0.0825 Y = 0.2 Width = 0.25 Height = 0.25 guiCreateLabel(X,Y,Width,Height,"Felhasználó",true,wdwLogin) Y = 0.5 guiCreateLabel(X,Y,Width,Height,"Jelszó",true,wdwLogin) X = 0.415 Y = 0.2 Width = 0.5 Height = 0.15 edtUser = guiCreateEdit(X, Y, Width, Height, "", true, wdwLogin) Y = 0.5 edtPass = guiCreateEdit(X, Y, Width, Height, "", true, wdwLogin) guiEditSetMaxLength(edtUser, 50) guiEditSetMaxLength(edtPass, 50) X = 0.415 Y = 0.7 Width = 0.25 Height = 0.2 btnLogin = guiCreateButton(X, Y, Width, Height, "Bejelentkezés", true, wdwLogin) guiSetVisible(wdwLogin, true) addEventHandler("onClientGUIClick",btnLogin,clientSubmitLogin,false) end function clientSubmitLogin(button,state) if button == "left" and state == "up" then local username == guiGetText(edtUser) local password == guiGetText(edtPass) if username and password then triggerServerEvent("submitLogin",getRootElement(),username,password) guiSetInputEnabled(false) guiSetVisible(wdwLogin,false) showCursor(false) else outputChatBox("Írj be egy felhasználónevet és egy jelszót...") end end end function startRes() createLoginGUI() if(wdwLogin ~= nil) then guiSetVisible(wdwLogin,true) else outputChatBox("Hiba történt, a GUI-t nem sikerült megjeleníteni.") end showCursor(true) guiSetInputEnabled(true) end addEventHandler("onClientResourceStart",getRootElement(),startRes) sside.lua: local spawnX, spawnY, spawnZ = 1959.55, -1714.46, 20 function loginHandler(username,password) if username == "asd" and password == "asd" then if(client) then spawnPlayer(client,spawnX,spawnY,spawnZ) fadeCamera(client,true) setCameraTarget(client,client) --outputChatBox("Previon, Landstalker, Uranus, Alpha",client) --the list of the modded vehicles, just for fun else outputChatBox("Hibás felh. és/vagy jelszó.",client) --basically an error msg end end end addEvent("submitLogin",true) addEventHandler("submitLogin",root,loginHandler)
×
×
  • Create New...