Jump to content

Wes

Members
  • Posts

    76
  • Joined

  • Last visited

Details

  • Gang
    dark

Wes's Achievements

Transformer

Transformer (11/54)

0

Reputation

  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?
×
×
  • Create New...