Parazitas Posted January 18, 2016 Share Posted January 18, 2016 Helo i have group system but.. then i make server restart created group not save.. Link to comment
WhoAmI Posted January 18, 2016 Share Posted January 18, 2016 So? That post says nothing to me. All I can say is that your 'group system' doesn't save data. Link to comment
Parazitas Posted January 18, 2016 Author Share Posted January 18, 2016 Confrim_c ---------------------------------------------------------- -- Confirmation WIndow -- ---------------------------------------------------------- local confirmWindowArgs = { } local confirm = {} confirm.window = guiCreateWindow( (sx_/2-(sx*324)/2), (sy_/2-(sy*143)/2), sx*324, sy*143, "Užklausa", false) confirm.text = guiCreateLabel(sx*10, sy*35, sx*304, sy*65, "", false, confirm.window) guiSetVisible ( confirm.window, false ) guiSetFont(confirm.text, "default-bold-small") guiLabelSetHorizontalAlign(confirm.text, "left", true) guiWindowSetSizable ( confirm.window, false ) confirm.yes = guiCreateButton(sx*10, sy*100, sx*108, sy*25, "Priimti", false, confirm.window) confirm.no = guiCreateButton(sx*128, sy*100, sx*108, sy*25, "Atmesti", false, confirm.window) function onConfirmClick( ) if ( source ~= confirm.yes and source ~= confirm.no ) then return end removeEventHandler ( "onClientGUIClick", root, onConfirmClick ) guiSetVisible ( confirm.window, false ) confirmWindowArgs.callback ( source == confirm.yes, unpack ( confirmWindowArgs.args ) ) confirmWindowArgs.args = nil confirmWindowArgs.callback = nil confirmWindowArgs = nil end function askConfirm ( question, callback_, ... ) if ( not callback_ or type ( callback_ ) ~= "function" ) then return false end confirmWindowArgs = { } guiSetVisible ( confirm.window, true ) guiSetText ( confirm.text, tostring ( question ) ) confirmWindowArgs.callback = callback_ confirmWindowArgs.args = { ... } addEventHandler ( "onClientGUIClick", root, onConfirmClick ) guiBringToFront ( confirm.window ) return true end group_c sx_, sy_ = guiGetScreenSize ( ) sx, sy = sx_ / 1280, sy_ / 720 local group = nil local gList = nil function createGroupGui ( ) exports.ngmessages:sendClientMessage ( "Kraunama...", 255, 255, 0 ); gui = { main ={ }, info = { create = { }, invites = { }, motd = { } }, list = { }, admin = { admin = { }, info = { }, members = { }, ranks = { }, logs = { } }, my = { basic = { }, logs_ = { }, bank_ = { }, members_ = { }, ranks_ = { }, motd = { } } } -- main local sx__, sy__ = sx, sy local sx, sy = 1, 1 gui.main.window = guiCreateWindow((sx_/2-(sx*660)/2), (sy_/2-(sy*437)/2), sx*660, sy*437, "Grupės valdymo panelė", false) gui.main.info = guiCreateButton(sx*10, sy*26, sx*128, sy*40, "Informacija", false, gui.main.window) gui.main.list = guiCreateButton(sx*148, sy*26, sx*128, sy*40, "Grupiu sąrašas", false, gui.main.window) gui.main.my = guiCreateButton(sx*286, sy*26, sx*128, sy*40, "Mano grupė", false, gui.main.window) gui.main.admin = guiCreateButton(sx*500, sy*26, sx*128, sy*40, "Grupės valdymas", false, gui.main.window) gui.main.line = guiCreateLabel(0, 74, sx*660, 24, string.rep ( "_", 200 ), false, gui.main.window) gui.main.admin.visible = ( getElementData ( localPlayer, "staffLevel" ) or 0 ) > 2 guiWindowSetSizable(gui.main.window, false) -- information gui.info.account = guiCreateLabel(sx*42, sy*136, sx*269, sy*20, "Žaidėjo vardas: none", false, gui.main.window) gui.info.group = guiCreateLabel(sx*42, sy*156, sx*269, sy*20, "Grupės pavadinimas: none", false, gui.main.window) gui.info.rank = guiCreateLabel(sx*42, sy*176, sx*269, sy*20, "Tavo grupės rangas: none", false, gui.main.window) gui.info.create_ = guiCreateButton ( sx*42, sy*280, sx*130, sy*40, "Sukurti grupę", false, gui.main.window ) gui.info.mInvites = guiCreateButton ( 180, 280, 130, 40, "Pakvietimai", false, gui.main.window ) gui.info.gMotd = guiCreateButton ( 318, 280, 130, 40, "Grupės MOTD", false, gui.main.window ) -- info -> create gui.info.create.window = guiCreateWindow(sx*383, sy*227, sx*500, sy*283, "Sukurti Grupę", false) guiWindowSetSizable(gui.info.create.window, false) gui.info.create.l1 = guiCreateLabel(sx*22, sy*40, sx*184, sy*20, "Grupės pavadinimas:", false, gui.info.create.window) gui.info.create.name = guiCreateEdit(sx*207, sy*40, sx*219, sy*20, "", false, gui.info.create.window) gui.info.create.l2 = guiCreateLabel(sx*22, sy*78, sx*184, sy*20, "Grupės spalva:", false, gui.info.create.window) gui.info.create.cr = guiCreateEdit(sx*207, sy*78, sx*54, sy*20, "0", false, gui.info.create.window) gui.info.create.cg = guiCreateEdit(sx*261, sy*78, sx*54, sy*20, "0", false, gui.info.create.window) gui.info.create.cb = guiCreateEdit(sx*315, sy*78, sx*54, sy*20, "0", false, gui.info.create.window) gui.info.create.cpick = guiCreateButton(sx*370, sy*78, sx*56, sy*20, "cpicker", false, gui.info.create.window) gui.info.create.l3 = guiCreateLabel(sx*23, sy*122, sx*184, sy*20, "Grupės Tipas:", false, gui.info.create.window) gui.info.create.type = guiCreateComboBox(sx*204, sy*122, sx*216, sy*93, "", false, gui.info.create.window) gui.info.create.create = guiCreateButton(sx*333, sy*215, sx*87, sy*27, "Kurti!", false, gui.info.create.window) gui.info.create.close = guiCreateButton(sx*238, sy*215, sx*87, sy*27, "Uždaryti", false, gui.info.create.window) guiEditSetReadOnly(gui.info.create.cb, true) guiEditSetReadOnly(gui.info.create.cr, true) guiEditSetReadOnly(gui.info.create.cg, true) guiComboBoxAddItem(gui.info.create.type, "Gangas") guiComboBoxAddItem(gui.info.create.type, "Paslaugos") guiComboBoxAddItem(gui.info.create.type, "Grupė") -- info -> my invites gui.info.invites.window = guiCreateWindow(345, 146, 640, 378, "Mano grupės pakvietimai", false) guiWindowSetSizable(gui.info.invites.window, false) gui.info.invites.label = guiCreateLabel(38, 33, 504, 21, "Mano grupės pakvietimai", false, gui.info.invites.window) gui.info.invites.list = guiCreateGridList(21, 54, 599, 267, false, gui.info.invites.window) guiGridListAddColumn(gui.info.invites.list, "Grupė", 0.3) guiGridListAddColumn(gui.info.invites.list, "Laikas", 0.3) guiGridListAddColumn(gui.info.invites.list, "Iš", 0.3) guiGridListSetSortingEnabled ( gui.info.invites.list, false ) gui.info.invites.accept = guiCreateButton(21, 331, 117, 31, "Primti", false, gui.info.invites.window) gui.info.invites.deny = guiCreateButton(140, 331, 117, 31, "Atsisakyti", false, gui.info.invites.window) gui.info.invites.close = guiCreateButton(503, 331, 117, 31, "Uždaryti", false, gui.info.invites.window ) -- info -> motd gui.info.motd.window = guiCreateWindow(392, 169, 528, 410, "Grupės MOTD", false) guiWindowSetSizable(gui.info.motd.window, false) gui.info.motd.motd = guiCreateMemo(9, 26, 509, 340, "", false, gui.info.motd.window) gui.info.motd.cancel = guiCreateButton(374, 370, 144, 30, "Uždaryti", false, gui.info.motd.window) -- list gui.list.list = guiCreateGridList(sx*10, sy*108, sx*640, sy*319, false, gui.main.window) guiGridListAddColumn(gui.list.list, "Grupė", 0.32) guiGridListAddColumn(gui.list.list, "Grupės Bosas", 0.32) guiGridListAddColumn(gui.list.list, "Grupės tipas", 0.15) guiGridListAddColumn(gui.list.list, "Nariai", 0.1) guiGridListSetSortingEnabled ( gui.list.list, false ) -- my gui.my.info = guiCreateButton(10, 120, 128, 40, "Pagrindinė informacija", false, gui.main.window) gui.my.members = guiCreateButton(147, 122, 128, 40, "Nariai", false, gui.main.window) gui.my.ranks = guiCreateButton(285, 122, 128, 40, "Rangai", false, gui.main.window) gui.my.bank = guiCreateButton(424, 122, 128, 40, "Bankas", false, gui.main.window) gui.my.logs = guiCreateButton(10, 170, 128, 40, "Logai", false, gui.main.window) gui.my.modColor = guiCreateButton(147, 170, 128, 40, "Keisti spalvą", false, gui.main.window) gui.my.modMotd = guiCreateButton(285, 170, 128, 40, "Keisti MOTD", false, gui.main.window) gui.my.leave = guiCreateButton(10, 270, 128, 40, "Palikti grupe", false, gui.main.window) gui.my.delete = guiCreateButton(147, 270, 128, 40, "Pašalinti grupę", false, gui.main.window) -- my -> Basic information gui.my.basic.window = guiCreateWindow(509, 233, 317, 160, "Grupės informacija", false) guiWindowSetSizable(gui.my.basic.window, false) gui.my.basic.group = guiCreateLabel(15, 31, 241, 19, "Grupė: none", false, gui.my.basic.window) gui.my.basic.founder = guiCreateLabel(15, 51, 241, 19, "Originalus bosas: none", false, gui.my.basic.window) gui.my.basic.founded = guiCreateLabel(15, 71, 241, 19, "bosas nuo: none", false, gui.my.basic.window) gui.my.basic.close = guiCreateButton(15, 100, 91, 32, "Uždaryti", false, gui.my.basic.window) -- my -> Logs gui.my.logs_.window = guiCreateWindow(341, 142, 634, 392, "Grupės logai", false) guiWindowSetSizable(gui.my.logs_.window, false) gui.my.logs_.list = guiCreateGridList(9, 25, 615, 311, false, gui.my.logs_.window) guiGridListAddColumn(gui.my.logs_.list, "Laikas", 0.28) guiGridListAddColumn(gui.my.logs_.list, "Paskyra", 0.2) guiGridListAddColumn(gui.my.logs_.list, "Logas", 0.7) guiGridListSetSortingEnabled ( gui.my.logs_.list, false ) gui.my.logs_.close = guiCreateButton(488, 346, 136, 33, "Uždaryti", false, gui.my.logs_.window) gui.my.logs_.clear = guiCreateButton(342, 346, 136, 33, "išvalyti", false, gui.my.logs_.window) -- my -> Bank gui.my.bank_.window = guiCreateWindow(481, 270, 306, 141, "Grupės bankas", false) guiWindowSetSizable(gui.my.bank_.window, false) gui.my.bank_.balance = guiCreateLabel(14, 26, 372, 24, "Grupės bankas: €0", false, gui.my.bank_.window) gui.my.bank_.amount = guiCreateEdit(14, 55, 120, 23, "0", false, gui.my.bank_.window) gui.my.bank_.dep = guiCreateRadioButton(144, 40, 75, 23, "Įdėti", false, gui.my.bank_.window) guiRadioButtonSetSelected(gui.my.bank_.dep, true) gui.my.bank_.go = guiCreateButton(16, 88, 120, 28, "Taip", false, gui.my.bank_.window) gui.my.bank_.close = guiCreateButton(140, 88, 120, 28, "Uždaryti", false, gui.my.bank_.window) gui.my.bank_.with = guiCreateRadioButton(144, 63, 75, 23, "Išgryninti", false, gui.my.bank_.window) -- my -> Ranks gui.my.ranks_.window = guiCreateWindow(551, 195, 378, 387, "Grupės rangu tvarkyklė", false) guiWindowSetSizable(gui.my.ranks_.window, false) gui.my.ranks_.lbl_1 = guiCreateLabel(21, 30, 220, 22, "Rango pavadinimas:", false, gui.my.ranks_.window) gui.my.ranks_.name = guiCreateEdit(21, 55, 282, 25, "", false, gui.my.ranks_.window) gui.my.ranks_.name.setMaxLength = 35 gui.my.ranks_.scroll = guiCreateScrollPane(28, 93, 313, 238, false, gui.my.ranks_.window) gui.my.ranks_.lbl_2 = guiCreateLabel(8, 9, 248, 17, "Nariai", false, gui.my.ranks_.scroll) guiSetFont(gui.my.ranks_.lbl_2, "default-bold-small") gui.my.ranks_['perm_member_invite'] = guiCreateCheckBox(17, 28, 273, 15, "Pakviesti narių", false, false, gui.my.ranks_.scroll) gui.my.ranks_['perm_member_kick'] = guiCreateCheckBox(17, 43, 273, 15, "Iškickint žaidėjus", false, false, gui.my.ranks_.scroll) gui.my.ranks_['perm_member_setrank'] = guiCreateCheckBox(17, 58, 273, 15, "Nustatyti nario rangą", false, false, gui.my.ranks_.scroll) gui.my.ranks_['perm_member_viewlog'] = guiCreateCheckBox(17, 73, 273, 15, "Žiūrėti logus", false, false, gui.my.ranks_.scroll) gui.my.ranks_.lbl_3 = guiCreateLabel(10, 88, 248, 17, "Grupės bankas", false, gui.my.ranks_.scroll) guiSetFont(gui.my.ranks_.lbl_3, "default-bold-small") gui.my.ranks_['perm_bank_withdraw'] = guiCreateCheckBox(17, 105, 273, 15, "Išgryninti iš banko", false, false, gui.my.ranks_.scroll ) gui.my.ranks_['perm_bank_deposit'] = guiCreateCheckBox(17, 120, 273, 15, "įdėti i banką", true, false, gui.my.ranks_.scroll) gui.my.ranks_.lbl_4 = guiCreateLabel(10, 135, 248, 17, "Grupės logai", false, gui.my.ranks_.scroll ) guiSetFont(gui.my.ranks_.lbl_4, "default-bold-small") gui.my.ranks_['perm_logs_view'] = guiCreateCheckBox(17, 152, 273, 15, "Žiūrėti logus", true, false, gui.my.ranks_.scroll) gui.my.ranks_['perm_logs_clear'] = guiCreateCheckBox(17, 167, 273, 15, "Išvalyti logus", false, false, gui.my.ranks_.scroll) gui.my.ranks_.lbl_5 = guiCreateLabel(10, 182, 248, 17, "Grupės rangai", false, gui.my.ranks_.scroll) guiSetFont(gui.my.ranks_.lbl_5, "default-bold-small") gui.my.ranks_['perm_ranks_create'] = guiCreateCheckBox(17, 199, 273, 15, "Kurti rangą", false, false, gui.my.ranks_.scroll) gui.my.ranks_['perm_ranks_delete'] = guiCreateCheckBox(17, 214, 273, 15, "Trinti rangą", false, false, gui.my.ranks_.scroll) gui.my.ranks_.lbl_6 = guiCreateLabel(10, 229, 248, 17, "Grupės nustatymai", false, gui.my.ranks_.scroll) guiSetFont(gui.my.ranks_.lbl_6, "default-bold-small") gui.my.ranks_['perm_group_modify_color'] = guiCreateCheckBox(20, 246, 273, 15, "Keisti grupės MOTD", false, false, gui.my.ranks_.scroll) gui.my.ranks_['perm_group_modify_motd'] = guiCreateCheckBox(20, 261, 273, 15, "Keisti grupės spalvą", false, false, gui.my.ranks_.scroll) gui.my.ranks_.add = guiCreateButton(241, 341, 99, 28, "Pridėti rangą", false, gui.my.ranks_.window) gui.my.ranks_.close = guiCreateButton(132, 341, 99, 28, "Atšaukti", false, gui.my.ranks_.window) -- my -> Members gui.my.members_.window = guiCreateWindow(345, 146, 640, 378, "Mano grupės membai", false) guiWindowSetSizable(gui.my.members_.window, false) gui.my.members_.label = guiCreateLabel(38, 33, 504, 21, "Mano grupės membai", false, gui.my.members_.window) gui.my.members_.list = guiCreateGridList(21, 54, 599, 267, false, gui.my.members_.window) guiGridListAddColumn(gui.my.members_.list, "Nickas", 0.3) guiGridListAddColumn(gui.my.members_.list, "Rangas", 0.3) guiGridListAddColumn(gui.my.members_.list, "Online", 0.3) guiGridListSetSortingEnabled ( gui.my.members_.list, false ) gui.my.members_.log = guiCreateButton(21, 331, 117, 31, "Žaidėjo logas", false, gui.my.members_.window) gui.my.members_.srank = guiCreateButton(140, 331, 117, 31, "Keisti rangą", false, gui.my.members_.window) gui.my.members_.kick = guiCreateButton(259, 331, 117, 31, "Išspirti", false, gui.my.members_.window) gui.my.members_.invite = guiCreateButton(378, 331, 117, 31, "Pakviesti", false, gui.my.members_.window) gui.my.members_.close = guiCreateButton(503, 331, 117, 31, "Uždaryt", false, gui.my.members_.window ) --> my -> Members -> Player Log gui.my.members_.lWindow = guiCreateWindow(341, 142, 634, 392, "Žaidėjo logas", false) guiWindowSetSizable(gui.my.members_.window, false) gui.my.members_.lList = guiCreateGridList(9, 25, 615, 311, false, gui.my.members_.lWindow) guiGridListAddColumn(gui.my.members_.lList, "Laikas", 0.28) guiGridListAddColumn(gui.my.members_.lList, "Nickas", 0.2) guiGridListAddColumn(gui.my.members_.lList, "Logas", 0.7) guiGridListSetSortingEnabled ( gui.my.members_.lList, false ) gui.my.members_.lClose = guiCreateButton(488, 346, 136, 33, "Uždaryti", false, gui.my.members_.lWindow) -- my -> Members -> Set rank gui.my.members_.rWindow = guiCreateWindow(502, 128, 266, 414, "Group Rank", false) guiWindowSetSizable(gui.my.members_.rWindow, false) gui.my.members_.rRanks = guiCreateComboBox(14, 66, 236, 304, "", false, gui.my.members_.rWindow) gui.my.members_.rUpdate = guiCreateButton(18, 35, 113, 25, "Naujinti", false, gui.my.members_.rWindow) gui.my.members_.rClose = guiCreateButton(137, 35, 113, 25, "Atšaukti", false, gui.my.members_.rWindow) -- my -> Members -> Invite gui.my.members_.iWindow = guiCreateWindow(339, 162, 611, 296, "Pakviesti žaidėjų", false) guiWindowSetSizable(gui.my.members_.iWindow, false) gui.my.members_.iList = guiCreateGridList(9, 22, 592, 223, false, gui.my.members_.iWindow) guiGridListAddColumn(gui.my.members_.iList, "Žaidėjas", 0.9) gui.my.members_.iLabel = guiCreateLabel(16, 254, 102, 27, "Ieškoti žaidėjo:", false, gui.my.members_.iWindow) guiLabelSetVerticalAlign(gui.my.members_.iLabel, "center") gui.my.members_.iFilter = guiCreateEdit(118, 253, 184, 28, "", false, gui.my.members_.iWindow) gui.my.members_.iClose = guiCreateButton(531, 255, 70, 25, "Uždaryti", false, gui.my.members_.iWindow) gui.my.members_.iInvite = guiCreateButton(451, 256, 70, 25, "Kviesti", false, gui.my.members_.iWindow) -- my -> change motd gui.my.motd.window = guiCreateWindow(392, 169, 528, 410, "", false) guiWindowSetSizable(gui.my.motd.window, false) gui.my.motd.motd = guiCreateMemo(9, 26, 509, 340, "", false, gui.my.motd.window) gui.my.motd.update = guiCreateButton(374, 370, 144, 30, "Atnaujinti", false, gui.my.motd.window) gui.my.motd.cancel = guiCreateButton(220, 370, 144, 30, "Atšaukti", false, gui.my.motd.window) -- Administration Panel (NG 1.1.4) gui.admin.window = guiCreateWindow(386, 123, 608, 421, "Grupės manager", false) guiWindowSetSizable(gui.admin.window, false) gui.admin.admin.groupList = guiCreateGridList(9, 21, 401, 390, false, gui.admin.window) guiGridListSetSortingEnabled ( gui.admin.admin.groupList, false ); guiGridListAddColumn ( gui.admin.admin.groupList, "Group", 0.5 ); guiGridListAddColumn ( gui.admin.admin.groupList, "Founder", 0.3 ); guiGridListAddColumn ( gui.admin.admin.groupList, "Members", 0.15 ); gui.admin.admin.groupInfo = guiCreateButton(412, 26, 186, 29, "Basic Information", false, gui.admin.window) gui.admin.admin.groupMembers = guiCreateButton(412, 65, 186, 29, "Members", false, gui.admin.window) gui.admin.admin.groupRanks = guiCreateButton(412, 104, 186, 29, "Ranks", false, gui.admin.window) gui.admin.admin.groupLogs = guiCreateButton(412, 143, 186, 29, "Logs", false, gui.admin.window) gui.admin.admin.closeWindow = guiCreateButton(412, 382, 186, 29, "Close", false, gui.admin.window) gui.admin.admin.deleteGroup = guiCreateButton(412, 182, 186, 29, "Trinti grupę", false, gui.admin.window) guiSetProperty(gui.admin.admin.deleteGroup, "NormalTextColour", "FFFF0000") -- manager->Basic Information gui.admin.info.window = guiCreateWindow(445, 148, 559, 399, "Group Information", false) guiWindowSetSizable(gui.admin.info.window, false) gui.admin.info.list = guiCreateGridList(9, 29, 540, 314, false, gui.admin.info.window) guiGridListAddColumn(gui.admin.info.list, "Data Set", 0.4) guiGridListAddColumn(gui.admin.info.list, "Value", 0.5) gui.admin.info.close = guiCreateButton(10, 353, 164, 36, "Close", false, gui.admin.info.window) -- manager->members gui.admin.members.window = guiCreateWindow(445, 148, 559, 399, "Group Members", false) guiWindowSetSizable(gui.admin.members.window, false) gui.admin.members.list = guiCreateGridList(9, 29, 540, 314, false, gui.admin.members.window) guiGridListAddColumn(gui.admin.members.list, "Account", 0.3) guiGridListAddColumn(gui.admin.members.list, "Rank", 0.3) guiGridListAddColumn(gui.admin.members.list, "Joined", 0.3) gui.admin.members.close = guiCreateButton(10, 353, 164, 36, "Close", false, gui.admin.members.window) -- manager->ranks gui.admin.ranks.window = guiCreateWindow(445, 148, 559, 399, "Group Members", false) guiWindowSetSizable(gui.admin.ranks.window, false) gui.admin.ranks.list = guiCreateGridList(9, 29, 540, 314, false, gui.admin.ranks.window) guiGridListAddColumn(gui.admin.ranks.list, "Permission", 0.5) guiGridListAddColumn(gui.admin.ranks.list, "Access", 0.4) gui.admin.ranks.close = guiCreateButton(10, 353, 164, 36, "Close", false, gui.admin.ranks.window) -- manager->logs gui.admin.logs.window = Link to comment
WhoAmI Posted January 18, 2016 Share Posted January 18, 2016 Well, this script uses other script called 'NGSQL'. Do you have it? Or other question... Where did you get that script from? Link to comment
WhoAmI Posted January 18, 2016 Share Posted January 18, 2016 Read my posts, please... Well, this script uses other script called 'NGSQL'. Do you have it? Or other question... Where did you get that script from? Link to comment
Parazitas Posted January 18, 2016 Author Share Posted January 18, 2016 Well, this script uses other script called 'NGSQL'. Do you have it? Or other question... Where did you get that script from? Its Nerd gaming gamemode im download from web i have NGSQL but still nothing.. Link to comment
Parazitas Posted January 18, 2016 Author Share Posted January 18, 2016 Save all except NGGroups Link to comment
Parazitas Posted January 18, 2016 Author Share Posted January 18, 2016 Download from here Link to comment
Parazitas Posted January 18, 2016 Author Share Posted January 18, 2016 if ( tostring ( get ( "CONNECTION_TYPE" ) ):lower() == "mysql" ) then outputConsole ( "Attempting to connect as MySQL... Please wait") db = dbConnect( "mysql", "dbname="..tostring(get("DATABASE_NAME"))..";host="..tostring(get("MYSQL_HOST"))..";port="..tostring(get("MYSQL_PORT"))..";unix_socket=/opt/lampp/var/mysql/mysql.sock", tostring(get("MYSQL_USER")), tostring(get("MYSQL_PASS")), "share=1;autoreconnect=1" ); elseif ( tostring ( get ( "CONNECTION_TYPE" ) ):lower() == "sqlite" ) then db = dbConnect ( "sqlite", tostring(get("DATABASE_NAME")) .. ".sql" ); else error ( tostring(get("CONNECTION_TYPE")) .. " is an invalid SQL connection -- valid: mysql, sqlite" ); end if not db then print ( "The database has failed to connect") return else print ( "Database has been connected") end function db_query ( ... ) local data = { ... } return dbPoll ( dbQuery ( db, ... ), - 1 ) end function db_exec ( ... ) return dbExec ( db, ... ); end --[[ Columns: Username TEXT, Money TEXT, Armour TEXT, Health TEXT, x TEXT, y TEXT, z TEXT, Skin INT, Interior INT, Dimension INT, Team TEXT Job TEXT, Playtime_mins INT, JailTime INT, WL INT, Weapons TEXT, JobRank TEXT, GroupName TEXT, GroupRank TEXT, LasterOnline DATE, LastSerial TEXT, LastIP TEXT, Kills INT, Deaths INT, weapstats TEXT, items TEXT, unemployedskin INT, vip TEXT, vipexp DATE, plrtosrvrsettings TEXT ]] db_exec ( [[CREATE TABLE IF NOT EXISTS accountdata ( Username VARCHAR(200), Money INT, Armour INT, Health INT, x VARCHAR(20), y VARCHAR(20), z VARCHAR(20), Skin INT, Interior INT, Dimension INT, Team VARCHAR(70), Job VARCHAR(70), Playtime_mins INT, JailTime INT, WL INT, Weapons TEXT, JobRank VARCHAR(20), GroupName VARCHAR(100), GroupRank VARCHAR(100), LastOnline DATE, LastSerial VARCHAR(50), LastIP VARCHAR(20), Kills INT, Deaths INT, weapstats TEXT, items TEXT, unemployedskin INT, vip VARCHAR(100), vipexp DATE, plrtosrvrsettings TEXT )]] ); local weapStats_ = { ['9mm'] = 0, ['silenced'] = 0, ['deagle'] = 0, ['shotgun'] = 0, ['combat_shotgun'] = 0, ['micro_smg'] = 0, ['mp5'] = 0, ['ak47'] = 0, ['m4'] = 0, ['tec-9'] = 0, ['sniper_rifle'] = 0 } function createAccount ( account ) if ( account and type ( account ) == 'string' ) then local plr = getPlayerFromAccount ( account ) local autoIP = "unknown" local autoSerial = "unknown" local weapStats = toJSON ( weapStats_ ) if plr and isElement ( plr ) then autoSerial = getPlayerSerial ( plr ) autoIP = getPlayerIP ( plr ) outputDebugString ( "NGSQL: Creating account "..account.." for player "..getPlayerName ( plr ).." (Serial: "..autoSerial.." || IP: "..autoIP..")" ) else outputDebugString ( "NGSQL: Creating account "..account.." for player N/A (Serial: None || IP: None)" ); end local today = exports['NGPlayerFunctions']:getToday ( ) return db_exec ( [[INSERT INTO `accountdata` (`Username`, `Money`, `Armour`, `Health`, `x`, `y`, `z`, `Skin`, `Interior`, `Dimension`, `Team`, `Job`, `Playtime_mins`, `JailTime`, `WL`, `Weapons`, `JobRank`, `GroupName`, `GroupRank`, `LastOnline`, `LastSerial`, `LastIP`, `Kills`, `Deaths`, `weapstats`, `items`, `unemployedskin`, `vip`, `vipexp`, `plrtosrvrsettings` ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? );]], account, '0', '0', '100', '0', '0', '0', '0', '0', '0', 'UnEmployed', 'UnEmployed', '0', '0', '0', '[ [ ] ]', 'None', 'None', 'None', today, autoSerial, autoIP, '0', '0', weapStats, toJSON ( { } ), '28', 'None', nil, toJSON ( { } ) ) end return false end function getPlayerFromAccount ( accnt ) if accnt and type ( accnt ) == 'string' then for i, v in ipairs ( getElementsByType ( 'player' ) ) do if ( getAccountName ( getPlayerAccount ( v ) ) == accnt ) then return v; end end end return false end function savePlayerData ( p, loadMsg, deleteTime ) if ( p and getElementType ( p ) == 'player' ) then if ( not isGuestAccount ( getPlayerAccount ( p ) ) ) then if ( loadMessage == nil ) then loadMessage = true end if ( deleteTime == nil ) then deleteTime = false end local account = getAccountName ( getPlayerAccount ( p ) ) local x, y, z = getElementPosition ( p ) local money, health = getPlayerMoney ( p ), getElementHealth ( p ) local armor, skin = getPedArmor ( p ), getElementModel ( p ) local int, dim = getElementInterior ( p ), getElementDimension ( p ) local job = getElementData ( p, "Job" ) local pt = exports['NGPlayerFunctions']:getPlayerPlaytime ( p ) local team = "UnEmployed" local wl = getElementData ( p, "WantedPoints" ) or 0 local rank = tostring ( getElementData ( p, "Job Rank" ) ) local group = tostring ( getElementData ( p, "Group" ) ) local gRank = tostring ( getElementData ( p, "Group Rank" ) ) local jt = exports['NGPolice']:isPlayerJailed ( p ) or 0 local weapons = { } local today = exports['NGPlayerFunctions']:getToday ( ) local kills = tonumber ( getElementData ( p, "NGSQL:Kills" ) ) or 0 local deaths = tonumber ( getElementData ( p, "NGSQL:Deaths" ) ) or 0 local weapstats = toJSON ( getElementData ( p, "NGSQL:WeaponStats" ) or weapStats_ ) local items = tostring ( toJSON ( getElementData ( p, "NGUser:Items" ) or { } ) ) local unemloyedSkin = tostring ( getElementData ( p, "NGUser.UnemployedSkin" ) ) or 28 local vip = tostring ( getElementData ( p, "VIP" ) ) local vipexp = tostring ( getElementData ( p, "NGVIP.expDate" ) ) local plrtosrvrsettings = tostring ( toJSON ( getElementData ( p, "PlayerServerSettings" ) or { } ) ) if ( getElementData ( p, "NGEvents:IsPlayerInEvent" ) ) then health = 0 dim = 0 end if ( getPlayerTeam ( p ) ) then team = getTeamName ( getPlayerTeam ( p ) ) end if not armor then armor = 0 end if ( not jt ) then jt = 0 end for i=1,12 do weapons[i] = { getPedWeapon ( p, i ), getPedTotalAmmo ( p, i ) } end local weapons = toJSON ( weapons ) local ip = getPlayerIP ( p ) local serial = getPlayerSerial ( p ) if loadMsg then outputDebugString ( "NGSQL: Attempting to save account "..account.." (Player: "..getPlayerName ( p )..") userdata." ) end if ( deleteTime ) then exports['NGPlayerFunctions']:deletePlayerPlaytime ( p ) end return db_exec ( "UPDATE accountdata SET Money=?, Armour=?, Health=?, x=?, y=?, z=?, Skin=?, Interior=?, Dimension=?, Team=?, Job=?, Playtime_mins=?, JailTime=?, WL=?, Weapons=?, JobRank=?, GroupName=?, GroupRank=?, LastOnline=?, LastSerial=?, lastIP=?, Kills=?, Deaths=?, weapstats=?, items=?, unemployedskin=?, vip=?, vipexp=?, plrtosrvrsettings=? WHERE Username=?", money, armor, health, x, y, z, skin, int, dim, team, job, pt, jt, wl, weapons, rank, group, gRank, today, serial, ip, kills, deaths, weapstats, items, unemloyedSkin, vip, vipexp, plrtosrvrsettings, account ) end end end function loadPlayerData ( p, loadMsg ) local acc = getAccountName ( getPlayerAccount ( p ) ) local data = account_exist ( acc ) if ( data and type ( data ) == 'table' ) then for i, v in ipairs ( data ) do if ( v['Username'] == acc ) then if ( loadMsg == nil ) then loadMesg = true end local money = tonumber ( v['Money'] ) or 0 local armor = tonumber ( v['Armour'] ) or 0 local health = tonumber ( v['Health'] ) or 0 local x = tonumber ( v['x'] ) or 0 local y = tonumber ( v['y'] ) or 0 local z = tonumber ( v['z'] ) or 3 local skin = tonumber ( v['Skin'] ) or 28 local interior = tonumber ( v['Interior'] ) or 0 local dimension = tonumber ( v['Dimension'] ) or 0 local team = tostring ( v['Team'] ) or "None" local job = tostring ( v['Job'] ) or "None" local pt = tonumber ( v["Playtime_mins"] ) or 0 local jt = tonumber ( v['JailTime'] or 0 ) local wl = tonumber ( v['WL'] or 0 ) local weapons = fromJSON ( v['Weapons'] or toJSON ( { } ) ) local rank = tostring ( v['JobRank'] or "None" ) local group = tostring ( v['GroupName'] or "None" ) local gRank = tostring ( v['GroupRank'] or "None" ) local kills = tonumber ( v['Kills'] ) local deaths = tonumber ( v['Deaths'] ) local weapstats = fromJSON ( tostring ( v['weapstats'] ) ) local items = fromJSON ( tostring ( v['items'] ) ) local unemployedSkin=tonumber( v['unemployedskin'] ) or 28 local vip = tostring ( v['vip'] ) local vipexp = tostring ( v['vipexp'] ) local group = tostring ( v['GroupName'] or "None" ) local groupRank = tostring ( v['GroupRank'] or "None" ) local srvrsettings =fromJSON ( tostring ( v['plrtosrvrsettings'] or tosJSON ( { } ) ) ) if ( not exports.nggroups:doesGroupExist ( group ) ) then group = "None" else if ( not exports.nggroups:isRankInGroup ( group, groupRank ) ) then groupRank = "None" end end if ( group:lower ( ) == "none" ) then groupRank = "None" end spawnPlayer ( p, x, y, z, 0, skin, interior, dimension ) setElementData ( p, "Job Rank", rank ) if ( jt > 0 ) then exports['NGPolice']:jailPlayer ( p, jt, false ) end setElementData ( p, "NGSQL:Kills", kills ) setElementData ( p, "NGSQL:Deaths", deaths ) setElementData ( p, "Job", job ) setPedArmor ( p, armor ) givePlayerMoney ( p, money ) exports['NGPlayerFunctions']:setPlayerPlaytime ( p,pt ) setElementData ( p, "WantedPoints", wl ) setElementData ( p, "Group", group ) setElementData ( p, "Group Rank", gRank ) setElementData ( p, "NGSQL:WeaponStats", weapstats ) setElementData ( p, "NGUser:Items", items ) setElementData ( p, "NGUser.UnemployedSkin", unemployedSkin ) setElementData ( p, "VIP", vip ) setElementData ( p, "NGVIP.expDate", vipexp ) setElementHealth ( p, health ) setElementData ( p, "PlayerServerSettings", srvrsettings ) if ( srvrsettings.walkStyle ) then setPedWalkingStyle ( p, srvrsettings.walkStyle) end exports.NGVIP:checkPlayerVipTime ( p ) for i, v in ipairs ( weapons ) do giveWeapon ( p, v[1], v[2] ) end if ( Link to comment
Parazitas Posted January 18, 2016 Author Share Posted January 18, 2016 Nobody can help me? Link to comment
Best-Killer Posted January 18, 2016 Share Posted January 18, 2016 lol it's Nerd Gaming script it's saved bro Note: Don't Forget to start NGantirestart script Link to comment
Parazitas Posted January 19, 2016 Author Share Posted January 19, 2016 lol it's Nerd Gaming script it's saved bro Note: Don't Forget to start NGantirestart script IDK it's don't save... all resources started but when i make host restart just groups not save.. Link to comment
lunix Posted January 20, 2016 Share Posted January 20, 2016 function() local data = data() exports.board:addScoreboardColumn("Group", root, 23) db = dbConnect("sqlite", "database.db") dbExec(db, "CREATE TABLE IF NOT EXISTS groups (group_name, group_members INT, members_limit, group_info, group_history, group_bank INT, turf_color)") dbExec(db, "CREATE TABLE IF NOT EXISTS group_ranks (group_name, group_rank_name, group_rank_permission, rank_type)") dbExec(db, "CREATE TABLE IF NOT EXISTS group_members (group_name, member_account, member_name, member_status, member_rank, last_online, WL)") dbExec(db, "CREATE TABLE IF NOT EXISTS group_invite (group_name, player_account, byy)") check This Function in your Server.lua side For ( Group system) Link to comment
Parazitas Posted January 22, 2016 Author Share Posted January 22, 2016 Add this function or replace it? Link to comment
Parazitas Posted January 22, 2016 Author Share Posted January 22, 2016 with original script just saved group rank and that's it... while everything else disappears. Link to comment
lunix Posted January 22, 2016 Share Posted January 22, 2016 bro go to your server.lua side of Group system in first lines check this Function 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