Jump to content

Wes

Members
  • Posts

    76
  • Joined

  • Last visited

Everything posted by Wes

  1. Wes

    GUI Bug.

    The button is working just fine, the login script is the one that doesnt work the way I want to work.
  2. Wes

    GUI Bug.

    Still doesnt work...
  3. Wes

    GUI Bug.

    WARNING: Loginsystem / s_login.lua: 6 : Bad Argument @ logIn [Expected account at argument 2, got string 'Teo' ]
  4. Wes

    GUI Bug.

    Still doesnt work And wherever I click it outputs the error message..
  5. Wes

    GUI Bug.

    Hy. I made a GUI Login, and everytime I click on the Login button, I get this message WARNING: loginsystem\s_login.lua:4: Bad Argument @getAccount [Expected String at argument 1, got nil] WARNING: loginsystem\s_login.lua: 6: Bad Argument @logIn .[Expected account at argument 2, got boolean] Aand it doesnt matter where I click, it triggers both register and login function, idk why. This is the code, I hope you can help me. addEvent("onlogin", true) addEventHandler("onlogin", getRootElement(), function (player, user, pass) local account = getAccount(account, pass) if (account ~= true) then if (logIn (player, account, pass) == true) then outputChatBox("Bejelentkeztél" .. account .. "nevű felhasználóba!") triggerClientEvent(player, "hideWindow", getRootElement()) else outputChatBox("Bejelentkezési hiba történt... Kérlek próbáld meg később!") end else outputChatBox("Helytelen felhasználónév / jelszó!") end end ) addEvent("onregister", true) addEventHandler("onregister", getRootElement(), function (player, user, pass) local account = getAccount(user, pass) if (account ~= false) then if (logIn (account, pass) == true) then outputChatBox("Sikeresen regisztráltál a szerverre!") triggerClientEvent(player, "hideWindow", getRootElement()) else outputChatBox("Már be vagy jelentkezve!") end else account = addAccount(user, pass) if (logIn ( player, account, pass ) == true) then outputChatBox ( "Sikeresen regisztráltál!") outputChatBox ( "Regisztráció adatai : [ Felhasználónév ] : #00FF00" .. user .. " #FFFF1A[ Jelszó ] : #00FF00" .. pass) triggerClientEvent(player, "hideWindow", getRootElement()) else outputChatBox("Regisztrációs hiba!") end end end ) CLIENT SCRIPT --[[------------------------------------------------- Notes: > This code is using a relative image filepath. This will only work as long as the location it is from always exists, and the resource it is part of is running. To ensure it does not break, it is highly encouraged to move images into your local resource and reference them there. --]]------------------------------------------------- GUIEditor = { edit = {}, staticimage = {} } function mypanel() GUIEditor.staticimage[1] = guiCreateStaticImage(281, 257, 885, 361, "background_1.png", false) GUIEditor.staticimage[2] = guiCreateStaticImage(16, -41, 853, 70, "bar.png", false, GUIEditor.staticimage[1]) GUIEditor.edit[1] = guiCreateEdit(69, 114, 178, 33, "", false, GUIEditor.staticimage[1]) GUIEditor.edit[2] = guiCreateEdit(68, 187, 178, 33, "", false, GUIEditor.staticimage[1]) GUIEditor.staticimage[3] = guiCreateStaticImage(83, 267, 153, 48, "button_standart.png", false, GUIEditor.staticimage[1]) GUIEditor.staticimage[4] = guiCreateStaticImage(68, 157, 32, 30, "login_icon.png", false, GUIEditor.staticimage[1]) GUIEditor.edit[3] = guiCreateEdit(646, 114, 178, 33, "", false, GUIEditor.staticimage[1]) GUIEditor.staticimage[5] = guiCreateStaticImage(655, 267, 158, 43, "button_standart.png", false, GUIEditor.staticimage[1]) GUIEditor.edit[4] = guiCreateEdit(646, 188, 178, 33, "", false, GUIEditor.staticimage[1]) GUIEditor.staticimage[6] = guiCreateStaticImage(645, 158, 32, 30, "login_icon.png", false, GUIEditor.staticimage[1]) showCursor(true) guiSetInputEnabled(true) --addeventhandlers addEventHandler("onClientGUIClick", GUIEditor.staticimage[3], login) addEventHandler("onClientGUIClick", GUIEditor.staticimage[5], register) --ha rámegy akkor átváltozik addEventHandler ( "onClientMouseEnter", GUIEditor.staticimage[3], function () guiStaticImageLoadImage(GUIEditor.staticimage[3], "button_mouse.png") playSound("http://www.flashkit.com/imagesvr_ce/flashkit/soundfx/Interfaces/Blips/Blip_1-Surround-7482/Blip_1-Surround-7482_hifi.mp3") end ,false ) addEventHandler ( "onClientMouseEnter", GUIEditor.staticimage[5], function () guiStaticImageLoadImage(GUIEditor.staticimage[5], "button_mouse.png") playSound("http://www.flashkit.com/imagesvr_ce/flashkit/soundfx/Interfaces/Blips/Blip_1-Surround-7482/Blip_1-Surround-7482_hifi.mp3") end ,false ) addEventHandler ( "onClientMouseLeave", GUIEditor.staticimage[5], function () guiStaticImageLoadImage(GUIEditor.staticimage[5], "button_standart.png") end ,false ) --ha lelép róla visszaváltozik addEventHandler ( "onClientMouseLeave", GUIEditor.staticimage[3], function () guiStaticImageLoadImage(GUIEditor.staticimage[3], "button_standart.png") end ,false ) end addEventHandler("onClientResourceStart", resourceRoot, mypanel) function login() triggerServerEvent("onlogin", getRootElement(), getLocalPlayer(), guiGetText(GUIEditor.edit[1]), guiGetText(GUIEditor.edit[2]) ) end function register() triggerServerEvent("onregister", getRootElement(), getLocalPlayer(), guiGetText(GUIEditor.edit[3]), guiGetText(GUIEditor.edit[4]) ) end addEvent("hideWindow", true) addEventHandler ("hideWindow", getRootElement(), function() for i,v in ipairs(edit) do ---destroy all mywind if isElement(v) then destroyElement(v) end end showCursor(false) end) addEventHandler("onClientRender", root, function() dxDrawText("MTA RP PROJECT - ÁTNEVEZÉSRE VÁR -", 540, 257, 864, 281, tocolor(255, 255, 255, 255), 1.00, "pricedown", "left", "top", false, false, true, false, false) dxDrawText("Bejelentkezés", 356, 303, 563, 346, tocolor(255, 255, 255, 255), 1.00, "pricedown", "left", "top", false, false, true, false, false) dxDrawText("Bejelentkezés", 379, 536, 522, 568, tocolor(255, 255, 255, 255), 0.70, "pricedown", "left", "top", false, false, true, false, false) dxDrawText("Felhasználónév", 359, 346, 530, 371, tocolor(255, 255, 255, 255), 0.60, "bankgothic", "left", "top", false, false, true, false, false) dxDrawText("Jelszó", 382, 424, 553, 449, tocolor(255, 255, 255, 255), 0.60, "bankgothic", "left", "top", false, false, true, false, false) dxDrawText("Regisztráció", 928, 305, 1135, 348, tocolor(255, 255, 255, 255), 1.00, "pricedown", "left", "top", false, false, true, false, false) dxDrawText("Felhasználónév", 944, 348, 1115, 373, tocolor(255, 255, 255, 255), 0.60, "bankgothic", "left", "top", false, false, true, false, false) dxDrawText("Regisztráció", 959, 533, 1108, 561, tocolor(255, 255, 255, 255), 0.70, "pricedown", "left", "top", false, false, true, false, false) dxDrawText("Jelszó", 958, 424, 1125, 447, tocolor(255, 255, 255, 255), 0.60, "bankgothic", "left", "top", false, false, true, false, false) end )
  6. And how to stream URL-s? Cause in the syntax description it only shows the path. Do I need to write like the youtube link there?
  7. How can I do that so while something is active (eg a gui panel) theres a music playing in the background? Can I do it like in PAWN, so with an URL pointing to the music itself, so it wont download anything? Thanks for the answers
  8. So I should get the button positions, and replace absoluteX and absoluteY?
  9. So yea, if his cursor is over the image, doesnt click but it stands there, then it changes the picture. I want so when he hovers his mouse over the image, it changes into another button that has a border. The only thing I ask now is how can I make it so it will change the picture
  10. Thank you Prestege, I'm gonna try this out! How can I make that so if the player cursor is on the image, it turns into another image? like mouseOver in Javascript.
  11. I used guiCreateStaticImage, how can I make it clickable then? Cause I didn't understand the last answer.
  12. I want to put images in the MTA server, is there any function with I can trigger an event if the user clicks on the picture? Like onClientGUIClick, but instead of a gui button, you have to click on an image
  13. Wes

    MTA Dayz

    You can't, you have to buy the gamemode in order to change stuff in there
  14. Wes

    login panel

    Thank you for your help!
  15. Wes

    login panel

    Thank you, could you tell me what you changed?
  16. Wes

    login panel

    function clientSubmitLogin(button, state) if button == "left" and state == "up" then local username = guiGetText(username) local password = guiGetText(password) if username and password then triggerServerEvent("submitLogin", localPlayer, username, password) guiSetInputEnabled(false) guiSetVisible(showLoginPanel, false) showCursor(false) end end end addEventHandler("onClientGUIClick", bejelentkezes, clientSubmitLogin, false) ^^^^^^ This is the line 61
  17. Wes

    login panel

    WARNING: RP\c_login.lua:61: Bad Argument @ addEventHandler [Expected element at argument 2, got nil]
  18. Wes

    login panel

    What edited script? I made it myself, using a tutorial.. This is the GUI setup: UIEditor = { tabpanel = {}, window = {} } function showLoginPanel() GUIEditor.window[1] = guiCreateWindow(457, 348, 603, 277, "MTAProject Bejelentkezés & Regisztráció", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.tabpanel[1] = guiCreateTabPanel(27, 27, 544, 229, false, GUIEditor.window[1]) tabLogin = guiCreateTab("Bejelentkezés", GUIEditor.tabpanel[1]) username = guiCreateEdit(144, 25, 242, 30, "dsa", false, tabLogin) password = guiCreateEdit(144, 99, 242, 30, "dsa", false, tabLogin) bejelentkezes = guiCreateButton(144, 146, 236, 44, "Bejelentkezés", false, tabLogin) tabRegister = guiCreateTab("Regisztráció", GUIEditor.tabpanel[1]) regusername = guiCreateEdit(144, 25, 242, 30, "da", false, tabRegister) regpassword = guiCreateEdit(144, 99, 242, 30, "da", false, tabRegister) register = guiCreateButton(144, 146, 236, 44, "Regisztráció", false, tabRegister) --Regisztrációnál használatos label regFelhasznLabel = guiCreateLabel(49, 32, 242, 30, "Felhasználónév:", false, tabRegister) regJelszoLabel = guiCreateLabel(100, 105, 242, 30, "Jelszó:", false, tabRegister) guiSetFont(regFelhasznLabel, "default-bold-small") guiSetFont(regJelszoLabel, "default-bold-small") --Bejelentkezésnél használatos label felhasznLabel = guiCreateLabel(49, 32, 242, 30, "Felhasználónév:", false, tabLogin) jelszoLabel = guiCreateLabel(100, 105, 242, 30, "Jelszó:", false, tabLogin) guiSetFont(felhasznLabel, "default-bold-small") guiSetFont(jelszoLabel, "default-bold-small") showCursor(true) guiSetInputEnabled(true) end addEventHandler("onClientResourceStart", resourceRoot, showLoginPanel) function clientSubmitLogin(button, state) if button == "left" and state == "up" then local username = guiGetText(username) local password = guiGetText(password) if username and password then triggerServerEvent("submitLogin", localPlayer, username, password) guiSetInputEnabled(false) guiSetVisible(showLoginPanel, false) showCursor(false) end end end addEventHandler("onClientGUIClick", bejelentkezes, clientSubmitLogin, false) function loginHandler(username, password) local account = getAccount(username, password) if (account ~= false) then if (client) then logIn(client, account, password) spawnPlayer(client, 1959.55, -1714.46, 10) fadeCamera(client, true) setCameraTarget(client, client) outputChatBox("Üdv ismét," .. client .. "!") end else outputChatBox("Nem megfelelő felhasználónév / jelszó") end end addEvent("submitLogin", true) addEventHandler("submitLogin", root, loginHandler)
  19. Wes

    login panel

    Let me check
  20. Wes

    login panel

    Bad argument @ addEventHandler [Expected element at argument 2, got nil] This line addEventHandler("onClientGUIClick", bejelentkezes, clientSubmitLogin, false) bejelentkezes is the name of the button.
  21. Wes

    login panel

    Yea, still nothing
  22. Wes

    login panel

    Nope, still doesnt work.. If you post a solution could you explain why do I have to change that? So next time I'll learn from this.
  23. Wes

    login panel

    So I made a login panel, but it doesn't want to work When I click on the "Bejelentkezés" button it should log me into the account. But it doesnt Here is the source: CLIENTSIDE function clientsubmitLogin(button, state) if button == "left" and state == "up" then local username = guiGetText(username) local password = guiGetText(password) if username and password then triggerServerEvent("submitLogin", getRootElement(), localPlayer, username, password) guiSetInputEnabled(false) guiSetVisible(showLoginPanel, false) showCursor(false) end end end addEventHandler("onClientGUIClick", bejelentkezes, clientSubmitLogin, false) SERVERSIDE function loginHandler(username, password) local account = getAccount(username, password) if (account ~= false) then if (client) then logIn(client, username, password) spawnPlayer(client, 1959.55, -1714.46, 10) fadeCamera(client, true) setCameraTarget(client, client) outputChatBox("Üdv ismét," .. client .. "!") end else outputChatBox("Nem megfelelő felhasználónév / jelszó") end end addEvent("submitLogin", true) addEventHandler("submitLogin", root, loginHandler) Thanks for the help.
  24. So for example how can I save the positions that are in mid-air? Cause I wanna make camera positions like these: I dont know if you understand, I wanna make camera positions like this, from a higher directions, and put them into an array, then change the camera after a few seconds...
  25. Alright, I'm gonna try, the last question, how can I get positions in the air? So I wanna get positions in the air, how can I do that?
×
×
  • Create New...