Castillo Posted February 22, 2012 Share Posted February 22, 2012 This question has been already made in another topic. You can't detect the player that killed you with a hunter, because the player dies when the vehicle blows up. Link to comment
Kenix Posted February 23, 2012 Share Posted February 23, 2012 http://bugs.mtasa.com/view.php?id=6883 Link to comment
Norhy Posted February 28, 2012 Author Share Posted February 28, 2012 Hi, again. So the Login GUI Worked. But.. I have a problem. So i created a account Name: "Norhy", Password: "Password". So, now when i connect to my Test server, the GUI appears, i type the Username and Password. But then, it doesn't log me in. Draken helped me before with the script, it worked. But just this one isn't working. I'm testing the Login GUI on a Race server so when someone login he has to wait until the next map. The Script: - Server: addEvent("submitLogin",true) function loginHandler(thePlayer,username,password) local account = getAccount ( username, password ) if account ~= false then logIn ( thePlayer, username, password ) outputChatBox("Nie si registrovaný? Stlač F8 a napíš register MENO HESLO.", thePlayer) else outputChatBox("Zle zadane Meno alebo Heslo, skus znova prosim.",thePlayer) end end addEventHandler("submitLogin",root,loginHandler) - Client: wdwLogin = guiCreateWindow(0.375, 0.375, 0.25, 0.25, "Prosim prihlas sa", true) guiCreateLabel(0.0825, 0.2, 0.25, 0.25, "Meno", true, wdwLogin) guiCreateLabel(0.0825, 0.5, 0.25, 0.25, "Heslo", true, wdwLogin) edtUser = guiCreateEdit(0.415, 0.2, 0.5, 0.15, "", true, wdwLogin) edtPass = guiCreateEdit(0.415, 0.5, 0.5, 0.15, "", true, wdwLogin) guiEditSetMaxLength(edtUser, 50) guiEditSetMaxLength(edtPass, 50) btnLogin = guiCreateButton(0.415, 0.7, 0.25, 0.2, "Prihlasit", true, wdwLogin) guiSetVisible(wdwLogin, false) addEventHandler("onClientResourceStart", resourceRoot, function () guiSetVisible(wdwLogin, true) showCursor(true) guiSetInputEnabled(true) end ) addEventHandler('onClientGUIClick',root, function() if source == btnLogin then local user = guiGetText(edtUser) local pass = guiGetText(edtPass) if user and pass then triggerServerEvent('submitLogin',localPlayer,user,pass) guiSetInputEnabled(false) showCursor(false) guiSetVisible(wdwLogin,false) else outputChatBox("Prosim napis svoje meno a heslo.") end end end ) Link to comment
Kenix Posted February 28, 2012 Share Posted February 28, 2012 Server addEvent( "submitLogin",true ) function loginHandler( username,password ) local account = getAccount ( username, password ) if account ~= false then logIn ( source, username, password ) outputChatBox("Nie si registrovany? Stlac F8 a napis register MENO HESLO.", source ) else outputChatBox("Zle zadane Meno alebo Heslo, skus znova prosim.",source ) end end addEventHandler( "submitLogin",root,loginHandler ) Because you use password with logIn player .( password is not element ) You need use element for login ( source event = player ). Link to comment
Norhy Posted February 28, 2012 Author Share Posted February 28, 2012 Didn't worked, still doing the same thing. Link to comment
Kenix Posted February 28, 2012 Share Posted February 28, 2012 addEvent( "submitLogin",true ) function loginHandler( username,password ) local account = getAccount ( username, password ) if account then logIn ( source, account, password ) outputChatBox("Nie si registrovany? Stlac F8 a napis register MENO HESLO.", source ) else outputChatBox("Zle zadane Meno alebo Heslo, skus znova prosim.",source ) end end addEventHandler( "submitLogin",root,loginHandler ) Because 2 argument in function logIn is account ( element )( not string ). But you use string I did not notice. Link to comment
Norhy Posted February 28, 2012 Author Share Posted February 28, 2012 It does suck to say, but it doesn't worked Link to comment
Norhy Posted February 28, 2012 Author Share Posted February 28, 2012 You get any error? No Link to comment
Norhy Posted February 29, 2012 Author Share Posted February 29, 2012 Still not working, could you test if it's working for you? Maybe there's something wrong with my PC.. Link to comment
Norhy Posted February 29, 2012 Author Share Posted February 29, 2012 http://www.mediafire.com/?s7al3ze9557wl53 Link to comment
Kenix Posted February 29, 2012 Share Posted February 29, 2012 Omg I show you code addEvent( "submitLogin",true ) function loginHandler( username,password ) local account = getAccount ( username, password ) if account then logIn ( source, account, password ) outputChatBox("Nie si registrovany? Stlac F8 a napis register MENO HESLO.", source ) else outputChatBox("Zle zadane Meno alebo Heslo, skus znova prosim.",source ) end end addEventHandler( "submitLogin",root,loginHandler ) Because 2 argument in function logIn is account ( element )( not string ). But you use string I did not notice. Why you not use? Link to comment
Norhy Posted February 29, 2012 Author Share Posted February 29, 2012 Hmm, i know why. I use Notepad++ and i think it save the file wrong.. Sorry Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now