Best-Killer Posted January 20, 2016 Share Posted January 20, 2016 elseif ( name == 'Police' ) then create3DText ( 'Police', { x, y, z }, { 0, 100, 255 }, { nil, true } ) local p = createElement ( "GodmodePed" ) setElementData ( p, "Model", 286 ) setElementData ( p, "Position", { x, y, z, rz } ) createBlip ( x, y, z, 61, 2, 255, 255, 255, 255, 0, 450 ) addEventHandler ( 'onMarkerHit', createMarker ( x, y, z - 1, 'cylinder', 2, 0, 0, 0, 0 ), function ( p ) if ( getElementType ( p ) == 'player' and not isPedInVehicle ( p ) and not isPedDead ( p ) ) then if ( getPlayerWantedLevel ( p ) > max_wanted.law ) then return exports['SAEGMessages']:sendClientMessage ( "The max wanted level for this job is "..tostring ( max_wanted.law )..".", p, 255, 0, 0 ) end if ( getElementData(p, "type") ~= "Gang" ) then return exports.SAEGMessages:sendClientMessage ("You Can't take this job while you are in the Gang.",p, 255, 7, 7 ) end triggerClientEvent ( p, 'SAEGJobs:OpenJobMenu', p, 'police' ) end end ) no one can get the job i want if play in gang can not take job 000 errors Link to comment
Ab-47 Posted January 20, 2016 Share Posted January 20, 2016 How are you triggering the overall function? It could be that 'p' is not recognised as a player value, which returns the function to an end. Link to comment
Best-Killer Posted January 22, 2016 Author Share Posted January 22, 2016 i'm learning lua bro i don't understand u u can explain to me easy ? Link to comment
Ab-47 Posted January 26, 2016 Share Posted January 26, 2016 i'm learning lua bro i don't understand u u can explain to me easy ? Post your code and I'll help you fix it. The function you have all your code in, how are you calling it? Command handler, event handler? What event? Link to comment
KariiiM Posted January 26, 2016 Share Posted January 26, 2016 Post a full code and re-explain your code situation. Link to comment
Best-Killer Posted January 26, 2016 Author Share Posted January 26, 2016 Full code max_wanted = { community = 0, law = 0, criminal = 7 } jobRanks = { ['criminal'] = { [0] = "L.G", [50] = "L.Y.G", [75] = "Y.G", [120] = "OYG", [200] = "O.G", [310] = "G.C.L", [499] = "G.L", }, ['police officer'] = { [0] ="Officer", [90]="Corporal", [200]="Trooper", [310]="Sergeant", [450]="Captain", [600]="Commander", [900]="FBI Agent", }, ['medic'] = { [0] = "Assistant", [50] = "Training", [100]= "Nurse", [130] = "Paramedic", [200] = "Doctor", [260] = "Surgeon" }, ['mechanic'] = { [0] = "Rookie", [40] = "Wheel Specialist", [100]= "Engine Specialist", [140]= "Vehicle Professional", [200]= "Motorcycle Specialist", [245]= "Vehicle Master" }, ['fisherman'] = { [0] = "Deck Hand", [20]= "Net Baiter", [75]= "Line Thrower", [100]="Line Roller", [140]="Boat Captain", [200]="Experienced Fisherman", [270]="Underwater Trap Setter" }, ['detective'] = { [0] = "Detective", }, ['military'] = { [0] = "Military" }, ['swat'] = { [0] = "SWAT" }, ['pilot'] = { [0] = "Junior flight officer", [25] = "Flight Officer", [50] = "First Officer", [120] = "Captain", [180] = "Senior Captain", [250] = "Commercial First Officer", [310] = "Commercial Captain", [390] = "Commercial Commander", [460] = "Commercial Senior Commander", }, ['stunter'] = { [0] = "Crash Dummy", [50] = "Crash", [150] = "Experienced", [200] = "Professional", [300] = "Expert BMXer" } } function getJobRankTable ( ) return jobRanks end exports['scoreboard']:scoreboardAddColumn ( "Job", root, 90, "Job", 4 ) exports['scoreboard']:scoreboardAddColumn ( "Job Rank", root, 90, "Job Rank", 5 ) function create3DText ( str, pos, color, parent, settings ) if str and pos and color then local text = createElement ( '3DText' ) local settings = settings or { } setElementData ( text, "text", str ) setElementData ( text, "position", pos ) setElementData ( text, "color", color ) if ( not parent ) then parent = nil else if ( isElement ( parent ) ) then parent = parent else parent = nil end end setElementData ( text, "Settings", settings ) setElementData ( text, "parentElement", parent ) setElementData ( text, "sourceResource", sourceResource or getThisResource ( )) return text end return false end addEventHandler ( "onResourceStop", root, function ( r ) for i, v in pairs ( getElementsByType ( "3DText" ) ) do if ( r == getElementData ( v, "sourceResource" ) ) then destroyElement ( v ) end end end ) function createJob ( name, x, y, z, rz ) if ( name == 'Criminal' ) then create3DText ( 'Criminal', { x, y, z }, { 255, 0, 0 }, { nil, true } ) local p = createElement ( "GodmodePed" ) setElementData ( p, "Model", 109 ) setElementData ( p, "Position", { x, y, z, rz } ) createBlip ( x, y, z, 59, 2, 255, 255, 255, 255, 0, 450 ) addEventHandler ( 'onMarkerHit', createMarker ( x, y, z - 1, 'cylinder', 2, 0, 0, 0, 0 ), function ( p ) if ( getElementType ( p ) == 'player' and not isPedInVehicle ( p ) and not isPedDead ( p ) ) then if ( getPlayerWantedLevel ( p ) > max_wanted.criminal ) then return exports['SAEGMessages']:sendClientMessage ( "The max wanted level for this job is "..tostring ( max_wanted.criminal )..".", p, 255, 0, 0 ) end triggerClientEvent ( p, 'SAEGJobs:OpenJobMenu', p, 'criminal' ) end end ) ---------------------------------- -- Law Jobs -- ---------------------------------- elseif ( name == 'Police' ) then create3DText ( 'Police', { x, y, z }, { 0, 100, 255 }, { nil, true } ) local p = createElement ( "GodmodePed" ) setElementData ( p, "Model", 286 ) setElementData ( p, "Position", { x, y, z, rz } ) createBlip ( x, y, z, 61, 2, 255, 255, 255, 255, 0, 450 ) addEventHandler ( 'onMarkerHit', createMarker ( x, y, z - 1, 'cylinder', 2, 0, 0, 0, 0 ), function ( p ) if ( getElementType ( p ) == 'player' and not isPedInVehicle ( p ) and not isPedDead ( p ) ) then if ( getPlayerWantedLevel ( p ) > max_wanted.law ) then return exports['SAEGMessages']:sendClientMessage ( "The max wanted level for this job is "..tostring ( max_wanted.law )..".", p, 255, 0, 0 ) end triggerClientEvent ( p, 'SAEGJobs:OpenJobMenu', p, 'police' ) end end ) elseif ( name == 'Detective' ) then create3DText ( 'Detective', { x, y, z }, { 0, 120, 255 }, { nil, true } ) local p = createElement ( "GodmodePed" ) setElementData ( p, "Model", 17 ) setElementData ( p, "Position", { x, y, z, rz } ) createBlip ( x, y, z, 61, 2, 255, 255, 255, 255, 0, 450 ) addEventHandler ( 'onMarkerHit', createMarker ( x, y, z - 1, 'cylinder', 2, 0, 0, 0, 0 ), function ( p ) if ( getElementType ( p ) == 'player' and not isPedInVehicle ( p ) and not isPedDead ( p ) ) then if ( getPlayerWantedLevel ( p ) > max_wanted.law ) then return exports['SAEGMessages']:sendClientMessage ( "The max wanted level for this job is "..tostring ( max_wanted.law )..".", p, 255, 0, 0 ) end local arrests = getJobColumnData ( getAccountName ( getPlayerAccount ( p ) ), getDatabaseColumnTypeFromJob ( "police officer" ) ) if ( arrests < 0 ) then return exports.SAEGMessages:sendClientMessage ( "This job requires at least 150 arrests", p, 255, 255, 0 ) end triggerClientEvent ( p, 'SAEGJobs:OpenJobMenu', p, 'detective' ) end end ) elseif ( name == 'Military' ) then create3DText ( 'Military', { x, y, z }, { 0, 102, 0 }, { nil, true } ) local p = createElement ( "GodmodePed" ) setElementData ( p, "Model", 287 ) setElementData ( p, "Position", { x, y, z, rz } ) addEventHandler ( 'onMarkerHit', createMarker ( x, y, z - 1, 'cylinder', 2, 0, 0, 0, 0 ), function ( p ) if ( getElementType ( p ) == 'player' and not isPedInVehicle ( p ) and not isPedDead ( p ) ) then if ( getPlayerWantedLevel ( p ) > max_wanted.law ) then return exports['SAEGMessages']:sendClientMessage ( "The max wanted level for this job is "..tostring ( max_wanted.law )..".", p, 255, 0, 0 ) end if ( getElementData(p, "Group") ~= "Military" ) then return exports['SAEGMessages']:sendClientMessage ( "This job is available only for Military members.", p, 255, 0, 0) end local arrests = getJobColumnData ( getAccountName ( getPlayerAccount ( p ) ), getDatabaseColumnTypeFromJob ( "police officer" ) ) if ( arrests < 0 ) then return exports.SAEGMessages:sendClientMessage ( "This job requires at least 150 arrests", p, 255, 255, 0 ) end triggerClientEvent ( p, 'SAEGJobs:OpenJobMenu', p, 'military' ) end end ) elseif ( name == 'SWAT' ) then create3DText ( 'SWAT', { x, y, z }, { 0, 0, 255 }, { nil, true } ) local p = createElement ( "GodmodePed" ) setElementData ( p, "Model", 285 ) setElementData ( p, "Position", { x, y, z, rz } ) addEventHandler ( 'onMarkerHit', createMarker ( x, y, z - 1, 'cylinder', 2, 0, 0, 0, 0 ), function ( p ) if ( getElementType ( p ) == 'player' and not isPedInVehicle ( p ) and not isPedDead ( p ) ) then if ( getPlayerWantedLevel ( p ) > max_wanted.law ) then return exports['SAEGMessages']:sendClientMessage ( "The max wanted level for this job is "..tostring ( max_wanted.law )..".", p, 255, 0, 0 ) end if ( getElementData(p, "Group") ~= "SWAT" ) then return exports['SAEGMessages']:sendClientMessage ( "This job is available only for SWAT members.", p, 255, 0, 0) end local arrests = getJobColumnData ( getAccountName ( getPlayerAccount ( p ) ), getDatabaseColumnTypeFromJob ( "police officer" ) ) if ( arrests < 0 ) then return exports.SAEGMessages:sendClientMessage ( "This job requires at least 150 arrests", p, 255, 255, 0 ) end triggerClientEvent ( p, 'SAEGJobs:OpenJobMenu', p, 'swat' ) end end ) ---------------------------------- -- Emergency Jobs -- ---------------------------------- elseif ( name == 'Medic' ) then create3DText ( 'Medic', { x, y, z }, { 0, 255, 255 }, { nil, true } ) local p = createElement ( "GodmodePed" ) setElementData ( p, "Model", 274 ) setElementData ( p, "Position", { x, y, z, rz } ) createBlip ( x, y, z, 58, 2, 255, 255, 255, 255, 0, 450 ) addEventHandler ( 'onMarkerHit', createMarker ( x, y, z - 1, 'cylinder', 2, 0, 0, 0, 0 ), function ( p ) if ( getElementType ( p ) == 'player' and not isPedInVehicle ( p ) and not isPedDead ( p ) ) then if ( getPlayerWantedLevel ( p ) > max_wanted.community ) then return exports['SAEGMessages']:sendClientMessage ( "The max wanted level for this job is "..tostring ( max_wanted.community )..".", p, 255, 0, 0 ) end triggerClientEvent ( p, 'SAEGJobs:OpenJobMenu', p, 'medic' ) end end ) ---------------------------------- -- Community Jobs -- ---------------------------------- elseif ( name == 'Mechanic' ) then create3DText ( 'Mechanic', { x, y, z }, { 255, 255, 0 }, { nil, true } ) local p = createElement ( "GodmodePed" ) setElementData ( p, "Model", 30 ) setElementData ( p, "Position", { x, y, z, rz } ) createBlip ( x, y, z, 60, 2, 255, 255, 255, 255, 0, 450 ) addEventHandler ( 'onMarkerHit', createMarker ( x, y, z - 1, 'cylinder', 2, 0, 0, 0, 0 ), function ( p ) if ( getElementType ( p ) == 'player' and not isPedInVehicle ( p ) and not isPedDead ( p ) ) then if ( getPlayerWantedLevel ( p ) > max_wanted.community ) then return exports['SAEGMessages']:sendClientMessage ( "The max wanted level for this job is "..tostring ( max_wanted.community )..".", p, 255, 0, 0 ) end triggerClientEvent ( p, 'SAEGJobs:OpenJobMenu', p, 'mechanic' ) end end ) Link to comment
KariiiM Posted January 26, 2016 Share Posted January 26, 2016 I have no idea about your group system export or elementData to check with. Link to comment
Best-Killer Posted January 26, 2016 Author Share Posted January 26, 2016 server side : ---------------------------------------- -- Developer Note: -- THIS RESOURCE CANNOT BE RESTARTED -- WHILE THE SERVER IS RUNNING, IT CAN -- MAKE MINUTES OF NETWORK TROUBLE -- WHILE QUERYING ALL GROUPS DATA ----------------------------------------- local groups = { } addEventHandler ( "onResourceStart", resourceRoot, function ( ) exports.NGSQL:db_exec ( "CREATE TABLE IF NOT EXISTS groups ( id INT, name VARCHAR(20), info TEXT )" ); exports.NGSQL:db_exec ( "CREATE TABLE IF NOT EXISTS group_members ( id INT, member_name VARCHAR(30), rank VARCHAR(20), join_date VARCHAR(40) )"); exports.NGSQL:db_exec ( "CREATE TABLE IF NOT EXISTS group_rank ( id INT, rank VARCHAR(30), perms TEXT )" ) exports.NGSQL:db_exec ( "CREATE TABLE IF NOT EXISTS group_logs ( id INT, time VARCHAR(40), account VARCHAR(40), log TEXT )" ) exports.scoreboard:scoreboardAddColumn ( "Group", getRootElement ( ), 90, "Group", 10 ) exports.scoreboard:scoreboardAddColumn ( "Group Rank", getRootElement ( ), 90, "Group Rank", 12 ) for i, v in pairs ( getElementsByType ( "player" ) ) do local g = getElementData ( v, "Group" ) if ( not g ) then setElementData ( v, "Group", "None" ) setElementData ( v, "Group Rank", "None") end if ( not getElementData ( v, "Group Rank" ) ) then setElementData ( v, "Group Rank", "None" ) end if ( not getElementData ( v, "AccountData:Username" ) ) and (not isGuestAccount(getPlayerAccount(v))) then setElementData ( v, "AccountData:Username" , tostring(getAccountName(getPlayerAccount(v))) ) end end end ) addEventHandler ( "onPlayerJoin", root, function ( ) setElementData ( source, "Group", "None" ) setElementData ( source, "Group Rank", "None") end ) addEventHandler("onPlayerLogin", root, function() setElementData ( source, "AccountData:Username" , tostring(getAccountName(getPlayerAccount(source))) ) end ) groups = { } --[[ example: groups = { ['ownfexrf__s'] = { info = { founder = "xXMADEXx", -- this CANNOT change founded_time = "2014-06-18:01-35-57", desc = "This is my group", color = { 255, 255, 0 }, type = "Gang", bank = 0, id = 0 }, members = { ["xXMADEXx"] = { rank="Founder", joined="2014-06-18:01-35-57" } }, ranks = { ['Founder'] = { -- member access ['member_kick'] = true, ['member_invite'] = true, ['member_setrank'] = true, ['member_viewlog'] = true -- General group changes ['group_modify_color'] = true,, ['group_modify_motd'] = true, -- banks ['bank_withdraw'] = true, ['bank_deposit'] = true, -- logs ['logs_view'] = true, ['logs_clear'] = true, -- ranks ['ranks_create'] = true, ['ranks_delete'] = true, ['ranks_modify'] = true } }, log = { -- { time, log } { time="2014-06-18 05:05:05", account="xXMADEXx", log="Group Created" } }, pendingInvites = { ['account'] = { inviter = "Inviter Account", time="Time Invite Sent"} } } }]] function saveGroups ( ) exports.NGSQL:db_exec ( "DELETE FROM groups" ) exports.NGSQL:db_exec ( "DELETE FROM group_rank" ) exports.NGSQL:db_exec ( "DELETE FROM group_members") exports.NGSQL:db_exec ( "DELETE FROM group_logs") for i, v in pairs ( groups ) do exports.NGSQL:db_exec ( "INSERT INTO groups ( id, name, info ) VALUES ( ?, ?, ? )", tostring ( v.info.id ), tostring ( i ), toJSON ( v.info ) ) for k, val in pairs ( v.ranks ) do exports.NGSQL:db_exec ( "INSERT INTO group_rank ( id, rank, perms ) VALUES ( ?, ?, ? )", tostring ( v.info.id ), k, toJSON ( val ) ) end for k, val in pairs ( v.members ) do exports.NGSQL:db_exec ( "INSERT INTO group_members ( id, member_name, rank, join_date ) VALUES ( ?, ?, ?, ? )", tostring ( v.info.id ), k, val.rank, val.joined ) end for k, val in ipairs ( v.log ) do exports.NGSQL:db_exec ( "INSERT INTO group_logs ( id, time, account, log ) VALUES ( ?, ?, ?, ? )", tostring ( v.info.id ), val.time, val.account, val.log ) end end end function loadGroups ( ) local start = getTickCount ( ) local groups_ = exports.NGSQL:db_query ( "SELECT * FROM groups" ) for i, v in pairs ( groups_ ) do if ( v and v.name and not groups [ v.name ] ) then groups [ v.name ] = { } groups [ v.name ].info = { } groups [ v.name ].ranks = { } groups [ v.name ].members = { } groups [ v.name ].log = { } -- load info table groups [ v.name ].info = fromJSON ( v.info ) groups [ v.name ].info.id = tonumber ( v.id ) -- load rank table local ranks = exports.NGSQL:db_query ( "SELECT * FROM group_rank WHERE id=?", tostring ( v.id ) ) for i, val in pairs ( ranks ) do if ( not groups [ v.name ].ranks[val.rank] ) then groups [ v.name ].ranks[val.rank] = fromJSON ( val.perms ) end end -- load member table local members = exports.NGSQL:db_query ( "SELECT * FROM group_members WHERE id=?", tostring ( v.id ) ) for i, val in pairs ( members ) do groups [v.name].members[val.member_name] = { } groups [v.name].members[val.member_name].rank = val.rank groups [v.name].members[val.member_name].joined = val.join_date for _, player in pairs ( getElementsByType ( "player" ) ) do local a = getPlayerAccount ( player ) if ( a and not isGuestAccount ( a ) ) then local acc = getAccountName ( a ) if ( val.member_name == acc ) then setElementData ( player, "Group", tostring ( v.name ) ) setElementData ( player, "Group Rank", tostring ( val.rank ) ) end end end end -- load logs table local log = exports.NGSQL:db_query ( "SELECT * FROM group_logs WHERE id=?", tostring ( v.id ) ) for i, val in ipairs ( log ) do table.insert ( groups[v.name].log, { time=val.time, account=val.account, log=val.log } ) end groups [ v.name ].pendingInvites = { } else local reason = "Variable 'v' not set" if ( v and not v.name ) then reason = "Variable 'v.name' not set" elseif ( v and v.name and groups [ v.name ] ) then reason = "Group already exists in table" else reason = "Undetected" end outputDebugString ( "SAEGGroups: Failed to load group ".. tostring ( v.name ).." - ".. tostring ( reason ), 1 ) end end local load = math.ceil ( getTickCount()-start ) local tLen = table.len ( groups ) outputDebugString ( "SAEGGroups: Successfully loaded "..tLen.." groups from the sql database ("..tostring(load).."MS - About "..math.floor(load/tLen).."MS/group)" ) end addEventHandler ( "onResourceStart", resourceRoot, loadGroups ) addEventHandler ( "onResourceStop", resourceRoot, saveGroups ) function getGroups ( ) return groups end addEvent ( "SAEGGroups->Events:onClientRequestGroupList", true ) addEventHandler ( "SAEGGroups->Events:onClientRequestGroupList", root, function ( ) local g = getGroups ( ) triggerClientEvent ( source, "SAEGGroups->onServerSendClientGroupList", source, g ) g = nil end ) ------------------------------ -- Group Creating -- ------------------------------ function createGroup ( name, color, type, owner ) if ( doesGroupExist ( name ) ) then return false end local id = 0 local ids = { } for i, v in pairs ( groups ) do ids [ v.info.id ] = true end while ( ids [ id ] ) do id = id + 1 end groups [ name ] = { info = { founder = owner, -- this CANNOT change founded_time = getThisTime ( ), desc = "", color = color, type = type, bank = 0, id = id }, members = { [owner] = { rank="Founder", joined=getThisTime ( ) } }, ranks = { ['Founder'] = { -- member access ['member_kick'] = true, ['member_invite'] = true, ['member_setrank'] = true, ['member_viewlog'] = true, -- General group changes ['group_modify_color'] = true, ['group_modify_motd'] = true, -- banks ['bank_withdraw'] = true, ['bank_deposit'] = true, Link to comment
ALw7sH Posted January 26, 2016 Share Posted January 26, 2016 elseif ( name == 'Police' ) then create3DText ( 'Police', { x, y, z }, { 0, 100, 255 }, { nil, true } ) local p = createElement ( "GodmodePed" ) setElementData ( p, "Model", 286 ) setElementData ( p, "Position", { x, y, z, rz } ) createBlip ( x, y, z, 61, 2, 255, 255, 255, 255, 0, 450 ) addEventHandler ( 'onMarkerHit', createMarker ( x, y, z - 1, 'cylinder', 2, 0, 0, 0, 0 ), function ( p ) if ( getElementType ( p ) == 'player' and not isPedInVehicle ( p ) and not isPedDead ( p ) ) then if ( getPlayerWantedLevel ( p ) > max_wanted.law ) then return exports['SAEGMessages']:sendClientMessage ( "The max wanted level for this job is "..tostring ( max_wanted.law )..".", p, 255, 0, 0 ) end if ( getElementData(p, "Group") ~= "None" ) then return exports.SAEGMessages:sendClientMessage ("You Can't take this job while you are in the Gang.",p, 255, 7, 7 ) end triggerClientEvent ( p, 'SAEGJobs:OpenJobMenu', p, 'police' ) end end ) Link to comment
Best-Killer Posted January 26, 2016 Author Share Posted January 26, 2016 elseif ( name == 'Police' ) then create3DText ( 'Police', { x, y, z }, { 0, 100, 255 }, { nil, true } ) local p = createElement ( "GodmodePed" ) setElementData ( p, "Model", 286 ) setElementData ( p, "Position", { x, y, z, rz } ) createBlip ( x, y, z, 61, 2, 255, 255, 255, 255, 0, 450 ) addEventHandler ( 'onMarkerHit', createMarker ( x, y, z - 1, 'cylinder', 2, 0, 0, 0, 0 ), function ( p ) if ( getElementType ( p ) == 'player' and not isPedInVehicle ( p ) and not isPedDead ( p ) ) then if ( getPlayerWantedLevel ( p ) > max_wanted.law ) then return exports['SAEGMessages']:sendClientMessage ( "The max wanted level for this job is "..tostring ( max_wanted.law )..".", p, 255, 0, 0 ) end if ( getElementData(p, "Group") ~= "None" ) then return exports.SAEGMessages:sendClientMessage ("You Can't take this job while you are in the Gang.",p, 255, 7, 7 ) end triggerClientEvent ( p, 'SAEGJobs:OpenJobMenu', p, 'police' ) end end ) i want if player in gang can not take police job Link to comment
KariiiM Posted January 26, 2016 Share Posted January 26, 2016 What do you mean by gang? because what he did is correct and should works Link to comment
Best-Killer Posted January 26, 2016 Author Share Posted January 26, 2016 What do you mean by gang? because what he did is correct and should works ye by type of group Gang , Squad ..... ect Link to comment
Best-Killer Posted January 27, 2016 Author Share Posted January 27, 2016 this export for get group type : function getGroupType ( name ) if ( doesGroupExist ( name ) ) then return groups [ name ].info.type; end return false; end pls help guys Link to comment
KariiiM Posted January 27, 2016 Share Posted January 27, 2016 No, you can't do that as I see the types which contains gang,squade..etc aren't finished with scripting, so there's no way to do that untill you finish the code. Link to comment
Best-Killer Posted January 27, 2016 Author Share Posted January 27, 2016 No, you can't do that as I see the types which contains gang,squade..etc aren't finished with scripting, so there's no way to do that untill you finish the code. clientside sx_, sy_ = guiGetScreenSize ( ) sx, sy = sx_ / 1280, sy_ / 720 local group = nil local gList = nil function createGroupGui ( ) exports.saegmessages:sendClientMessage ( "Loading interface, please wait...", 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, "Group system", false) gui.main.info = guiCreateButton(sx*10, sy*26, sx*128, sy*40, "Information", false, gui.main.window) gui.main.list = guiCreateButton(sx*148, sy*26, sx*128, sy*40, "Group list", false, gui.main.window) gui.main.my = guiCreateButton(sx*286, sy*26, sx*128, sy*40, "My group", false, gui.main.window) gui.main.admin = guiCreateButton(sx*500, sy*26, sx*128, sy*40, "Groups Manager", 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 ) > 7 guiWindowSetSizable(gui.main.window, false) -- information gui.info.account = guiCreateLabel(sx*42, sy*136, sx*269, sy*20, "Account name: none", false, gui.main.window) gui.info.group = guiCreateLabel(sx*42, sy*156, sx*269, sy*20, "Group name: none", false, gui.main.window) gui.info.rank = guiCreateLabel(sx*42, sy*176, sx*269, sy*20, "Your group rank: none", false, gui.main.window) gui.info.create_ = guiCreateButton ( sx*42, sy*280, sx*130, sy*40, "Create a group", false, gui.main.window ) gui.info.mInvites = guiCreateButton ( 180, 280, 130, 40, "My Invites", false, gui.main.window ) gui.info.gMotd = guiCreateButton ( 318, 280, 130, 40, "Group MOTD", false, gui.main.window ) -- info -> create gui.info.create.window = guiCreateWindow(sx*383, sy*227, sx*500, sy*283, "Create Group", false) guiWindowSetSizable(gui.info.create.window, false) gui.info.create.l1 = guiCreateLabel(sx*22, sy*40, sx*184, sy*20, "Group Name:", 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, "Group Color:", 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, "Group Type:", 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, "Create", false, gui.info.create.window) gui.info.create.close = guiCreateButton(sx*238, sy*215, sx*87, sy*27, "Close", 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, "Gang") guiComboBoxAddItem(gui.info.create.type, "Squad") guiComboBoxAddItem(gui.info.create.type, "Civilian") -- info -> my invites gui.info.invites.window = guiCreateWindow(345, 146, 640, 378, "My group invites", false) guiWindowSetSizable(gui.info.invites.window, false) gui.info.invites.label = guiCreateLabel(38, 33, 504, 21, "My group invites", false, gui.info.invites.window) gui.info.invites.list = guiCreateGridList(21, 54, 599, 267, false, gui.info.invites.window) guiGridListAddColumn(gui.info.invites.list, "Group", 0.3) guiGridListAddColumn(gui.info.invites.list, "Time", 0.3) guiGridListAddColumn(gui.info.invites.list, "From", 0.3) guiGridListSetSortingEnabled ( gui.info.invites.list, false ) gui.info.invites.accept = guiCreateButton(21, 331, 117, 31, "Accept", false, gui.info.invites.window) gui.info.invites.deny = guiCreateButton(140, 331, 117, 31, "Deny", false, gui.info.invites.window) gui.info.invites.close = guiCreateButton(503, 331, 117, 31, "Close", false, gui.info.invites.window ) -- info -> motd gui.info.motd.window = guiCreateWindow(392, 169, 528, 410, "Group 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, "Close", 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, "Group", 0.32) guiGridListAddColumn(gui.list.list, "Group founder", 0.32) guiGridListAddColumn(gui.list.list, "Group type", 0.15) guiGridListAddColumn(gui.list.list, "Members", 0.1) guiGridListSetSortingEnabled ( gui.list.list, false ) -- my gui.my.info = guiCreateButton(10, 120, 128, 40, "Basic information", false, gui.main.window) gui.my.members = guiCreateButton(147, 122, 128, 40, "Members", false, gui.main.window) gui.my.ranks = guiCreateButton(285, 122, 128, 40, "Ranks", false, gui.main.window) gui.my.bank = guiCreateButton(424, 122, 128, 40, "Bank", false, gui.main.window) gui.my.logs = guiCreateButton(10, 170, 128, 40, "Logs", false, gui.main.window) gui.my.modColor = guiCreateButton(147, 170, 128, 40, "Change Color", false, gui.main.window) gui.my.modMotd = guiCreateButton(285, 170, 128, 40, "Change MOTD", false, gui.main.window) gui.my.leave = guiCreateButton(10, 270, 128, 40, "Leave Group", false, gui.main.window) gui.my.delete = guiCreateButton(147, 270, 128, 40, "Delete Group", false, gui.main.window) -- my -> Basic information gui.my.basic.window = guiCreateWindow(509, 233, 317, 160, "Group Information", false) guiWindowSetSizable(gui.my.basic.window, false) gui.my.basic.group = guiCreateLabel(15, 31, 241, 19, "Group: none", false, gui.my.basic.window) gui.my.basic.founder = guiCreateLabel(15, 51, 241, 19, "Origianl founder: none", false, gui.my.basic.window) gui.my.basic.founded = guiCreateLabel(15, 71, 241, 19, "Founded on: none", false, gui.my.basic.window) gui.my.basic.close = guiCreateButton(15, 100, 91, 32, "Close", false, gui.my.basic.window) -- my -> Logs gui.my.logs_.window = guiCreateWindow(341, 142, 634, 392, "Group Logs", 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, "Time", 0.28) guiGridListAddColumn(gui.my.logs_.list, "Account", 0.2) guiGridListAddColumn(gui.my.logs_.list, "Log", 0.7) guiGridListSetSortingEnabled ( gui.my.logs_.list, false ) gui.my.logs_.close = guiCreateButton(488, 346, 136, 33, "Close", false, gui.my.logs_.window) gui.my.logs_.clear = guiCreateButton(342, 346, 136, 33, "Clear", false, gui.my.logs_.window) -- my -> Bank gui.my.bank_.window = guiCreateWindow(481, 270, 306, 141, "Group Bank", false) guiWindowSetSizable(gui.my.bank_.window, false) gui.my.bank_.balance = guiCreateLabel(14, 26, 372, 24, "Group Bank: $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, "Deposit", false, gui.my.bank_.window) guiRadioButtonSetSelected(gui.my.bank_.dep, true) gui.my.bank_.go = guiCreateButton(16, 88, 120, 28, "Go", false, gui.my.bank_.window) gui.my.bank_.close = guiCreateButton(140, 88, 120, 28, "Close", false, gui.my.bank_.window) gui.my.bank_.with = guiCreateRadioButton(144, 63, 75, 23, "Withdraw", false, gui.my.bank_.window) -- my -> Ranks gui.my.ranks_.window = guiCreateWindow(551, 195, 378, 387, "Group Rank Manager", false) guiWindowSetSizable(gui.my.ranks_.window, false) gui.my.ranks_.lbl_1 = guiCreateLabel(21, 30, 220, 22, "Rank Name:", 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, "Members", 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, "Invite Members", false, false, gui.my.ranks_.scroll) gui.my.ranks_['perm_member_kick'] = guiCreateCheckBox(17, 43, 273, 15, "Kick Players", false, false, gui.my.ranks_.scroll) gui.my.ranks_['perm_member_setrank'] = guiCreateCheckBox(17, 58, 273, 15, "Set Members Ranks", false, false, gui.my.ranks_.scroll) gui.my.ranks_['perm_member_viewlog'] = guiCreateCheckBox(17, 73, 273, 15, "View Player Group Logs", false, false, gui.my.ranks_.scroll) gui.my.ranks_.lbl_3 = guiCreateLabel(10, 88, 248, 17, "Group Bank", 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, "Withdraw from bank", false, false, gui.my.ranks_.scroll ) gui.my.ranks_['perm_bank_deposit'] = guiCreateCheckBox(17, 120, 273, 15, "Deposit to bank", true, false, gui.my.ranks_.scroll) gui.my.ranks_.lbl_4 = guiCreateLabel(10, 135, 248, 17, "Group Logs", 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, "View group logs", true, false, gui.my.ranks_.scroll) gui.my.ranks_['perm_logs_clear'] = guiCreateCheckBox(17, 167, 273, 15, "Clear group logs", false, false, gui.my.ranks_.scroll) gui.my.ranks_.lbl_5 = guiCreateLabel(10, 182, 248, 17, "Group Ranks", 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, "Create Ranks", false, false, gui.my.ranks_.scroll) gui.my.ranks_['perm_ranks_delete'] = guiCreateCheckBox(17, 214, 273, 15, "Delete Ranks", false, false, gui.my.ranks_.scroll) gui.my.ranks_.lbl_6 = guiCreateLabel(10, 229, 248, 17, "Group Settings", 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, "Modify Group MOTD", false, false, gui.my.ranks_.scroll) gui.my.ranks_['perm_group_modify_motd'] = guiCreateCheckBox(20, 261, 273, 15, "Modify Group Color", false, false, gui.my.ranks_.scroll) gui.my.ranks_.add = guiCreateButton(241, 341, 99, 28, "Add Rank", false, gui.my.ranks_.window) gui.my.ranks_.close = guiCreateButton(132, 341, 99, 28, "Cancel", false, gui.my.ranks_.window) -- my -> Members gui.my.members_.window = guiCreateWindow(345, 146, 640, 378, "My group members", false) guiWindowSetSizable(gui.my.members_.window, false) gui.my.members_.label = guiCreateLabel(38, 33, 504, 21, "My group members", false, gui.my.members_.window) gui.my.members_.list = guiCreateGridList(21, 54, 599, 267, false, gui.my.members_.window) guiGridListAddColumn(gui.my.members_.list, "Username", 0.3) guiGridListAddColumn(gui.my.members_.list, "Rank", 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, "This Players Log", false, gui.my.members_.window) gui.my.members_.srank = guiCreateButton(140, 331, 117, 31, "Set Rank", false, gui.my.members_.window) gui.my.members_.kick = guiCreateButton(259, 331, 117, 31, "Kick", false, gui.my.members_.window) gui.my.members_.invite = guiCreateButton(378, 331, 117, 31, "Invite", false, gui.my.members_.window) gui.my.members_.close = guiCreateButton(503, 331, 117, 31, "Close", false, gui.my.members_.window ) --> my -> Members -> Player Log gui.my.members_.lWindow = guiCreateWindow(341, 142, 634, 392, "Player Log", 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, "Time", 0.28) guiGridListAddColumn(gui.my.members_.lList, "Account", 0.2) guiGridListAddColumn(gui.my.members_.lList, "Log", 0.7) guiGridListSetSortingEnabled ( gui.my.members_.lList, false ) gui.my.members_.lClose = guiCreateButton(488, 346, 136, 33, "Close", 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, "Update", false, gui.my.members_.rWindow) gui.my.members_.rClose = guiCreateButton(137, 35, 113, 25, "Cancel", false, gui.my.members_.rWindow) -- my -> Members -> Invite gui.my.members_.iWindow = guiCreateWindow(339, 162, 611, 296, "Invite Players", 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, "Player", 0.9) gui.my.members_.iLabel = guiCreateLabel(16, 254, 102, 27, "Search Player:", 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, "Close", false, gui.my.members_.iWindow) gui.my.members_.iInvite = guiCreateButton(451, 256, 70, 25, "Invite", 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, "Update", false, gui.my.motd.window) gui.my.motd.cancel = guiCreateButton(220, 370, 144, 30, "Cancel", false, gui.my.motd.window) -- Administration Panel (NG 1.1.4) gui.admin.window = guiCreateWindow(386, 123, 608, 421, "SAEG Group Manager (Staff)", 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, "Delete Group", 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
Sir.BEEF Posted February 2, 2016 Share Posted February 2, 2016 karim please answer we need to fix it. 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