MACIEKW89 Posted October 20, 2013 Share Posted October 20, 2013 (edited) Hi! I have a problem with my Login Panel. Register not found. Nothing in debugscript. Code: --Rejestracja-- addEventHandler("onClickRegister", getRootElement(), function(plr, username, password) local account = getAccount(username, password) if (account ~= false) then outputChatBox("This account is already exists!", plr, 255 , 0, 0) else local accountAdd = addAccount(username, password) if(logIn(plr, accountAdd, password) == true) then outputChatBox("You have successfully registered your account!", plr, 0 , 255, 0) triggerClientEvent("onSuccessRegister", getRootElement()) else outputChatBox("Error 2 - Register line 39 REPORT TO ADMIN!", plr, 255 , 0, 0) end end end) I add the resource to Admin group in ACL. Help me please Edited October 20, 2013 by Guest Link to comment
TAPL Posted October 20, 2013 Share Posted October 20, 2013 For custom events this function is needed. addEvent Link to comment
MACIEKW89 Posted October 20, 2013 Author Share Posted October 20, 2013 I add Event on start code. First : addEvent Second : Login & Register Link to comment
isa_Khamdan Posted October 20, 2013 Share Posted October 20, 2013 I add Event on start code. First : addEvent Second : Login & Register you didn't add the event in your code. Link to comment
MACIEKW89 Posted October 20, 2013 Author Share Posted October 20, 2013 -.- --[[--------------------------------- | Panel Logowania by MACIEKW89 | | Strona Serwera | -----------------------------------]] addEvent("onClickLogin", true) addEvent("onClickRegister", true) addEvent("onLoginSpawn", true) addEvent("onRegisterSpawn", true) --Logowanie-- addEventHandler("onClickLogin", getRootElement(), function(plr, username, password) local account = getAccount(username, password) if (account ~= false) then if (logIn(plr, account, password) == true) then outputChatBox("Zalogowano pomyślnie", plr, 0, 255, 0) triggerClientEvent("onSuccessLogin", getRootElement()) else outputChatBox("Błąd 1 - Logowanie lin.19 ZGŁOŚ ADMINOWI!", plr, 255, 0, 0) end else outputChatBox("Błędny login lub hasło!", plr, 255, 0, 0) end end) --Rejestracja-- addEventHandler("onClickRegister", getRootElement(), function(plr, username, password) local account = getAccount(username, password) if (account ~= false) then outputChatBox("Takie konto już istnieje!", plr, 255 , 0, 0) else local accountAdd = addAccount(username, password) if(logIn(plr, accountAdd, password) == true) then outputChatBox("Zarejestrowano pomyślnie!", plr, 0 , 255, 0) triggerClientEvent("onSuccessRegister", getRootElement()) else outputChatBox("Błąd 2 - Rejestracja lin.39 ZGŁOŚ ADMINOWI!", plr, 255 , 0, 0) end end end) --Spawn-- addEventHandler ("onLoginSpawn", getRootElement(), function(player) fadeCamera(player, true) setCameraTarget(player, player) setGameType ( "ZombieMode v1.0" ) setMapName ( "San Zombies" ) end) addEventHandler("onRegisterSpawn", getRootElement(), function(player) local x = 2491.57 local y = -1672.27 local z = 13.3359 spawnPlayer(player, x, y, z) fadeCamera(player, true) setCameraTarget(player, player) setGameType ( "ZombieMode v1.0" ) setMapName ( "San Zombies" ) giveWeapon(player, 29, 1000) end) --Respawn-- addEventHandler( "onPlayerWasted", getRootElement(), function() setTimer( spawnPlayer, 5000, 1, source, 2491.57, -1672.27, 13.3359 ) end) Here is my full code (server-side). Link to comment
Jaysds1 Posted October 21, 2013 Share Posted October 21, 2013 Try this: --[[--------------------------------- | Panel Logowania by MACIEKW89 | | Strona Serwera | -----------------------------------]] addEvent("onClickLogin", true) addEvent("onClickRegister", true) addEvent("onLoginSpawn", true) addEvent("onRegisterSpawn", true) setGameType ( "ZombieMode v1.0" ) setMapName ( "San Zombies" ) --Logowanie-- addEventHandler("onClickLogin", getRootElement(), function(plr, username, password) local account = getAccount(username, password) if (account ~= false) then if (logIn(plr, account, password)) then outputChatBox("Zalogowano pomyślnie", plr, 0, 255, 0) triggerClientEvent("onSuccessLogin", getRootElement()) else outputChatBox("Błąd 1 - Logowanie lin.19 ZGŁOŚ ADMINOWI!", plr, 255, 0, 0) end else outputChatBox("Błędny login lub hasło!", plr, 255, 0, 0) end end) --Rejestracja-- addEventHandler("onClickRegister", getRootElement(), function(plr, username, password) local account = getAccount(username, password) if (account ~= false) then outputChatBox("Takie konto już istnieje!", plr, 255 , 0, 0) else local accountAdd = addAccount(username, password) if(logIn(plr, accountAdd, password)) then outputChatBox("Zarejestrowano pomyślnie!", plr, 0 , 255, 0) triggerClientEvent("onSuccessRegister", getRootElement()) else outputChatBox("Błąd 2 - Rejestracja lin.39 ZGŁOŚ ADMINOWI!", plr, 255 , 0, 0) end end end) --Spawn-- addEventHandler ("onLoginSpawn", getRootElement(), function(player) fadeCamera(player, true) setCameraTarget(player, player) end) addEventHandler("onRegisterSpawn", getRootElement(), function(player) local x = 2491.57 local y = -1672.27 local z = 13.3359 spawnPlayer(player, x, y, z) fadeCamera(player, true) setCameraTarget(player, player) giveWeapon(player, 29, 1000) end) --Respawn-- addEventHandler( "onPlayerWasted", getRootElement(), function() setTimer( spawnPlayer, 5000, 1, source, 2491.57, -1672.27, 13.3359 ) end) That should work, if it doesn't then please tell us what's the problem and what you are trying to do. Link to comment
MACIEKW89 Posted October 21, 2013 Author Share Posted October 21, 2013 I have to do a register when I Click on the button then create window with 2 edit box. Login and Password. If I click on the button "Register" then script register new account. This script don't register me Link to comment
Jaysds1 Posted October 21, 2013 Share Posted October 21, 2013 I would need to see both the client and server side files... If you don't want to share it on this forum, just send it to me through PM. 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