Tete omar Posted July 24, 2012 Share Posted July 24, 2012 client side function registering() if ( source == GUIEditor_Button[4] ) then local g_textR = guiGetText( GUIEditor_Edit[3] ) local g_textR2 = guiGetText( GUIEditor_Edit[4] ) local g_textR3 = guiGetText( GUIEditor_Edit[5] ) triggerServerEvent("g_textToRegister", getRootElement(), getLocalPlayer(), g_textR, g_textR2, g_textR3) end end addEventHandler("onClientGUIClick", getRootElement(), registering) server side function g_textToRegister( player, user, password, g_textR3) if password == g_textR3 then account = addAccount ( user, password ) else triggerClientEvent(player,"confirmError",player) if (logIn ( player, account2, password ) == true) then outputChatBox ( "successfully registered, welcome ".. getPlayerName( source ), player, 255, 255, 0 , true ) randomModel = math.random( 26, 37 ) setElementModel ( player, randomModel ) else triggerClientEvent(player,"registerEroor",player) end end end addEvent("g_textToRegister", true) addEventHandler("g_textToRegister", getRootElement(), g_textToRegister) every " else " that i put were happened, registerError and confirmError sorry, I've been confused with this code Link to comment
TAPL Posted July 24, 2012 Share Posted July 24, 2012 try function g_textToRegister(player, user, password, g_textR3) if password ~= g_textR3 then triggerClientEvent(player,"confirmError",player) return end if getAccount(user) then -- the Account already registred before.. return end local account = addAccount(user, password) if logIn(player, account, password) then outputChatBox("successfully registered, welcome "..getPlayerName(player), player, 255, 255, 0 , true) randomModel = math.random(26, 37) setElementModel(player, randomModel) else triggerClientEvent(player,"registerEroor",player) end end addEvent("g_textToRegister", true) addEventHandler("g_textToRegister", root, g_textToRegister) Link to comment
Tete omar Posted July 24, 2012 Author Share Posted July 24, 2012 (edited) i have another problem if #guiGetText ( GUIEditor_Edit[6] ) == 0 then guiSetVisible( GUIEditor_Label[15], true ) setTimer( guiSetVisible, 3000, 1, GUIEditor_Label[15], false ) return end i want here if gui-edit[6] wasn't completed then stop every thing and show the error inside the gui-label[15] Edited July 24, 2012 by Guest Link to comment
Al3grab Posted July 24, 2012 Share Posted July 24, 2012 i have another problems if #guiGetText ( GUIEditor_Edit[6] ) == 0 then guiSetVisible( GUIEditor_Label[15], true ) setTimer( guiSetVisible, 3000, 1, GUIEditor_Label[15], false ) return end i want here if gui-edit[6] wasn't completed then stop every thing and show the error inside the gui-label[15] Can you explain better ? Link to comment
TAPL Posted July 24, 2012 Share Posted July 24, 2012 you mean something like this? if guiGetText(GUIEditor_Edit[6]) == "" then Link to comment
Tete omar Posted July 24, 2012 Author Share Posted July 24, 2012 you mean something like this? if guiGetText(GUIEditor_Edit[6]) == "" then i tried to do it about 3 hours without avail Link to comment
Anderl Posted July 25, 2012 Share Posted July 25, 2012 You mean progress bar? Use "guiProgressBarGetProgress". Link to comment
Tete omar Posted July 25, 2012 Author Share Posted July 25, 2012 You mean progress bar? Use "guiProgressBarGetProgress". you're really out of the subject and no Link to comment
Anderl Posted July 25, 2012 Share Posted July 25, 2012 You mean progress bar? Use "guiProgressBarGetProgress". you're really out of the subject and no Maybe explaining in a proper english instead of wait for others to discover what you want would make me not being "out of subject". Link to comment
Jaysds1 Posted July 25, 2012 Share Posted July 25, 2012 (edited) try this, Client: function registering() if ( source == GUIEditor_Button[4] ) then local g_textR = guiGetText( GUIEditor_Edit[3] ) local g_textR2 = guiGetText( GUIEditor_Edit[4] ) local g_textR3 = guiGetText( GUIEditor_Edit[5] ) if g_textR ~= "" and g_textR2~="" and g_textR3~="" then --check if the field actually have something triggerServerEvent("g_textToRegister",localPlayer, g_textR, g_textR2, g_textR3) end end end addEventHandler("onClientGUIClick",guiRoot, registering) Server: function g_textToRegister( user, password, g_textR3) if password == g_textR3 then local account = addAccount ( user, password ) else triggerClientEvent(client,"confirmError",root) return --automatically end the script if the password doesn't match end if logIn ( client, account, password) then --you used account2 instead of account outputChatBox ( "successfully registered, welcome ".. getPlayerName( client ), client, 255, 255, 0 , true ) randomModel = math.random( 26, 37 ) setElementModel ( client, randomModel ) else triggerClientEvent(client,"registerEroor",root) end end addEvent("g_textToRegister", true) addEventHandler("g_textToRegister",root, g_textToRegister) Edited July 25, 2012 by Guest Link to comment
Tete omar Posted July 25, 2012 Author Share Posted July 25, 2012 (edited) Listen andrel, if #guiGetText ( GUIEditor_Edit[6] ) == 0 then guiSetVisible( GUIEditor_Label[15], true ) setTimer( guiSetVisible, 3000, 1, GUIEditor_Label[15], false ) return end this is register code so GUIEditor_Edit[6] is the player's e-mail so if he typed nothing then guiSetVisible true to GUIEditor_Label[15] this gui-label is an error GUIEditor_Label[15] = guiCreateLabel(443,310,148,18,"enter your e-mail !",false,GUIEditor_Window[2]) i hope you understood me. Edited July 25, 2012 by Guest Link to comment
Tete omar Posted July 25, 2012 Author Share Posted July 25, 2012 try this,Client: function registering() if ( source == GUIEditor_Button[4] ) then local g_textR = guiGetText( GUIEditor_Edit[3] ) local g_textR2 = guiGetText( GUIEditor_Edit[4] ) local g_textR3 = guiGetText( GUIEditor_Edit[5] ) if g_textR ~= "" and g_textR2~="" and g_textR3~="" then --check if the field actually have something triggerServerEvent("g_textToRegister",localPlayer, g_textR, g_textR2, g_textR3) end end end addEventHandler("onClientGUIClick",guiRoot, registering) Server: function g_textToRegister( user, password, g_textR3) if password == g_textR3 then account = addAccount ( user, password ) else triggerClientEvent(client,"confirmError",root) return end if logIn ( client, account, password) then outputChatBox ( "successfully registered, welcome ".. getPlayerName( client ), client, 255, 255, 0 , true ) randomModel = math.random( 26, 37 ) setElementModel ( client, randomModel ) else triggerClientEvent(client,"registerEroor",root) end end addEvent("g_textToRegister", true) addEventHandler("g_textToRegister",root, g_textToRegister) jaysds this problem was solved i'm talking now about this if #guiGetText ( GUIEditor_Edit[6] ) == 0 then guiSetVisible( GUIEditor_Label[15], true ) setTimer( guiSetVisible, 3000, 1, GUIEditor_Label[15], false ) return end thanks anyway Link to comment
Anderl Posted July 25, 2012 Share Posted July 25, 2012 if #guiGetText ( GUIEditor_Edit[6] ) == 0 then guiSetVisible( GUIEditor_Label[15], true ) setTimer( guiSetVisible, 3000, 1, GUIEditor_Label[15], false ) return end if guiGetText ( GUIEditor_Edit[6] ) == "" then guiSetVisible( GUIEditor_Label[15], true ) setTimer( guiSetVisible, 3000, 1, GUIEditor_Label[15], false ) return end Link to comment
Tete omar Posted July 25, 2012 Author Share Posted July 25, 2012 (edited) if #guiGetText ( GUIEditor_Edit[6] ) == 0 then guiSetVisible( GUIEditor_Label[15], true ) setTimer( guiSetVisible, 3000, 1, GUIEditor_Label[15], false ) return end if guiGetText ( GUIEditor_Edit[6] ) == "" then guiSetVisible( GUIEditor_Label[15], true ) setTimer( guiSetVisible, 3000, 1, GUIEditor_Label[15], false ) return end it doesn't work, i see the error and the account was created.. ? i want if the Edit[6] is empty then stop the registering process. if full code needed then tell me Edited July 25, 2012 by Guest Link to comment
Anderl Posted July 25, 2012 Share Posted July 25, 2012 What happens? Errors? Did you check 'if'? Does label even shows? Nothing? Link to comment
Tete omar Posted July 25, 2012 Author Share Posted July 25, 2012 What happens? Errors? Did you check 'if'? Does label even shows? Nothing? the Label error is showing if the GUIEditor_Edit[6] is empty, but the registering process doesn't stop, it only show the label error Link to comment
Anderl Posted July 25, 2012 Share Posted July 25, 2012 Maybe because you added "return" to stop the function after the label shows? Link to comment
Tete omar Posted July 25, 2012 Author Share Posted July 25, 2012 so when/where you want "return" at ? 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