Jump to content

Jaysds1

Members
  • Posts

    4,961
  • Joined

  • Last visited

Everything posted by Jaysds1

  1. Jaysds1

    Login.

    create your mysql: mysql_connect() https://wiki.multitheftauto.com/wiki/Mod ... ql_connect
  2. Jaysds1

    Login.

    Try this: addEventHandler("onClientResourceStart",resourceRoot,function() loginButton = guiCreateButton(634, 323, 117, 37, "Zaloguj!", false) loginPassLabel = guiCreateLabel(481, 244, 48, 56, "Login:\n\n\nHaslo:", false) guiSetFont(loginPassLabel,"default-bold-small") registerLabel = guiCreateLabel(363, 424, 397, 86, "Jesli nie posiadasz konta, udaj sie na nasze forum i zarejestruj konto.\nKolejnym krokiem bedzie zalozenie postaci.\n\n\n[url=http://www.LostHeaven.pl]http://www.LostHeaven.pl[/url]", false) guiSetFont(registerLabel,"default-bold-small") loginBox = guiCreateEdit(525, 241, 145, 23, "", false) guiEditSetMaxLength(loginBox, 25) passBox = guiCreateEdit(525, 281, 145, 23, "", false) guiEditSetMasked(passBox, true) guiEditSetMaxLength(passBox, 30) keyImage = guiCreateStaticImage(358, 237, 111, 94, "images/Key.png", false) addEventHandler("onClientGUIClick", loginButton,function(button,state) if button == "left" and state == "up" then local login = guiGetText(loginBox) local pass = guiGetText(passBox) if login and pass then triggerServerEvent("submitLogin", localPlayer, login, pass) guiSetInputEnabled(false) showCursor(false) removeEventHandler("onClientRender",root,createDxOnLogin) else outputChatBox("#EE5555* #C0C0C0Prosze wpisac #EE5555Login #C0C0C0oraz #EE5555Haslo#C0C0C0, aby sie zalogowac!", 255, 255, 255, true) end end end,false) showCursor(true) guiSetInputEnabled(true) addEventHandler("onClientRender", root, createDxOnLogin) end) function createDxOnLogin() dxDrawRectangle(769.0, 379.0, 211.0, 193.0, tocolor(255, 0, 0, 155), false) dxDrawText("Ping: 0\n\n\n FPS: 0",778.0, 387.0, 970.0, 542.0, tocolor(255, 255, 255, 255), 1.0, "bankgothic", "left", "top", false, false, false) dxDrawRectangle(358.0, 380.0, 404.0, 194.0, tocolor(255, 192, 0, 155), false) dxDrawText("Rejestracja", 358.0, 380.0, 574.0, 418.0, tocolor(255, 255, 255, 255), 1.0, "bankgothic", "left", "top", false, false, false) dxDrawRectangle(769.0, 178.0, 211.0, 193.0, tocolor(0, 255, 0, 155), false) dxDrawText("Online:\n\n 1 / 100", 776.0, 180.0, 962.0, 215.0, tocolor(255, 255, 255, 255), 1.0, "bankgothic", "left", "top", false, false, false) dxDrawRectangle(358.0, 178.0, 404.0, 194.0, tocolor(0, 96, 255, 155), false) dxDrawText("Logowanie", 361.0, 180.0, 547.0, 215.0,tocolor(255, 255, 255,255), 1.0, "bankgothic", "left", "top", false, false, false) end addEvent("close",true) addEventHandler("close",root,function() local elements = {loginButton,loginPassLabel,registerLabel,loginBox,passBox,keyImage} destroyElement(elements) removeEventHandler("onClientRender",root,createDxOnLogin) end) addEvent("submitLogin", true) addEventHandler("submitLogin", root,function(login, pass) local acc = mysql_query(connect, "SELECT * FROM `accounts` WHERE `login` = '"login"' AND `password` = '"pass"'") if acc then outputChatBox("Zalogowano.", source) triggerClientEvent(client,"close",root) else outputChatBox("#EE5555* #C0C0C0Podano zly #EE5555Login #C0C0C0lub #EE5555Haslo#C0C0C0!", source, 255, 255, 255, true) end end)
  3. I'm trying to make one now... anyways, this topics question is answered, I think this could be locked since there's no use in this topic.
  4. Jaysds1

    Login.

    fine, try this: addEventHandler("onClientResourceStart",resourceStart,function() loginButton = guiCreateButton(634, 323, 117, 37, "Zaloguj!", false) loginPassLabel = guiCreateLabel(481, 244, 48, 56, "Login:\n\n\nHaslo:", false) guiSetFont(loginPassLabel,"default-bold-small") registerLabel = guiCreateLabel(363, 424, 397, 86, "Jesli nie posiadasz konta, udaj sie na nasze forum i zarejestruj konto.\nKolejnym krokiem bedzie zalozenie postaci.\n\n\n[url=http://www.LostHeaven.pl]www.LostHeaven.pl[/url]", false) guiSetFont(registerLabel,"default-bold-small") loginBox = guiCreateEdit(525, 241, 145, 23, "", false) guiEditSetMaxLength(loginBox, 25) passBox = guiCreateEdit(525, 281, 145, 23, "", false) guiEditSetMasked(passBox, true) guiEditSetMaxLength(passBox, 30) keyImage = guiCreateStaticImage(358, 237, 111, 94, "images/Key.png", false) addEventHandler("onClientGUIClick", loginButton,function clientSubmitLogin(button,state) if button == "left" and state == "up" then local login = guiGetText(loginBox) local pass = guiGetText(passBox) if login and pass then triggerServerEvent("submitLogin", localPlayer, login, pass) local elements = {loginButton,loginPassLabel,registerLabel,loginBox,passBox,keyImage} destroyElement(elements) guiSetInputEnabled(false) showCursor(false) removeEventHandler("onClientRender",root,createDxOnLogin) else outputChatBox("#EE5555* #C0C0C0Prosze wpisac #EE5555Login #C0C0C0oraz #EE5555Haslo#C0C0C0, aby sie zalogowac!", 255, 255, 255, true) end end end,false) showCursor(true) guiSetInputEnabled(true) addEventHandler("onClientRender", root, createDxOnLogin) end) function createDxOnLogin() dxDrawRectangle(769.0, 379.0, 211.0, 193.0, tocolor(255, 0, 0, 155), false) dxDrawText("Ping: 0\n\n\n FPS: 0",778.0, 387.0, 970.0, 542.0, tocolor(255, 255, 255, 255), 1.0, "bankgothic", "left", "top", false, false, false) dxDrawRectangle(358.0, 380.0, 404.0, 194.0, tocolor(255, 192, 0, 155), false) dxDrawText("Rejestracja", 358.0, 380.0, 574.0, 418.0, tocolor(255, 255, 255, 255), 1.0, "bankgothic", "left", "top", false, false, false) dxDrawRectangle(769.0, 178.0, 211.0, 193.0, tocolor(0, 255, 0, 155), false) dxDrawText("Online:\n\n 1 / 100", 776.0, 180.0, 962.0, 215.0, tocolor(255, 255, 255, 255), 1.0, "bankgothic", "left", "top", false, false, false) dxDrawRectangle(358.0, 178.0, 404.0, 194.0, tocolor(0, 96, 255, 155), false) dxDrawText("Logowanie", 361.0, 180.0, 547.0, 215.0,tocolor(255, 255, 255,255), 1.0, "bankgothic", "left", "top", false, false, false) end addEvent("submitLogin", true) addEventHandler("submitLogin", root,function(login, pass) local acc = mysql_query(connect, "SELECT * FROM `accounts` WHERE `login` = '"login"' AND `password` = '"pass"'") if acc then outputChatBox("Zalogowano.", source) else outputChatBox("#EE5555* #C0C0C0Podano zly #EE5555Login #C0C0C0lub #EE5555Haslo#C0C0C0!", source, 255, 255, 255, true) triggerServerEvent(client,"tryAgain", root) end end)
  5. Jaysds1

    Login.

    What's wrong with it? Is it not showing the GUI and Text?
  6. You could just download one and make the skin/theme your self: www.phpbb.com/
  7. If your talking about setting up your server then I suggest looking at this Server_Manual.
  8. Sorry, i forgot to split the script, copy again
  9. try this: addEventHandler("onPlayerLogin",root,function() local team = getAccountData (getPlayerAccount(source), "team") -- gets players team if (team==getTeamName(getTeamFromName(team))) then setPlayerTeam(source, getTeamFromName(team)) -- sets players team end end) -- sets players team on login function save() local team = getPlayerTeam(source) -- Gets the players team local account = getPlayerAccount(source) if not isGuestAccount(account) then -- Checks to see if the player is a guest or not if(team)then setAccountData(account, "team", getTeamName(team)) --saves team end end end addEventHandler("onPlayerLogout", root, save) -- saves team on logout addEventHandler("onPlayerQuit", root, save) -- saves team on quit
  10. try this: addEvent("onMapStart",true) addEventHandler("onMapStart",root,function() guiSetVisible(,true) showCursor(true) guiSetInputEnabled(true) end) addEventHandler("onClientResourceStart",resourceRoot,function() GUIEditor_Window = {} GUIEditor_TabPanel = {} GUIEditor_Tab = {} GUIEditor_Button = {} GUIEditor_Label = {} GUIEditor_Grid = {} GUIEditor_Window[1] = guiCreateWindow(0.2988,0.2633,0.4137,0.39,"GUI Shop Panel",true) guiSetVisible(GUIEditor_Window[1],false) guiWindowSetMovable(GUIEditor_Window[1],false) guiWindowSetSizable(GUIEditor_Window[1],false) GUIEditor_TabPanel[1] = guiCreateTabPanel(11,23,311,174,false,GUIEditor_Window[1]) GUIEditor_Tab[1] = guiCreateTab("Armas",GUIEditor_TabPanel[1]) GUIEditor_Grid[1] = guiCreateGridList(7,8,153,139,false,GUIEditor_Tab[1]) guiGridListSetSelectionMode(GUIEditor_Grid[1],2) columnA = guiGridListAddColumn(GUIEditor_Grid[1],"Armas",0.4) columnP = guiGridListAddColumn(GUIEditor_Grid[1],"$",0.4) row1 = guiGridListAddRow(GUIEditor_Grid[1]) row2 = guiGridListAddRow(GUIEditor_Grid[1]) row3 = guiGridListAddRow(GUIEditor_Grid[1]) row4 = guiGridListAddRow(GUIEditor_Grid[1]) row5 = guiGridListAddRow(GUIEditor_Grid[1]) GUIEditor_Button[1] = guiCreateButton(188,98,111,42,"Comprar",false,GUIEditor_Tab[1]) GUIEditor_Tab[2] = guiCreateTab("Autos",GUIEditor_TabPanel[1]) GUIEditor_Button[2] = guiCreateButton(85,59,75,30,"Repair",false,GUIEditor_Tab[2]) GUIEditor_Button[3] = guiCreateButton(168,59,75,30,"Nitro",false,GUIEditor_Tab[2]) GUIEditor_Tab[3] = guiCreateTab("Skills",GUIEditor_TabPanel[1]) GUIEditor_Label[1] = guiCreateLabel(165,201,157,27,"BaseMode Server By ElMota",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Label[1],"default-bold-small") guiSetVisible(GUIEditor_Window[1],false) showCursor(false) bindKey("F5","down", function() guiSetVisible(GUIEditor_Window[1], not guiGetVisible(GUIEditor_Window[1])) showCursor(guiGetVisible(GUIEditor_Window[1])) end ) addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function() guiGridListSetItemText(GUIEditor_Grid[1], row1, columnA, "M4", false, false) guiGridListSetItemText(GUIEditor_Grid[1], row2, columnP, "4000", false, false) end ) addEventHandler ( 'onClientGUIClick', guiRoot, function ( ) if ( source == GUIEditor_Button[1] ) then if ( row1 and columnA and row1 ~= -1 and colA ~= -1 ) then triggerServerEvent("DarArmas", getLocalPlayer()) guiSetVisible ( GUIEditor_Window[1], false ) showCursor ( false ) end end end ) end) Server: addEventHandler("onResourceStart",root,function(res) if(getResourceInfo(res,"type")=="Map"or"map")then triggerClientEvent("onMapStart",root) end end)
  11. Jaysds1

    Login.

    Here: Client: local screenWidth, screenHeight = guiGetScreenSize() function createDxOnLogin() dxDrawRectangle(769.0, 379.0, 211.0, 193.0, tocolor(255, 0, 0, 155), false) dxDrawText("Ping: 0\n\n\n FPS: 0",778.0, 387.0, 970.0, 542.0, tocolor(255, 255, 255, 255), 1.0, "bankgothic", "left", "top", false, false, false) dxDrawRectangle(358.0, 380.0, 404.0, 194.0, tocolor(255, 192, 0, 155), false) dxDrawText("Rejestracja", 358.0, 380.0, 574.0, 418.0, tocolor(255, 255, 255, 255), 1.0, "bankgothic", "left", "top", false, false, false) dxDrawRectangle(769.0, 178.0, 211.0, 193.0, tocolor(0, 255, 0, 155), false) dxDrawText("Online:\n\n 1 / 100", 776.0, 180.0, 962.0, 215.0, tocolor(255, 255, 255, 255), 1.0, "bankgothic", "left", "top", false, false, false) dxDrawRectangle(358.0, 178.0, 404.0, 194.0, tocolor(0, 96, 255, 155), false) dxDrawText("Logowanie", 361.0, 180.0, 547.0, 215.0,tocolor(255, 255, 255,255), 1.0, "bankgothic", "left", "top", false, false, false) end function createGUIElements() loginButton = guiCreateButton(634, 323, 117, 37, "Zaloguj!", false) loginPassLabel = guiCreateLabel(481, 244, 48, 56, "Login:\n\n\nHaslo:", false) guiSetFont(loginPassLabel,"default-bold-small") registerLabel = guiCreateLabel(363, 424, 397, 86, "Jesli nie posiadasz konta, udaj sie na nasze forum i zarejestruj konto.\nKolejnym krokiem bedzie zalozenie postaci.\n\n\n[url=http://www.LostHeaven.pl]www.LostHeaven.pl[/url]", false) guiSetFont(registerLabel,"default-bold-small") loginBox = guiCreateEdit(525, 241, 145, 23, "", false) guiEditSetMaxLength(loginBox, 25) passBox = guiCreateEdit(525, 281, 145, 23, "", false) guiEditSetMasked(passBox, true) guiEditSetMaxLength(passBox, 30) keyImage = guiCreateStaticImage(358, 237, 111, 94, "images/Key.png", false) guiSetVisible(loginButton, false) guiSetVisible(loginPassLabel, false) guiSetVisible(registerLabel, false) guiSetVisible(loginBox, false) guiSetVisible(passBox, false) guiSetVisible(keyImage, false) addEventHandler("onClientGUIClick", loginButton, clientSubmitLogin, false) end addEventHandler("onClientResourceStart",resourceRoot,function() createGUIElements() showCursor(true) guiSetInputEnabled(true) addEventHandler("onClientRender", root, createDxOnLogin) end) addEvent("tryAgain", true) function clientSubmitLogin(button,state) if button == "left" and state == "up" then local login = guiGetText(loginBox) local pass = guiGetText(passBox) if login and pass then triggerServerEvent("submitLogin", getRootElement(), login, pass) guiSetVisible(loginButton, false) guiSetVisible(loginPassLabel, false) guiSetVisible(registerLabel, false) guiSetVisible(loginBox, false) guiSetVisible(passBox, false) guiSetVisible(keyImage, false) guiSetInputEnabled(false) showCursor(false) else outputChatBox("#EE5555* #C0C0C0Prosze wpisac #EE5555Login #C0C0C0oraz #EE5555Haslo#C0C0C0, aby sie zalogowac!", 255, 255, 255, true) end end end Server: addEvent("submitLogin", true) addEventHandler("submitLogin", root,function(login, pass) local acc = mysql_query(connect, "SELECT * FROM `accounts` WHERE `login` = '"..login.."' AND `password` = '"..pass.."'") if acc then outputChatBox("Zalogowano.", source) else outputChatBox("#EE5555* #C0C0C0Podano zly #EE5555Login #C0C0C0lub #EE5555Haslo#C0C0C0!", source, 255, 255, 255, true) triggerServerEvent(client,"tryAgain", getRootElement()) end end)
  12. CAN A MOD LOCK THIS AND/OR TRASH
  13. Jaysds1

    Next Map

    I'm not sure if there's a button for this, but if there is then it might still be in development mode.
  14. If your new to MTA Servers, I would suggest starting a resource like freeroam, play, race. These are the basic gamemodes of San Andreas. If you want to make a RPG,RP, Race, Freeroam server then I would suggest start learning LUA.
  15. Jaysds1

    Question

    Sorry, but you have to start scripting to make those stuff... Unless you mean the freeroam resource. That folder only has client-sided scripts...
  16. Jaysds1

    Help ME

    Srry, We can't help u MiX#if this is a stolen script/copied.
  17. Jaysds1

    Help ME

    sorry, you're going to need to use server side functions to get them: getResourceInfo getResourceName
  18. I tried making the script but for some reason it doesn't work...
  19. Jaysds1

    GUI

    Here's a code: local screenWidth, screenHeight = guiGetScreenSize() local windowWidth, windowHeight = 240, 89 local left = screenWidth/2 - windowWidth/2 local top = screenHeight/2 - windowHeight/2 prog = guiCreateWindow(left, top, windowWidth, windowHeight,MIDDLE, false) You should use this program, It helped me with my Login GUI: viewtopic.php?f=91&t=27739&p=427822&hilit=+LUA#p427765
  20. Jaysds1

    problem

    When you start your tests, are you actually over the mapped area?
  21. Jaysds1

    login

    Your first code works perfectly, there's no problem with it: --//Register / Login panel function createLoginPanel() fadeCamera(true, 6, 0, 0, 0) setCameraMatrix(-1475.5, 831.18, 65.5, -1487.5, 800.18, 65.5) showPlayerHudComponent("radar", false) showPlayerHudComponent("area_name", false) local player = string.gsub(getPlayerName(getLocalPlayer()),"#%x%x%x%x%x%x", "") window = guiCreateWindow(300,220,417,270,"Login Panel",false) gang_lbl = guiCreateLabel(16,31,385,19,"'Welcome to the Gang War Server'",false,window) guiLabelSetHorizontalAlign(gang_lbl,"center",false) guiSetFont(gang_lbl,"default-bold-small") tabs = guiCreateTabPanel(16,54,388,186,false,window) login_tab = guiCreateTab("Login",tabs) lblLogin = guiCreateLabel(10,11,99,24,"Login:",false,login_tab) lblReg = guiCreateLabel(8,38,78,23,"Password:",false,login_tab) remember = guiCreateCheckBox(6,58,109,23,"Remember me?",false,false,login_tab) guiCheckBoxSetSelected(remember,true) login_edit = guiCreateEdit(96,7,212,23,player,false,login_tab) guiEditSetReadOnly(login_edit,true) pass_edit = guiCreateEdit(95,36,214,23,"",false,login_tab) guiEditSetMasked(pass_edit,true) welcome1 = guiCreateLabel(29,90,336,55,"Welcome!",false,login_tab) guiLabelSetHorizontalAlign(welcome1,"center",false) guiSetFont(welcome1,"sa-gothic") login_Btn = guiCreateButton(310,8,75,51,"Login",false,login_tab) reg_tab = guiCreateTab("Register",tabs) reg_lbl = guiCreateLabel(15,15,47,18,"Login:",false,reg_tab) reg_edit = guiCreateEdit(115,10,216,25,player,false,reg_tab) guiEditSetReadOnly(reg_edit,true) reglbl_pass = guiCreateLabel(14,48,59,17,"Password:",false,reg_tab) reg_pass_edit = guiCreateEdit(115,44,216,25,"",false,reg_tab) cfpass = guiCreateLabel(11,82,101,17,"Confirm Password:",false,reg_tab) guiEditSetMasked(reg_pass_edit,true) confreg_pass = guiCreateEdit(115,77,216,25,"",false,reg_tab) guiEditSetMasked(confreg_pass,true) sexlbl = guiCreateLabel(15,111,68,37,"Sex:",false,reg_tab) guiSetFont(sexlbl,"sa-header") female_radio = guiCreateRadioButton(182,115,16,19,"",false,reg_tab) male_radio = guiCreateRadioButton(115,114,16,19,"",false,reg_tab) guiRadioButtonSetSelected(male_radio,true) male_lbl = guiCreateLabel(114,135,33,14,"Male",false,reg_tab) female_lbl = guiCreateLabel(175,136,39,14,"Female",false,reg_tab) register_btn = guiCreateButton(243,122,137,31,"Register",false,reg_tab) infotwix = guiCreateLabel(18,245,130,19,"Login Panel by Stolka",false,window) guiLabelSetColor(infotwix,0,255,0) guiWindowSetSizable(window, false)--//Block editing size of the window. guiWindowSetMovable(window, false)--//Block move window. end function LoginPanel() createLoginPanel() triggerServerEvent("getSavePassword", getLocalPlayer(), guiGetText(login_edit)) addEventHandler("onClientGUIClick", login_Btn, clientSubmitLogin) addEventHandler("onClientGUIClick", register_btn, clientSubmitRegister) addEventHandler("onClientPlayerChangeNick", getLocalPlayer(), destroyDataPasswordAndAddlogin) showCursor(true) guiSetInputEnabled(true) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), LoginPanel) --//Register Players function clientSubmitRegister() if source == register_btn then local Login = guiGetText(reg_edit) local Password = guiGetText(reg_pass_edit) local ConfirmPassword = guiGetText(confreg_pass) --//Check the floor player. if guiRadioButtonGetSelected(male_radio) then sex = "Male" else sex = "Female" end if (Login == "") then outputChatBox("#CC0033[sERVER]: #339933Write your Login!", 0, 0, 0, true) return 0 end if (Password == "") then outputChatBox("#CC0033[sERVER]: #339933Write your Password!", 0, 0, 0, true) return 0 end if (Password ~= ConfirmPassword) then outputChatBox("#CC0033[sERVER]: #339933Passwords don't match!", 0, 0, 0,true) return 0 end triggerServerEvent("submitRegister", getLocalPlayer(), Login, Password, sex) end end --//Enter in account function clientSubmitLogin() if source == login_Btn then local Login = guiGetText(login_edit) local Password = guiGetText(pass_edit) local CheckBoxStat = guiCheckBoxGetSelected(remember) if (Login == "") then outputChatBox("#CC0033[sERVER]: #339933Write your Login!", 0, 0, 0, true) return 0 end if (Password == "") then outputChatBox("#CC0033[sERVER]: #339933Write your Password!", 0, 0, 0, true) return 0 end triggerServerEvent("submitLogin", getLocalPlayer(), Login, Password, CheckBoxStat) end end --//Close Windows addEvent("login_sucsess", true) addEventHandler("login_sucsess", getRootElement(), function() if getLocalPlayer() then showCursor(false) guiSetInputEnabled(false) guiSetVisible(window, false) end end ) --//Add password and check box true. function addPassword(Password, Login) guiCheckBoxSetSelected(remember, true) guiSetText(pass_edit, Password) end addEvent("addPassword", true) addEventHandler("addPassword", getRootElement(), addPassword) --//Remove password when player changed nick function destroyDataPasswordAndAddlogin(oldNick, newNick) guiSetText(login_edit, string.gsub(newNick,"#%x%x%x%x%x%x", "")) guiSetText(reg_edit, string.gsub(newNick,"#%x%x%x%x%x%x", "")) if (guiGetText(pass_edit) ~= "") then guiSetText(pass_edit, "") end if (guiCheckBoxGetSelected(remember) == true) then guiCheckBoxSetSelected(remember, false) end end --//Register the account function RegisterPlayer(Login, Password, sex) if (getAccount(Login)) then outputChatBox("#CC0033[sERVER]: #339933This nickname is already registered, choose a other nickname", source, 0, 0, 0,true) return 0 else addAccount(Login, Password) end local playerAccount = getAccount(Login, Password) setAccountData(playerAccount, "money", 2000) setAccountData(playerAccount, "sex", sex) setAccountData(playerAccount, "password", Password) setAccountData(playerAccount, "Kills", 0) setAccountData(playerAccount, "Deads", 0) setAccountData(playerAccount, "canSelectTeam", 1) logIn(source, playerAccount, Password) outputChatBox("#CC0033[sERVER]: #339933You have successfully registered and logged in automatically, do not forget your password ", source, 0, 0, 0,true) outputChatBox("#339933[sERVER] #ffffffYour login #CC0033"..Login.." #ffffffand password #CC0033"..Password.."#ffffff! Good game \"{SMILIES_PATH}/icon_wink.gif\" alt=\"\" title=\"Wink\" />!", source, 0, 0, 0,true) --//Remove the ability to change nickname after joined on the [sERVER]. addEventHandler("onPlayerChangeNick", source, cancelChangeNick) triggerClientEvent(source,"login_success", getRootElement(), source) triggerClientEvent("step1gangs", source) end addEvent("submitRegister", true) addEventHandler("submitRegister", getRootElement(), RegisterPlayer) --//Enter in Account function LoginPlayer(Login, Password, CheckBoxStat) local account = getAccount (Login,Password) if ( account ~= false ) then logIn (source, account, Password) local playerAccount = getAccount(Login, Password) setAccountData(playerAccount, "savePassword", CheckBoxStat) --//Remove the ability to change nickname after joined on the [sERVER]. addEventHandler("onPlayerChangeNick", source, cancelChangeNick) triggerClientEvent("login_sucsess", getRootElement(), source) if not getAccountData (playerAccount, "canSelectTeam") == 1 then triggerClientEvent("step1gangs", source) else local team = getAccountData (playerAccount, "onSavedTeam") local skin = getAccountData(playerAccount, "onSavedSkin") local weapon1 = getAccountData(playerAccount, "onSavedWeapon1") local weapon2 = getAccountData(playerAccount, "onSavedWeapon2") local weapon3 = getAccountData(playerAccount, "onSavedWeapon3") callClientFunction(source,"checkSpawns",team, skin, weapon1, weapon2, weapon3) end else outputChatBox ("#CC0033[sERVER]: #ffffffWrong #CC0033username #ffffffand/or #CC0033password!",source,255,255,255,true) end end addEvent("submitLogin", true) addEventHandler("submitLogin", getRootElement(), LoginPlayer) --//Check password saved or no function getSavePassword(Login) local playerAccount = getAccount(Login) local getSavePassword = getAccountData(playerAccount, "savePassword") local Password = getAccountData(playerAccount, "password") if (getSavePassword == true) then triggerClientEvent("addPassword", getRootElement(), Password, Login) end end addEvent("getSavePassword", true) addEventHandler("getSavePassword", getRootElement(), getSavePassword) function cancelChangeNick(oldNick, newNick) cancelEvent() end --//Logged players after stop gamemode function logOutPlayer(theResourceStopped) if getResourceName(theResourceStopped) == "GangWar" then for k, players in ipairs(getElementsByType("player")) do kickPlayer(players, "Restart Gamemoge") end end end addEventHandler("onResourceStop", getRootElement(), logOutPlayer) ------------------------------------------ -- Call ------------------------------------------ function callServerFunction(funcname, ...) local arg = { ... } if (arg[1]) then for key, value in next, arg do arg[key] = tonumber(value) or value end end loadstring("return "..funcname)()(unpack(arg)) end addEvent("onClientCallsServerFunction", true) addEventHandler("onClientCallsServerFunction", resourceRoot , callServerFunction) function callClientFunction(client, funcname, ...) local arg = { ... } if (arg[1]) then for key, value in next, arg do if (type(value) == "number") then arg[key] = tostring(value) end end end -- If the clientside event handler is not in the same resource, replace 'resourceRoot' with the appropriate element triggerClientEvent(client, "onServerCallsClientFunction", resourceRoot, funcname, unpack(arg or {})) end
  22. Jaysds1

    login

    try this: --//Register the account function RegisterPlayer(Login, Password, sex) if (getAccount(Login)) then outputChatBox("#CC0033[sERVER]: #339933This nickname is already registered, choose a other nickname", client, 0, 0, 0,true) return 0 else addAccount(Login, Password) end local playerAccount = getAccount(Login) setAccountData(playerAccount, "money", 2000) setAccountData(playerAccount, "sex", sex) setAccountData(playerAccount, "password", Password) setAccountData(playerAccount, "Kills", 0) setAccountData(playerAccount, "Deads", 0) setAccountData(playerAccount, "canSelectTeam", 1) logIn(client, playerAccount, Password) outputChatBox("#CC0033[sERVER]: #339933You have successfully registered and logged in automatically, do not forget your password ", client, 0, 0, 0,true) outputChatBox("#339933[sERVER] #ffffffYour login #CC0033"..Login.." #ffffffand password #CC0033"..Password.."#ffffff! Good game \"{SMILIES_PATH}/icon_wink.gif\" alt=\"\" title=\"Wink\" />!", client, 0, 0, 0,true) --//Remove the ability to change nickname after joined on the [sERVER]. addEventHandler("onPlayerChangeNick", client, cancelChangeNick) triggerClientEvent("login_success", getRootElement(), client) triggerClientEvent("step1gangs", client) end addEvent("submitRegister", true) addEventHandler("submitRegister", getRootElement(), RegisterPlayer) --//Enter in Account function LoginPlayer(Login, Password, CheckBoxStat) local account = getAccount (Login,Password) if ( account ~= false ) then logIn (client, account, Password) local playerAccount = getAccount(Login, Password) setAccountData(playerAccount, "savePassword", CheckBoxStat) --//Remove the ability to change nickname after joined on the [sERVER]. addEventHandler("onPlayerChangeNick", client, cancelChangeNick) triggerClientEvent(client,"login_sucsess", getRootElement()) if not getAccountData (playerAccount, "canSelectTeam") == 1 then triggerClientEvent("step1gangs", client) else local team = getAccountData (playerAccount, "onSavedTeam") local skin = getAccountData(playerAccount, "onSavedSkin") local weapon1 = getAccountData(playerAccount, "onSavedWeapon1") local weapon2 = getAccountData(playerAccount, "onSavedWeapon2") local weapon3 = getAccountData(playerAccount, "onSavedWeapon3") callClientFunction(client,"checkSpawns",team, skin, weapon1, weapon2, weapon3) end else outputChatBox ("#CC0033[sERVER]: #ffffffWrong #CC0033username #ffffffand/or #CC0033password!",client,255,255,255,true) end end addEvent("submitLogin", true) addEventHandler("submitLogin", getRootElement(), LoginPlayer) --//Check password saved or no function getSavePassword(Login) local playerAccount = getAccount(Login) local getSavePassword = getAccountData(playerAccount, "savePassword") local Password = getAccountData(playerAccount, "password") if (getSavePassword == true) then triggerClientEvent("addPassword", getRootElement(), Password, Login) end end addEvent("getSavePassword", true) addEventHandler("getSavePassword", getRootElement(), getSavePassword) function cancelChangeNick(oldNick, newNick) cancelEvent() end --//Logged players after stop gamemode function logOutPlayer(theReclientStopped) if getReclientName(theReclientStopped) == "GangWar" then for k, players in ipairs(getElementsByType("player")) do kickPlayer(players, "Restart Gamemoge") end end end addEventHandler("onReclientStop", getRootElement(), logOutPlayer) ------------------------------------------ -- Call ------------------------------------------ function callServerFunction(funcname, ...) local arg = { ... } if (arg[1]) then for key, value in next, arg do arg[key] = tonumber(value) or value end end loadstring("return "..funcname)()(unpack(arg)) end addEvent("onClientCallsServerFunction", true) addEventHandler("onClientCallsServerFunction", reclientRoot , callServerFunction) function callClientFunction(client, funcname, ...) local arg = { ... } if (arg[1]) then for key, value in next, arg do if (type(value) == "number") then arg[key] = tostring(value) end end end -- If the clientside event handler is not in the same reclient, replace 'reclientRoot' with the appropriate element triggerClientEvent(client, "onServerCallsClientFunction", reclientRoot, funcname, unpack(arg or {})) end
  23. Jaysds1

    Lag and FPS Drops

    New Paste: http://pastebin.com/f64hHhMu
×
×
  • Create New...