Jump to content

ben_wright

Members
  • Posts

    63
  • Joined

  • Last visited

Everything posted by ben_wright

  1. ben_wright

    Freeroam

    /getpos is a scripted command from Valhalla, not freeroam. It's /gp I assume you think valhalla commands and scripts are there from default MTA. /gp -- getpos
  2. ben_wright

    Login.

    mysql = exports.mysql -- add this anywhere on serverside, and correct it to yours
  3. https://forum.multitheftauto.com/viewtop ... 91&t=33798
  4. Clear the sql log and pw then post here
  5. https://wiki.multitheftauto.com/wiki/DxDrawText onClientRender
  6. ben_wright

    timer

    just to help out, you'll have to save that data when the player logs in/out, especially if it's going to be on 1 hour cooldown.
  7. ben_wright

    timer

    setElementData
  8. ben_wright

    Login.

    debugscript. this line: local acc = mysql_query(connect, "SELECT * FROM `accounts` WHERE `login` = '"login"' AND `password` = '"pass"'") syntax errors. Post the current code, server & client you are using.
  9. ben_wright

    Login.

    what exactly is bugged? using what I've posted earlier and the snippet above should do the trick.
  10. ben_wright

    Login.

    addEvent("submitLogin", true) addEventHandler("submitLogin", root, function(login, pass) local acc = mysql_query(connect, "SELECT * FROM `accounts` WHERE `login` = '%s' AND `pass` = '%s'", login, pass) if acc then outputChatBox("Zalogowano.", source) triggerClientEvent ( "yourEvent", source ) else outputChatBox("#EE5555* #C0C0C0Podano zly #EE5555Login #C0C0C0lub #EE5555Haslo#C0C0C0!", source, 255, 255, 255, true) triggerServerEvent(source, "tryAgain", getRootElement()) end end) use this method instead of, well.. yours. and something like, function yourEvent() guiSetVisible ( loginButton, false ) -- insert the rest here end addEvent("yourEvent") addEventHandler("yourEvent", localPlayer, yourEvent)
  11. ben_wright

    Login.

    addEventHandler("onClientResourceStart", root, function() loginButton = guiCreateButton(634, 323, 117, 37, "Zaloguj!", false) addEventHandler("onClientGUIClick", loginButton, function(button, state) if button == "left" and state == "up" then local login = guiGetText( loginBox ) local pass = guiGetText( passBox ) if login and pass then triggerServerEvent("submitLogin", localPlayer, login, pass) local elements = { loginButton, loginPassLabel, registerLabel, loginBox, passBox, keyImage } destroyElement( elements ) guiSetInputEnabled( false ) showCursor( false ) removeEventHandler("onClientRender",root,createDxOnLogin) else outputChatBox("#EE5555* #C0C0C0Prosze wpisac #EE5555Login #C0C0C0oraz #EE5555Haslo#C0C0C0, aby sie zalogowac!", 255, 255, 255, true) end end end, false ) loginPassLabel = guiCreateLabel( 481, 244, 48, 56, "Login:\n\n\nHaslo:", false ) guiSetFont(loginPassLabel,"default-bold-small") registerLabel = guiCreateLabel( 363, 424, 397, 86, "Jesli nie posiadasz konta, udaj sie na nasze forum i zarejestruj konto.\nKolejnym krokiem bedzie zalozenie postaci.\n\n\n[url=http://www.LostHeaven.pl]http://www.LostHeaven.pl[/url]", false ) guiSetFont(registerLabel,"default-bold-small") loginBox = guiCreateEdit( 525, 241, 145, 23, "", false ) guiEditSetMaxLength( loginBox, 25 ) passBox = guiCreateEdit( 525, 281, 145, 23, "", false ) guiEditSetMasked( passBox, true ) guiEditSetMaxLength( passBox, 30 ) keyImage = guiCreateStaticImage( 358, 237, 111, 94, "images/Key.png", false ) --outputChatBox("Dupa1") showCursor( true ) guiSetInputEnabled( true ) --outputChatBox("Dupa2") addEventHandler("onClientRender", root, createDxOnLogin) end) use triggerClientEvent on serverside then trigger an event with guiSetVisible.
×
×
  • Create New...