Jump to content

Jaysds1

Members
  • Posts

    4,961
  • Joined

  • Last visited

Everything posted by Jaysds1

  1. Jaysds1

    Problems

    thank, I've been putting the login gui bigger to fit the whole screen.
  2. Jaysds1

    Problems

    This forum is only for my problems and the answers for them. I need to know how to make the background blank and the Login GUI visible, and when they press login it spawns them.
  3. thnx and how do you make a button that makes the person logout?
  4. Jaysds1

    Login

    SORRY, My bad!
  5. I left it like that because you could put anything there if u want.
  6. NICEEEEEEE!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  7. Jaysds1

    GUI Problem

    you added the in the wrong place. Here addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function() guiSetVisible(FGUI, false) showCursor(false) end) function fenster() FGUI = guiCreateWindow(287,118,241,371,"Fuehrerschein",false) Fbeenden = guiCreateButton(43,305,157,48,"Schliessen",false,FGUI) BarZahlen = guiCreateButton(43,243,157,48,"Bar (800$)",false,FGUI) FText = guiCreateLabel(14,32,213,123,"Hier kannst du nun einen \nFuehrerschein kaufen! Der \nFuehrerschein kostet 800$\nNach dem Kauf musst du einige\nFragen beantworten und dann eine\nStrecke fahren! Du kannst\nueber die Bank als auch Bar\nbezahlen!",false,FGUI) Bzahlen = guiCreateButton(43,179,157,48,"Bank (850$)",false,FGUI) guiSetVisible(FGUI, true) showCursor(true) addEventHandler("onClientGUIClick", Fbeenden, Schliessen) addEventHandler("onClientGUIClick", BarZahlen, Fuehrerkaufen) addEventHandler("onClientGUIClick", Bzahlen, FuehrerkaufenBank) end function Schliessen() guiSetVisible(FGUI, false) showCursor(false) end function Fuehrerkaufen(button,state) local player = getLocalPlayer() local schein = "1" local preis = "-800" if getPlayerMoney(player) >= 800 then if getElementData(player, "Scheine") == 0 then setElementData(player, "Schein", tonumber(schein)) givePlayerMoney ( player, tonumber(preis) ) else outputChatBox("Du hast schon einen Führerschein!",player,255,0,0) end else outputChatBox("Du kannst das nicht kaufen!",player) end end function FuehrerkaufenBank(button,state) local player = getLocalPlayer() local schein = "1" local preis = "-850" if getElementData(player, "Bank") >= 850 then if getElementData(player, "Scheine") == 0 then setElementData(player, "Schein", tonumber(schein)) setElementData(player, "Bank", tonumber(preis)) else outputChatBox("Du hast schon einen Führerschein!",player,255,0,0) end else outputChatBox("Du hast nicht genug Geld! Es kostet 800$",player,255,0,0) end end addCommandHandler ( "fuehrerscheingui", fenster )
  8. do u have a gui for spawning the players? if you do show me the script for it.
  9. function pVeh = getPedOccupiedVehicle ( localPlayer ) vehLog = {} if not vehLog[pVeh] then logX, logY = guiGetPosition ( logPane, false ) lodW, logH = guiGetSize ( logPane, false ) vehLog[pVeh] = guiCreateScrollPane ( logX, logY, logW, logH, false, mainWnd.window ) guiSetVisible ( vehLog[pVeh], false ) end end -- logPane is a VALID gui scrollpane, with mainWnd.window as parent. -- mainWnd.window is a VALID gui-window ofcourse.
  10. so what is this again?
  11. what is the error message?
  12. Here is a in-game resource to create gates https://community.multitheftauto.com/index.php?p=resources&s=details&id=614
  13. now I'm trying to change something in here and it's the server-side If a person all ready has and account and someone else want's it. How do you stop them from taking the reserved Username?
  14. Server-side --Login/Register Gui function clientAttemptLogin(username,password) local userAccount = getAccount(username) local tryToLog if (client) then tryToLog = logIn(client,userAccount,password) if (tryToLog) then spawnPlayer(client,x,y,z) fadeCamera(client,true) end end end addEvent("submitLogin",true) addEventHandler("submitLogin",root,loginHandler) function clientAttemptCreate(username,password) if (username ~= "" and password ~= "") then addAccount(username,password) outputChatBox("ACCOUNT CREATED, NOW LOGIN!", client) else outputChatBox("REGISTER WASN'T SUCCESSFUL!", client) end end addEvent("submitRegister",true) addEventHandler("submitRegister",getRootElement(),clientAttemptCreate)
  15. it didn't work. This time it removed the cursor when it went back on to the Login GUI.
  16. Here -- Login/Register local newUser local localPlayer = getLocalPlayer() local localPlayerName = getPlayerName(localPlayer) local localRootElement = getRootElement() local passwordAttempts = 0 GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Edit = {} function CreateLoginWindow() GUIEditor_Window[1] = guiCreateWindow(230,160,336,265,"J Login",false) guiSetAlpha(GUIEditor_Window[1],1) guiWindowSetMovable(GUIEditor_Window[1],false) guiWindowSetSizable(GUIEditor_Window[1],false) -- Buttons GUIEditor_Button[1] = guiCreateButton(22,184,143,40,"Login",false,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(201,184,123,44,"Register",false,GUIEditor_Window[1]) -- Labels guiCreateLabel(35,48,87,21,"Username:",false,GUIEditor_Window[1]) guiCreateLabel(37,90,53,17,"Password:",false,GUIEditor_Window[1]) -- Type in... GUIEditor_Edit[1] = guiCreateEdit(133,45,171,27,"",false,GUIEditor_Window[1]) guiEditSetMaxLength(GUIEditor_Edit[1],23) GUIEditor_Edit[2] = guiCreateEdit(128,95,186,28,"",false,GUIEditor_Window[1]) guiEditSetMasked(GUIEditor_Edit[2],true) guiEditSetMaxLength(GUIEditor_Edit[2],13) end GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Edit = {} function CreateRegisterWindow() GUIEditor_Window[1] = guiCreateWindow(197,122,369,330,"Register",false) guiSetAlpha(GUIEditor_Window[1],1) guiWindowSetMovable(GUIEditor_Window[1],false) guiWindowSetSizable(GUIEditor_Window[1],false) guiCreateLabel(39,48,64,15,"Username:",false,GUIEditor_Window[1]) guiCreateLabel(43,119,66,15,"Password:",false,GUIEditor_Window[1]) -- Type in... GUIEditor_Edit[1] = guiCreateEdit(122,49,205,26,"",false,GUIEditor_Window[1]) guiEditSetMaxLength(GUIEditor_Edit[1],23) GUIEditor_Edit[2] = guiCreateEdit(121,114,205,29,"",false,GUIEditor_Window[1]) guiEditSetMasked(GUIEditor_Edit[2],true) guiEditSetMaxLength(GUIEditor_Edit[2],13) -- Image guiCreateStaticImage(19,168,117,114,"images/mtalogo.png",false,GUIEditor_Window[1]) -- Buton GUIEditor_Button[1] = guiCreateButton(154,270,111,45,"Login",false,GUIEditor_Window[1]) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function() CreateLoginWindow() -- if the GUI was successfully created, then show the GUI to the player if (GUIEditor_Window[1] ~= nil) then guiSetVisible(GUIEditor_Window[1], true) else -- if the GUI hasnt been properly created, tell the player outputChatBox("An unexpected error has occurred and the log in GUI has not been created.") end -- enable the players cursor (so they can select and click on the components) showCursor(true) -- set the input focus onto the GUI, allowing players (for example) to press 'T' without the chatbox opening guiSetInputEnabled(true) -- now add our onClientGUIClick event to the button we just created addEventHandler("onClientGUIClick",GUIEditor_Button[1], clientSubmitLogin, false) addEventHandler("onClientGUIClick",GUIEditor_Button[2], clientClickReg,false) end ) -- create the function and define the 'button' and 'state' parameters -- (these are passed automatically by onClientGUIClick) function clientSubmitLogin(button,state) if button == "left" and state == "up" then -- get the text entered in the 'username' field local username = guiGetText(GUIEditor_Edit[1]) -- get the text entered in the 'password' field local password = guiGetText(GUIEditor_Edit[2]) -- if the username and password both exist if username and password then -- trigger the server event 'submitLogin' and pass the username and password to it triggerServerEvent("submitLogin", getRootElement(), username, password) -- hide the gui, hide the cursor and return control to the player guiSetInputEnabled(false) guiSetVisible(GUIEditor_Window[1], false) showCursor(false) else -- otherwise, output a message to the player, do not trigger the server -- and do not hide the gui outputChatBox("Please enter a username and password.") end end end function clientClickReg() guiSetVisible(CreateRegisterWindow(),true) if (GUIEditor_Window[1] ~= nil) then guiSetVisible(GUIEditor_Window[1], true) else -- if the GUI hasnt been properly created, tell the player outputChatBox("An unexpected error has occurred and the log in GUI has not been created.") end -- enable the players cursor (so they can select and click on the components) showCursor(true) -- set the input focus onto the GUI, allowing players (for example) to press 'T' without the chatbox opening guiSetInputEnabled(true) -- now add our onClientGUIClick event to the button we just created addEventHandler("onClientGUIClick",GUIEditor_Button[1], clientSubmitRegister, false) end -- create the function and define the 'button' and 'state' parameters -- (these are passed automatically by onClientGUIClick) function clientSubmitRegister(button,state) if button == "left" and state == "up" then -- get the text entered in the 'username' field local username = guiGetText(GUIEditor_Edit[1]) -- get the text entered in the 'password' field local password = guiGetText(GUIEditor_Edit[2]) -- if the username and password both exist if username and password then -- trigger the server event 'submitLogin' and pass the username and password to it triggerServerEvent("submitRegister", getRootElement(), username, password) -- hide the gui, hide the cursor and return control to the player guiSetInputEnabled(false) guiSetVisible(GUIEditor_Window[1], false) showCursor(false) end end end
  17. and the problem that you having about did you touch the meta.xml file? If you did and added or removed then that's why the error would show.
  18. When people register on Register GUI and it closes and go to the Login Gui and login the gui is still shown. How do you put it down too?
  19. No Say I was a new member and I was trying to register my account, right now it's on the Login GUI and if I clicked the Register Button on the Login GUI, I want it to go to the register Gui then the login after.
  20. so every time you download a resource and merge it with the freeroam resource?
×
×
  • Create New...