Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. Exacto, el MTA tiene un archivo llamado "registry.db" donde esta el "acl.xml", ahi es donde se guardan las tablas, etc de SQLite.
  2. GUIEditor_Window = {} GUIEditor_TabPanel = {} GUIEditor_Tab = {} GUIEditor_Button = {} GUIEditor_Memo = {} GUIEditor_Checkbox = {} GUIEditor_Label = {} GUIEditor_Edit = {} addEventHandler("onClientResourceStart",resourceRoot, function() GUIEditor_Window[1] = guiCreateWindow(130,156,513,341,"GUI Login-Register By ElMota",false) GUIEditor_TabPanel[1] = guiCreateTabPanel(9,38,495,294,false,GUIEditor_Window[1]) GUIEditor_Tab[1] = guiCreateTab("Login",GUIEditor_TabPanel[1]) GUIEditor_Label[1] = guiCreateLabel(12,46,21,21,"Nick",false,GUIEditor_Tab[1]) guiLabelSetColor(GUIEditor_Label[1],200, 0, 0) guiSetFont(GUIEditor_Label[1],"default-bold-small") GUIEditor_Edit[1] = guiCreateEdit(42,42,158,23,"",false,GUIEditor_Tab[1]) guiEditSetMaxLength(GUIEditor_Edit[1],22) GUIEditor_Label[2] = guiCreateLabel(8,113,63,19,"Contrase?a",false,GUIEditor_Tab[1]) guiLabelSetColor(GUIEditor_Label[2],200 ,0 ,0) guiSetFont(GUIEditor_Label[2],"default-bold-small") GUIEditor_Edit[2] = guiCreateEdit(75,108,134,26,"",false,GUIEditor_Tab[1]) guiEditSetMasked(GUIEditor_Edit[2],true) guiEditSetMaxLength(GUIEditor_Edit[2],10) GUIEditor_Button[1] = guiCreateButton(17,182,190,54,"Loggearme",false,GUIEditor_Tab[1]) guiSetFont(GUIEditor_Button[1],"sa-header") GUIEditor_Memo[1] = guiCreateMemo(260,25,222,108,"Favor Loggearse :\n\nPrivilegios de estar loggeado :\n\n- se te guardaran todos tus datos en mi sistema mySQL",false,GUIEditor_Tab[1]) guiMemoSetReadOnly(GUIEditor_Memo[1],true) GUIEditor_Label[3] = guiCreateLabel(213,228,268,34,"GUI Creada por ElMota CopyRight 2011-2012 (c)",false,GUIEditor_Tab[1]) guiLabelSetColor(GUIEditor_Label[3],200,0,0) guiSetFont(GUIEditor_Label[3],"default-bold-small") GUIEditor_Checkbox[1] = guiCreateCheckBox(132,146,354,28,"Acepto los Terminos y Condiciones de este Servidor",false,false,GUIEditor_Tab[1]) guiSetFont(GUIEditor_Checkbox[1],"default-bold-small") GUIEditor_Checkbox[2] = guiCreateCheckBox(28,80,194,22,"Mostrar Contrase?a",false,false,GUIEditor_Tab[1]) guiSetFont(GUIEditor_Checkbox[2],"default-bold-small") GUIEditor_Tab[2] = guiCreateTab("Register",GUIEditor_TabPanel[1]) GUIEditor_Label[4] = guiCreateLabel(4,32,26,16,"Nick",false,GUIEditor_Tab[2]) guiLabelSetColor(GUIEditor_Label[4],200,0,0) guiSetFont(GUIEditor_Label[4],"default-bold-small") GUIEditor_Edit[3] = guiCreateEdit(35,23,176,30,"",false,GUIEditor_Tab[2]) guiEditSetMaxLength(GUIEditor_Edit[3],23) GUIEditor_Label[5] = guiCreateLabel(2,80,65,22,"Contrase?a",false,GUIEditor_Tab[2]) guiLabelSetColor(GUIEditor_Label[5],200,0,0) guiSetFont(GUIEditor_Label[5],"default-bold-small") GUIEditor_Edit[4] = guiCreateEdit(73,74,140,31,"",false,GUIEditor_Tab[2]) guiEditSetMasked(GUIEditor_Edit[4],true) guiEditSetMaxLength(GUIEditor_Edit[4],10) GUIEditor_Label[6] = guiCreateLabel(3,128,40,16,"e-mail",false,GUIEditor_Tab[2]) guiLabelSetColor(GUIEditor_Label[6],200,0,0) guiSetFont(GUIEditor_Label[6],"default-bold-small") GUIEditor_Edit[5] = guiCreateEdit(47,118,168,30,"",false,GUIEditor_Tab[2]) guiEditSetMaxLength(GUIEditor_Edit[5],20) GUIEditor_Button[2] = guiCreateButton(14,179,207,68,"Registrarme",false,GUIEditor_Tab[2]) guiSetFont(GUIEditor_Button[2],"sa-header") GUIEditor_Memo[2] = guiCreateMemo(243,17,240,128,"Recuerda antes De loggearte debes estar registrado aqui osino no podras jugar ^^ GUI Creada por ElMota (c)",false,GUIEditor_Tab[2]) guiMemoSetReadOnly(GUIEditor_Memo[2],true) GUIEditor_Checkbox[3] = guiCreateCheckBox(246,162,215,28,"Mostrar Contrase?a",false,false,GUIEditor_Tab[2]) guiSetFont(GUIEditor_Checkbox[3],"default-bold-small") GUIEditor_Checkbox[4] = guiCreateCheckBox(223,217,263,21,"Acepto los terminos y Condiciones de este server",false,false,GUIEditor_Tab[2]) guiSetFont(GUIEditor_Checkbox[4],"default-small") guiSetVisible(GUIEditor_Window[1], false) addEventHandler("onClientGUIClick", GUIEditor_Button[1], clientSubmitLogin, false) addEventHandler("onClientGUIClick", GUIEditor_Button[2], clientSubmitaccount, false) showTheGUI() end ) addEventHandler ( "onClientGUIClick", root, function ( ) if ( source == GUIEditor_Checkbox[2] ) then guiEditSetMasked ( GUIEditor_Edit[2], guiCheckBoxGetSelected ( source ) ) elseif ( source == GUIEditor_Checkbox[3] ) then guiEditSetMasked ( GUIEditor_Edit[4], guiCheckBoxGetSelected ( source ) ) end end ) function showTheGUI() outputChatBox("Bienvenido a mi Servidor de MTA porfavor Loggeate.") -- 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) end function clientSubmitLogin ( button, state ) if ( button == "left" and state == "up" ) then local username = guiGetText(GUIEditor_Edit[1]) local password = guiGetText(GUIEditor_Edit[2]) -- if the username and password both exist if ( username and password ) then triggerServerEvent("submitLogin", localPlayer, username, password) guiSetInputEnabled(false) guiSetVisible(GUIEditor_Window[1], false) showCursor(false) else outputChatBox("Porfavor pon tu Nick y tu Contrase?a.") end end end function clientSubmitaccount ( button, state ) if ( button == "left" and state == "up" ) then local username = guiGetText(GUIEditor_Edit[3]) local password = guiGetText(GUIEditor_Edit[4]) -- if the username and password both exist if ( username and password ) then triggerServerEvent("addAccount", localPlayer, username, password) guiSetInputEnabled(false) guiSetVisible(GUIEditor_Window[1], false) showCursor(false) else outputChatBox("Porfavor pon tu Nick y tu Contraseña.") end end end
  3. http://es.wikipedia.org/wiki/SQLite
  4. You must have done something wrong.
  5. Vos siquiera sabes lo basico de Lua? porque como hablas me parece que no.
  6. -- create our loginHandler function, with username and password parameters (passed from the client GUI). function loginHandler(username,password) -- check that the username and password are correct. local acc = getAccount(username, password) -- the player has succesfully logged in, so spawn them. if (acc) then logIn ( source, acc, password ) spawnPlayer (source, 1959.55, -1714.46, 10) fadeCamera(source, true) setCameraTarget(source) outputChatBox("Enjoy your time!", source) else -- if the username or password are not correct, output a message to the player. outputChatBox("invalid username and password. Please re-connect and try again.", source) end end -- define our costom event, and allow it to be triggered from the client ('true'). addEvent("submitLogin",true) -- add an event handler so that when submitLogin is triggered, the function loginHandler is called. addEventHandler("submitLogin",root, loginHandler) function registerPlayer ( username, password ) if ( password ~= "" and password ~= nil and username ~= "" and username ~= nil ) then if ( not getAccount ( username ) ) then local accountAdded = addAccount ( username, password ) if ( accountAdded ) then outputChatBox ( "Thank you " .. getPlayerName ( source ) .. ", Ya estas Registrado ahora loggeate", source ) else outputChatBox ( "Error creating account, contact the server admin.", source ) end else outputChatBox ( "This account already exists..", source ) end else outputChatBox ( "Porfavor Pon tus datos Correctos.", source ) end end function createLoginWindow() -- define the X and Y positions of the window local X = 0.335 local Y = 0.375 -- define the width and height of the window local Width = 0.35 local Height = 0.25 -- create the window and save it's element value into the variable "wdwLogin" wdwLogin = guiCreateWindow(X, Y, Width, Height, "Please login with your username and password", true) -- define new X and Y positions for the first label. X = 0.0825 Y = 0.230 -- define new Width and Height values for the first label. Width = 0.50 Height = 0.50 -- create the first label, note the final argument passed is 'wdwLogin' meaning the window -- we created above is the parent of this label (so all the position and size values are now relative to the position of that window). guiCreateLabel (X, Y, Width, Height, "Username", true, wdwLogin) -- alter the Y value so the second label is slightly below the first. Y = 0.53 guiCreateLabel (X, Y, Width, Height, "password", true, wdwLogin) X = 0.415 Y = 0.2 Width = 0.5 Height = 0.15 edtUser = guiCreateEdit (X, Y, Width, Height, "", true, wdwLogin) Y = 0.5 edtPass = guiCreateEdit (X, Y, Width, Height, "", true, wdwLogin) -- set the maximum character length for the username and password fields to 50. guiEditSetMaxLength(edtUser, 50) guiEditSetMaxLength(edtPass, 50) X = 0.415 Y = 0.7 Width = 0.25 Height = 0.2 btnLogin = guiCreateButton(X, Y, Width, Height, "Log In", true, wdwLogin) X = 0.700 Y = 0.7 Width = 0.25 Height = 0.2 btnRegister = guiCreateButton(X, Y, Width, Height, "Register", true, wdwLogin) -- now add our onClientGUIClick event to the buttons we just created. addEventHandler("onClientGUIClick", btnLogin, clientSubmitLogin, false) addEventHandler("onClientGUIClick", btnRegister, createRegisterWindow1, false) -- make the login window invisible guiSetVisible(wdwLogin, false) end -- create the function and define the 'button' and 'state' parameters. -- (these are passed automatically by onClientGUIClick) function clientSubmitLogin(button,state) -- if our login button was clicked with the left mouse button, and the state of the mousebutton is up: if button == "left" and state == "up" then -- get the text entered in the 'username' field. local username = guiGetText(edtUser) -- get the text entered in the 'password' field. local password = guiGetText(edtPass) -- 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", localPlayer, username, password) -- move the input focus back on the game (allowing players to move arround, open the chatbox, etc) guiSetInputEnabled(false) -- hide the window and all the components. guiSetVisible(wdwLogin, false) -- hide the mouse cursor. 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 --------------------------------------------------------------------------------------------------------- -- create the function and define the 'button' and 'state' parameters. -- (these are passed automatically by onClientGUIClick) function createRegisterWindow1(button,state) -- if our login button was clicked with the left mouse button, and the state of the mousebutton is up: if button == "left" and state == "up" then createRegisterWindow() end end function createRegisterWindow() -- define the X and Y positions of the window local X = 0.335 local Y = 0.375 -- define the width and height of the window local Width = 0.35 local Height = 0.25 -- create the window and save it's element value into the variable "wdwLogin" -- click on the function's name to read its documentation. wdwRegister = guiCreateWindow(X, Y, Width, Height, "Please register with an username and password", true) -- define new X and Y positions for the first label. X = 0.0825 Y = 0.230 -- define new Width and Height values for the first label. Width = 0.50 Height = 0.50 -- create the first label, note the final argument passed is 'wdwLogin' meaning the window -- we created above is the parent of this label (so all the position and size values are now relative to the position of that window). guiCreateLabel (X, Y, Width, Height, "Username", true, wdwRegister) -- alter the Y value so the second label is slightly below the first. Y = 0.53 guiCreateLabel (X, Y, Width, Height, "password", true, wdwRegister) X = 0.415 Y = 0.2 Width = 0.5 Height = 0.15 edtUser = guiCreateEdit (X, Y, Width, Height, "", true, wdwRegister) Y = 0.5 edtPass = guiCreateEdit (X, Y, Width, Height, "", true, wdwRegister) -- set the maximum character length for the username and password fields to 50. guiEditSetMaxLength(edtUser, 50) guiEditSetMaxLength(edtPass, 50) X = 0.415 Y = 0.7 Width = 0.25 Height = 0.2 btnCancel = guiCreateButton(X, Y, Width, Height, "Cancel", true, wdwRegister) X = 0.700 Y = 0.7 Width = 0.25 Height = 0.2 btnRegister = guiCreateButton(X, Y, Width, Height, "Register", true, wdwRegister) -- now add our onClientGUIClick event to the button we just created. addEventHandler("onClientGUIClick", btnCancel, registerWindowCancel, false) addEventHandler("onClientGUIClick", btnRegister, clientRegister, false) -- make the window visible guiSetVisible(wdwRegister, true) -- make the window invisible guiSetVisible(wdwLogin, false) end -- attach the event handler to the root element of the resource. -- this means it will only trigger when it's own resource is started. addEventHandler("onClientResourceStart", resourceRoot, function () -- create the log in window and it's components. createLoginWindow() -- output a brief welcome message to the player outputChatBox("Welcome to BlackDeath's Alpha Server, Please log in with the login information provided to you") -- if the GUI was successfully created, then show the GUI to the player. if (wdwLogin ~= nil) then guiSetVisible(wdwLogin, true) else -- if the GUI hasn't been properly been created, tell the player. outputChatBox("An unexpected error has occurred and the login GUI has not been created.") end -- enable the players cursor (so that 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) end )
  7. That error mean's the client is triggering a server side event which doesn't exists.
  8. Te sugiero que uses o bien MySQL o SQLite para guardar los personajes. https://wiki.multitheftauto.com/wiki/Ser ... _functions
  9. No es tan facil, te sugiero que te crees tu propio sistema de personajes.
  10. Castillo

    new JoinQuit

    setTimer ( function ( ) removeEventHandler ( "onClientRender", root, renderPlayerJoin ) end ,5000,1, -- Here. ) If you run the script, you'll notice.
  11. That's because you added to close it. I'm starting to wonder if you really think what you are doing, because these are really simple errors, do you really want to learn or you're just copying it?
  12. Castillo

    new JoinQuit

    Copy my code again.
  13. Castillo

    new JoinQuit

    Oh, I see, btw, you forgot to remove the extra commas in the timer(s).
  14. You added the event handler before creating the GUI. GUIEditor_Window = {} GUIEditor_TabPanel = {} GUIEditor_Tab = {} GUIEditor_Button = {} GUIEditor_Memo = {} GUIEditor_Checkbox = {} GUIEditor_Label = {} GUIEditor_Edit = {} addEventHandler("onClientResourceStart",resourceRoot, function() GUIEditor_Window[1] = guiCreateWindow(130,156,513,341,"GUI Login-Register By ElMota",false) GUIEditor_TabPanel[1] = guiCreateTabPanel(9,38,495,294,false,GUIEditor_Window[1]) GUIEditor_Tab[1] = guiCreateTab("Login",GUIEditor_TabPanel[1]) GUIEditor_Label[1] = guiCreateLabel(12,46,21,21,"Nick",false,GUIEditor_Tab[1]) guiLabelSetColor(GUIEditor_Label[1],200, 0, 0) guiSetFont(GUIEditor_Label[1],"default-bold-small") GUIEditor_Edit[1] = guiCreateEdit(42,42,158,23,"",false,GUIEditor_Tab[1]) guiEditSetMaxLength(GUIEditor_Edit[1],22) GUIEditor_Label[2] = guiCreateLabel(8,113,63,19,"Contrase?a",false,GUIEditor_Tab[1]) guiLabelSetColor(GUIEditor_Label[2],200 ,0 ,0) guiSetFont(GUIEditor_Label[2],"default-bold-small") GUIEditor_Edit[2] = guiCreateEdit(75,108,134,26,"",false,GUIEditor_Tab[1]) guiEditSetMasked(GUIEditor_Edit[2],true) guiEditSetMaxLength(GUIEditor_Edit[2],10) GUIEditor_Button[1] = guiCreateButton(17,182,190,54,"Loggearme",false,GUIEditor_Tab[1]) guiSetFont(GUIEditor_Button[1],"sa-header") GUIEditor_Memo[1] = guiCreateMemo(260,25,222,108,"Favor Loggearse :\n\nPrivilegios de estar loggeado :\n\n- se te guardaran todos tus datos en mi sistema mySQL",false,GUIEditor_Tab[1]) guiMemoSetReadOnly(GUIEditor_Memo[1],true) GUIEditor_Label[3] = guiCreateLabel(213,228,268,34,"GUI Creada por ElMota CopyRight 2011-2012 (c)",false,GUIEditor_Tab[1]) guiLabelSetColor(GUIEditor_Label[3],200,0,0) guiSetFont(GUIEditor_Label[3],"default-bold-small") GUIEditor_Checkbox[1] = guiCreateCheckBox(132,146,354,28,"Acepto los Terminos y Condiciones de este Servidor",false,false,GUIEditor_Tab[1]) guiSetFont(GUIEditor_Checkbox[1],"default-bold-small") GUIEditor_Checkbox[2] = guiCreateCheckBox(28,80,194,22,"Mostrar Contrase?a",false,false,GUIEditor_Tab[1]) guiSetFont(GUIEditor_Checkbox[2],"default-bold-small") GUIEditor_Tab[2] = guiCreateTab("Register",GUIEditor_TabPanel[1]) GUIEditor_Label[4] = guiCreateLabel(4,32,26,16,"Nick",false,GUIEditor_Tab[2]) guiLabelSetColor(GUIEditor_Label[4],200,0,0) guiSetFont(GUIEditor_Label[4],"default-bold-small") GUIEditor_Edit[3] = guiCreateEdit(35,23,176,30,"",false,GUIEditor_Tab[2]) guiEditSetMaxLength(GUIEditor_Edit[3],23) GUIEditor_Label[5] = guiCreateLabel(2,80,65,22,"Contrase?a",false,GUIEditor_Tab[2]) guiLabelSetColor(GUIEditor_Label[5],200,0,0) guiSetFont(GUIEditor_Label[5],"default-bold-small") GUIEditor_Edit[4] = guiCreateEdit(73,74,140,31,"",false,GUIEditor_Tab[2]) guiEditSetMasked(GUIEditor_Edit[4],true) guiEditSetMaxLength(GUIEditor_Edit[4],10) GUIEditor_Label[6] = guiCreateLabel(3,128,40,16,"e-mail",false,GUIEditor_Tab[2]) guiLabelSetColor(GUIEditor_Label[6],200,0,0) guiSetFont(GUIEditor_Label[6],"default-bold-small") GUIEditor_Edit[5] = guiCreateEdit(47,118,168,30,"",false,GUIEditor_Tab[2]) guiEditSetMaxLength(GUIEditor_Edit[5],20) GUIEditor_Button[2] = guiCreateButton(14,179,207,68,"Registrarme",false,GUIEditor_Tab[2]) guiSetFont(GUIEditor_Button[2],"sa-header") GUIEditor_Memo[2] = guiCreateMemo(243,17,240,128,"Recuerda antes De loggearte debes estar registrado aqui osino no podras jugar ^^ GUI Creada por ElMota (c)",false,GUIEditor_Tab[2]) guiMemoSetReadOnly(GUIEditor_Memo[2],true) GUIEditor_Checkbox[3] = guiCreateCheckBox(246,162,215,28,"Mostrar Contrase?a",false,false,GUIEditor_Tab[2]) guiSetFont(GUIEditor_Checkbox[3],"default-bold-small") GUIEditor_Checkbox[4] = guiCreateCheckBox(223,217,263,21,"Acepto los terminos y Condiciones de este server",false,false,GUIEditor_Tab[2]) guiSetFont(GUIEditor_Checkbox[4],"default-small") guiSetVisible(GUIEditor_Window[1], false) addEventHandler("onClientGUIClick", GUIEditor_Button[1], clientSubmitLogin, false) addEventHandler("onClientGUIClick", GUIEditor_Button[2], clientSubmitaccount, false) showTheGUI() end ) addEventHandler ( "onClientGUIClick", root, function ( ) if ( source == GUIEditor_Checkbox[1] ) then guiEditSetMasked ( GUIEditor_Edit[2], guiCheckBoxGetSelected ( source ) ) end end ) function showTheGUI() outputChatBox("Bienvenido a mi Servidor de MTA porfavor Loggeate.") -- 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) end function clientSubmitLogin ( button, state ) if ( button == "left" and state == "up" ) then local username = guiGetText(GUIEditor_Edit[1]) local password = guiGetText(GUIEditor_Edit[2]) -- if the username and password both exist if ( username and password ) then triggerServerEvent("submitLogin", localPlayer, username, password) guiSetInputEnabled(false) guiSetVisible(GUIEditor_Window[1], false) showCursor(false) else outputChatBox("Porfavor pon tu Nick y tu Contrase?a.") end end end function clientSubmitaccount ( button, state ) if ( button == "left" and state == "up" ) then local username = guiGetText(GUIEditor_Edit[3]) local password = guiGetText(GUIEditor_Edit[4]) -- if the username and password both exist if ( username and password ) then triggerServerEvent("addAccount", localPlayer, username, password) guiSetInputEnabled(false) guiSetVisible(GUIEditor_Window[1], false) showCursor(false) else outputChatBox("Porfavor pon tu Nick y tu Contraseña.") end end end
  15. Castillo

    new JoinQuit

    May I ask what did you change on my script?
  16. Castillo

    new JoinQuit

    local messageJoin = "" local messageQuit = "" function renderPlayerJoined ( ) dxDrawText("* ".. messageJoin,504.0,4.0,574.0,20.0,tocolor(200,0,0,255),0.7,"sans","left","top",false,false,false) end function renderPlayerLeft ( ) dxDrawText("* ".. messageQuit,503.0,16.0,573.0,32.0,tocolor(0,0,255,170),0.7,"sans","left","top",false,false,false) end addEventHandler('onClientPlayerJoin', root, function() messageJoin = getPlayerName(source) .. " a entrado al servidor." addEventHandler ( "onClientRender", root, renderPlayerJoined ) setTimer ( function ( ) removeEventHandler ( "onClientRender", root, renderPlayerJoined ) end ,5000,1 ) end ) addEventHandler('onClientPlayerChangeNick', root, function(oldNick, newNick) outputChatBox('* ' .. oldNick .. ' is now known as ' .. newNick, 255, 100, 100) end ) addEventHandler('onClientPlayerQuit', root, function(reason) messageQuit = getPlayerName(source) .. " a salido del server [" .. reason .. "]" addEventHandler ( "onClientRender", root, renderPlayerLeft ) setTimer ( function ( ) removeEventHandler ( "onClientRender", root, renderPlayerLeft ) end ,5000,1 ) end )
  17. Maybe because you didn't add the event "addAccount" in the server side?
  18. X = 0.0825 Y = 0.2 -- Lua is case sensitive. -- define new Width and Height values for the first label. Width = 0.50 Height = 0.50 -- create the first label, note the final argument passed is 'wdwLogin' meaning the window -- we created above is the parent of this label (so all the position and size values are now relative to the position of that window). guiCreateLabel (X, Y, Width, Height, "Username", true, wdwLogin) -- alter the Y value so the second label is slightly below the first. Y = 0.7 guiCreateLabel (X, Y, Width, Height, "password", true, wdwLogin)
  19. -- create our loginHandler function, with username and password parameters (passed from the client GUI). function loginHandler(username,password) -- check that the username and password are correct. local acc = getAccount(username, password) -- the player has succesfully logged in, so spawn them. if (acc) then logIn ( source, acc, password ) spawnPlayer (source, 1959.55, -1714.46, 10) fadeCamera(source, true) setCameraTarget(source) outputChatBox("Enjoy your time!", source) else -- if the username or password are not correct, output a message to the player. outputChatBox("invalid username and password. Please re-connect and try again.", source) end end -- define our costom event, and allow it to be triggered from the client ('true'). addEvent("submitLogin",true) -- add an event handler so that when submitLogin is triggered, the function loginHandler is called. addEventHandler("submitLogin",root, loginHandler) function registerPlayer ( username, password ) if ( password ~= "" and password ~= nil and username ~= "" and username ~= nil ) then if ( not getAccount ( username ) ) then local accountAdded = addAccount ( username, password ) if ( accountAdded ) then outputChatBox ( "Thank you " .. getPlayerName ( source ) .. ", Ya estas Registrado ahora loggeate", source ) else outputChatBox ( "Error creating account, contact the server admin.", source ) end else outputChatBox ( "This account already exists..", source ) end else outputChatBox ( "Porfavor Pon tus datos Correctos.", source ) end end
  20. https://community.multitheftauto.com/index.php?p= ... ls&id=4054 That resource is a mix of a lot of public resources, he's not giving credits to the real owners.
  21. As I told you before, is not possible to create skin ID's.
  22. You mean the function to add an account? if so: addAccount
  23. Use the code I posted, I've fixed a few bugs in the client side.
×
×
  • Create New...