PATonyx97 Posted July 31, 2012 Share Posted July 31, 2012 Bien, intente crearla pero no me sale. He Aqui el codigo: Client: MailLogin = guiCreateWindow(429,193,514,237,"COC Mail Login",false) lblMailIDlogin = guiCreateLabel(101,53,49,18,"Mail ID:",false,MailLogin) lblPasswordLogin = guiCreateLabel(87,107,61,17,"Password:",false,MailLogin) btnLogin = guiCreateButton(169,142,182,27,"Login",false,MailLogin) editMailIDLogin = guiCreateEdit(171,49,171,25,"",false,MailLogin) editPasswordLogin = guiCreateEdit(171,101,171,25,"",false,MailLogin) btnExitLogin = guiCreateButton(36,186,182,27,"Exit",false,MailLogin) btnCreateMailLogin = guiCreateButton(303,186,182,27,"Create Mail",false,MailLogin) lblERRORSLogin = guiCreateLabel(173,77,276,19,"",false,MailLogin) guiWindowSetSizable(MailLogin,false) guiEditSetMasked ( editPasswordLogin, true ) ---------------------------------------------------------------------------------------------------------- MailRegister = guiCreateWindow(429,193,514,237,"COC Mail Register",false) editPasswordRegister = guiCreateEdit(171,70,171,25,"",false,MailRegister) editPassword2Register = guiCreateEdit(171,112,171,25,"",false,MailRegister) editMailIDRegister = guiCreateEdit(171,29,171,25,"",false,MailRegister) lblMailIDRegister = guiCreateLabel(108,34,47,17,"Mail ID:",false,MailRegister) lblPasswordRegister = guiCreateLabel(92,73,74,18,"Password:",false,MailRegister) lblPassword2Register = guiCreateLabel(47,116,101,16,"Confirm Password:",false,MailRegister) btnCreateRegister = guiCreateButton(181,152,147,30,"Create",false,MailRegister) btnCloseRegister = guiCreateButton(184,191,145,30,"Close",false,MailRegister) lblERRORSRegister = guiCreateLabel(357,72,146,18,"",false,MailRegister) guiSetVisible ( MailLogin, false ) guiSetVisible ( MailRegister, false ) guiWindowSetSizable(MailRegister,false) guiEditSetMasked ( editPasswordRegister, true ) guiEditSetMasked ( editPassword2Register, true ) ---------------------------------------------------------------------------------------------------------- COCMail = guiCreateWindow(244,167,926,530,"COC Mail",false) guiWindowSetSizable(COCMail,false) lblNameAccount1 = guiCreateLabel(19,45,120,18,"Your Name Account:",false,COCMail) lblNameAccount2 = guiCreateLabel(139,45,194,17,"",false,COCMail) btnRefresh = guiCreateButton(31,101,114,43,"Refresh",false,COCMail) btnNew = guiCreateButton(178,101,156,43,"New",false,COCMail) btnDelete = guiCreateButton(366,101,114,43,"Delete",false,COCMail) btnLogout = guiCreateButton(515,101,114,43,"Logout",false,COCMail) editMSN = guiCreateEdit(640,52,264,458,"",false,COCMail) gridMSN = guiCreateGridList(31,166,599,320,false,COCMail) guiEditSetReadOnly ( editMSN, true ) guiGridListSetSelectionMode(gridMSN,2) guiGridListAddColumn(gridMSN,"#",0.2) guiGridListAddColumn(gridMSN,"Sender",0.2) guiGridListAddColumn(gridMSN,"Subject",0.2) guiGridListAddColumn(gridMSN,"Time",0.2) for i = 1, 11 do guiGridListAddRow(gridMSN) end guiSetVisible ( COCMail, false ) ---------------------------------------------------------------------------------------------------------- windowCOCMailSendNewMail = guiCreateWindow(244,167,926,530,"COC Mail",false) guiWindowSetSizable(windowCOCMailSendNewMail,false) lblNameAccount3 = guiCreateLabel(19,45,120,18,"Your Name Account:",false,windowCOCMailSendNewMail) lblNameAccount4 = guiCreateLabel(139,45,194,17,"X97",false,windowCOCMailSendNewMail) memoMenssage = guiCreateMemo(23,159,876,297,"",false,windowCOCMailSendNewMail) lblTo = guiCreateLabel(153,83,31,17,"To:",false,windowCOCMailSendNewMail) lblSubject = guiCreateLabel(126,117,54,15,"Subject:",false,windowCOCMailSendNewMail) editSubject = guiCreateEdit(185,112,539,28,"",false,windowCOCMailSendNewMail) editTo = guiCreateEdit(185,77,539,28,"",false,windowCOCMailSendNewMail) btnSendNewMailBack = guiCreateButton(22,470,186,42,"Back",false,windowCOCMailSendNewMail) btnSendNewMailSend = guiCreateButton(713,470,186,42,"Send",false,windowCOCMailSendNewMail) guiSetVisible ( windowCOCMailSendNewMail, false ) ---------------------------------------------------------------------------------------------------------- puertaCerrada = createObject ( 2987, 364.5, 187.5, 1014.4 ) markerEntrada = createMarker ( 1726.8, -1636.69, 21.6, "arrow", 2, 214, 128, 6, 100 ) markerSalida = createMarker ( 364.399, 188, 1014.9, "arrow", 1, 214, 128, 6, 100 ) marker1 = createMarker ( 359.199, 189.1, 1013.2, "cylinder", 0.7, 255, 255, 255, 150 ) marker2 = createMarker ( 355.699, 189.1, 1013.2, "cylinder", 0.7, 255, 255, 255, 150 ) setElementInterior ( puertaCerrada, 3 ) setElementInterior ( markerSalida, 3 ) setElementInterior ( marker1, 3 ) setElementInterior ( marker2, 3 ) function entrar () setElementInterior ( getLocalPlayer(), 3 ) setElementPosition ( getLocalPlayer(), 364.1986, 189.196, 1014.187 ) outputChatBox ("Welcome To COC Ciber Cafe", getLocalPlayer(), 0, 255, 0) end addEventHandler ("onClientMarkerHit", markerEntrada, entrar) function entrar () setElementInterior ( getLocalPlayer(), 0 ) setElementPosition ( getLocalPlayer(), 1727.06, -1633.86, 20.215 ) outputChatBox ("Bye Bye!", getLocalPlayer(), 0, 255, 0) end addEventHandler ("onClientMarkerHit", markerSalida, entrar) function Mail () guiSetVisible ( MailLogin, true ) showCursor ( true ) setPedAnimation ( getLocalPlayer(), "INT_OFFICE", "OFF_Sit_Type_Loop" ) setElementPosition ( getLocalPlayer(), 358.458, 189.279, 1014.81 ) setElementFrozen ( getLocalPlayer(), true ) end addEventHandler ("onClientMarkerHit", marker1, Mail) function Mail2 () guiSetVisible ( MailLogin, true ) showCursor ( true ) setPedAnimation ( getLocalPlayer(), "INT_OFFICE", "OFF_Sit_Type_Loop" ) setElementPosition ( getLocalPlayer(), 356.445, 189.297, 1014.81 ) setElementFrozen ( getLocalPlayer(), true ) end addEventHandler ("onClientMarkerHit", marker2, Mail2) ---------------------------------------------------------------------------------------------------------- function ExitOfLogin ( button, state, absoluteX, absoluteY ) if (source == btnExitLogin) then guiSetVisible ( MailLogin, false ) showCursor ( false ) setElementFrozen ( getLocalPlayer(), false ) setElementPosition ( getLocalPlayer(), 357.252, 189.344, 1014.19 ) setPedAnimation ( getLocalPlayer() ) end end addEventHandler ("onClientGUIClick", getRootElement(), ExitOfLogin) function ExitOfRegister ( button, state, absoluteX, absoluteY ) if (source == btnCloseRegister) then guiSetVisible ( MailLogin, true ) guiSetVisible ( MailRegister, false ) showCursor ( true ) end end addEventHandler ("onClientGUIClick", getRootElement(), ExitOfRegister) ---------------------------------------------------------------------------------------------------------- function OpenRegister ( button, state, absoluteX, absoluteY ) if (source == btnCreateMailLogin) then guiSetVisible ( MailRegister, true ) guiSetVisible ( MailLogin, false ) showCursor ( true ) end end addEventHandler ("onClientGUIClick", getRootElement(), OpenRegister) function OpenMail ( button, state, absoluteX, absoluteY ) if (source == btnLogin) then usernameMail = guiGetText(editMailIDLogin) passwordMail = guiGetText(editPasswordLogin) triggerServerEvent("onRequestLoginMail",getLocalPlayer(),usernameMail,passwordMail) end end addEventHandler ("onClientGUIClick", getRootElement(), OpenMail) function Error_msg(Text) guiSetText(lblERRORSLogin, tostring(Text)) setTimer(function() guiSetText(lblERRORSLogin, "") end,2500,1) end addEvent("set_warning_textMail",true) addEventHandler("set_warning_textMail",getRootElement(),Error_msg) function EnterMail() guiSetVisible ( COCMail, true ) guiSetVisible ( MailLogin, false ) showCursor ( true ) end addEvent("EnterInMail",true) addEventHandler("EnterInMail",getRootElement(),EnterMail) ---------------------------------------------------------------------------------------------------------------- function OpenProcessRegister ( button, state, absoluteX, absoluteY ) if (source == btnCreateRegister) then usernameRegister = guiGetText(editMailIDRegister) passwordRegister = guiGetText(editPasswordRegister) passwordConfirmRegister = guiGetText(editPassword2Register) triggerServerEvent("onRequestRegisterMail",getLocalPlayer(),usernameRegister,passwordRegister,passwordConfirmRegister) end end addEventHandler ("onClientGUIClick", getRootElement(), OpenProcessRegister) function Error_msgRegister(Text) guiSetText(lblERRORSRegister, tostring(Text)) setTimer(function() guiSetText(lblERRORSRegister, "") end,2500,1) end addEvent("set_warning_textRegister",true) addEventHandler("set_warning_textRegister",getRootElement(),Error_msgRegister) Server: function PlayerLoginMail(usernameMail,passwordMail) if not (usernameMail == "") then if not (passwordMail == "") then local account = getAccount ( usernameMail, passwordMail ) if ( account ~= false ) then triggerClientEvent (source,"EnterInMail",getRootElement()) setAccountData ( account, "NewMails", true ) else triggerClientEvent(source,"set_warning_textMail",getRootElement(),"Wrong username and/or password!") end else triggerClientEvent(source,"set_warning_textMail",getRootElement(),"Please enter your password!") end else triggerClientEvent(source,"set_warning_textMail",getRootElement(),"Please enter your username!") end end addEvent("onRequestLoginMail",true) addEventHandler("onRequestLoginMail",getRootElement(),PlayerLoginMail) function registerPlayer(usernameRegister,passwordRegister,passwordConfirmRegister) if not (usernameRegister == "") then if not (passwordRegister == "") then if not (passwordConfirmRegister == "") then if passwordRegister == passwordConfirmRegister then local account = getAccount (usernameRegister,passwordRegister) if (account == false) then local accountAdded = addAccount(tostring(usernameRegister),tostring(passwordRegister)) if (accountAdded) then triggerClientEvent(source,"set_warning_textRegister",getRootElement(),"sucessfuly registered!") else triggerClientEvent(source,"set_warning_textRegister",getRootElement(),"Choose a different username/password.") end else triggerClientEvent(source,"set_warning_textRegister",getRootElement(),"An account with this username already exists!") end else triggerClientEvent(source,"set_warning_textRegister",getRootElement(),"Passwords do not match!") end else triggerClientEvent(source,"set_warning_textRegister",getRootElement(),"Please confirm your password!") end else triggerClientEvent(source,"set_warning_textRegister",getRootElement(),"Please enter a password!") end else triggerClientEvent(source,"set_warning_textRegister",getRootElement(),"Please enter a username you would like to register!") end end addEvent("onRequestRegisterMail",true) addEventHandler("onRequestRegisterMail",getRootElement(),registerPlayer) Lo que quiero es crear una cuenta que no tenga nada que ver con el codigo "logIn" para entrar al server, solo la quiero para entrar al Mail Pero no se como se hace os dejo un Video para que veais como esta ahora. Video 2: Link to comment
Soren Posted July 31, 2012 Share Posted July 31, 2012 1-. Pon tus codigos en lua tags 2-. Ya hiciste un tema sobre esto, puedes usar el mismo tema Link to comment
Recommended Posts