Jump to content

Best-Killer

Members
  • Posts

    494
  • Joined

  • Last visited

Everything posted by Best-Killer

  1. it's when player arrest cop he need go to LS marker for the player warpet to jail and when release he's Released Only in LS too i want it : when cop arrest player the marker showed in the pos LS ,LV,SF ...ect and if the cop go to marker of LV then if player arrested in LV he released in LV if arrested in SF then Released In SF i hope u understand me (the pos what i did)
  2. And you're not from the community, these files haven't been released by them so this'll be another leaked resource. We're not supporting leaked files and therefore you won't receive any help either. Learn Lua yourself, hire a scripter or what ever. Stop using leaked files. lol it's not Laeked -.- hhhh Guys pls help me pls
  3. Thanks all
  4. Hello Guys , I Have Nerd Gaming GameMode and i want change jail pos ...ect now it's when player arrest cop he need go to LS marker for the player warpet to jail and when release he's Released Only in LS too i want it : when cop arrest player the marker showed in the pos LS ,LV,SF ...ect and if the cop go to marker of LV then the criminal released in LV (the pos what i did) Really i need help on that guys i Never have idea to change it pls give me idea to change or do that for me and thanks so much please guys local WARP_LOCS = { DEFAULT = { }, ADMIN = { }, RELEASE = { } } addEventHandler ( "onResourceStart", resourceRoot, function ( ) local warp_default = get ( "*JAIL_WARP_LOCATION" ); local warp_admin = get ( "*JAIL_WARP_ADMIN_LOCATION" ); local warp_release = get ( "*JAIL_WARP_RELEASE_LOCATION" ); if ( not warp_default ) then outputDebugString ( "Couldn't find '*JAIL_WARP_LOCATION' setting in SAEGPolice" ); WARP_LOCS.DEFAULT = { 0, 0, 0 } else local warp_default = split ( warp_default, "," ); if ( #warp_default ~= 3 ) then outputDebugString ( "'*JAIL_WARP_LOCATION' setting value should be x,y,z (no spaces, please confirm format is correct)" ); WARP_LOCS.DEFAULT = { 0, 0, 0 } elseif ( not tonumber ( warp_default[1] ) or not tonumber ( warp_default[2] ) or not tonumber ( warp_default[3] ) ) then outputDebugString ( "Failed to convert all '*JAIL_WARP_LOCATION' coordinates to floats. Please confirm they are numbers" ); WARP_LOCS.DEFAULT = { 0, 0, 0 } else WARP_LOCS.DEFAULT = { tonumber(warp_default[1]), tonumber(warp_default[2]), tonumber(warp_default[3]) }; end end if ( not warp_release ) then outputDebugString ( "Couldn't find '*JAIL_WARP_RELEASE_LOCATION' setting in SAEGPolice" ); WARP_LOCS.RELEASE = { 0, 0, 0 } else local warp_release = split ( warp_release, "," ); if ( #warp_release ~= 3 ) then outputDebugString ( "'*JAIL_WARP_RELEASE_LOCATION' setting value should be x,y,z (no spaces, please confirm format is correct)" ); WARP_LOCS.RELEASE = { 0, 0, 0 } elseif ( not tonumber ( warp_release[1] ) or not tonumber ( warp_release[2] ) or not tonumber ( warp_release[3] ) ) then outputDebugString ( "Failed to convert all '*JAIL_WARP_RELEASE_LOCATION' coordinates to floats. Please confirm they are numbers" ); WARP_LOCS.RELEASE = { 0, 0, 0 } else WARP_LOCS.RELEASE = { tonumber(warp_release[1]), tonumber(warp_release[2]), tonumber(warp_release[3]) }; end end if ( not warp_admin ) then outputDebugString ( "Couldn't find '*JAIL_WARP_ADMIN_LOCATION' setting in SAEGPolice" ); WARP_LOCS.ADMIN = { 0, 0, 0 } else local warp_admin = split ( warp_admin, "," ); if ( #warp_admin ~= 3 ) then outputDebugString ( "'*JAIL_WARP_ADMIN_LOCATION' setting value should be x,y,z (no spaces, please confirm format is correct)" ); WARP_LOCS.ADMIN = { 0, 0, 0 } elseif ( not tonumber ( warp_admin[1] ) or not tonumber ( warp_admin[2] ) or not tonumber ( warp_admin[3] ) ) then outputDebugString ( "Failed to convert all '*JAIL_WARP_ADMIN_LOCATION' coordinates to floats. Please confirm they are numbers" ); WARP_LOCS.ADMIN = { 0, 0, 0 } else WARP_LOCS.ADMIN = { tonumber(warp_admin[1]), tonumber(warp_admin[2]), tonumber(warp_admin[3]) }; end end outputDebugString ( "Default jail warp location: "..tostring ( table.concat( WARP_LOCS.DEFAULT, ", " ) ) ) outputDebugString ( "Admin jail warp location: "..tostring ( table.concat( WARP_LOCS.ADMIN, ", " ) ) ) outputDebugString ( "Release jail warp location: "..tostring ( table.concat( WARP_LOCS.RELEASE, ", " ) ) ) end ); local jailedPlayers = { } function isPlayerJailed ( p ) if ( p and getElementType ( p ) == 'player' ) then if ( jailedPlayers[p] ) then return tonumber ( getElementData ( p, 'SAEGPolice:JailTime' ) ) else return false end end return nil end function jailPlayer ( p, dur, announce, element, reason ) if( p and dur ) then local announce = announce or false jailedPlayers[p] = dur setElementInterior ( p, 0 ) setElementDimension ( p, 1 ) local __x, __y, __z = unpack ( WARP_LOCS.DEFAULT ) if ( element and reason ) then __x, __y, __z = unpack ( WARP_LOCS.ADMIN ) end setElementPosition ( p, __x, __y, __z ); --outputChatBox ( table.concat ( { __x, __y, __z }, ", " ) ); setElementData ( p,'SAEGPolice:JailTime', tonumber ( dur ) ) setElementData ( p, "isGodmodeEnabled", true ) exports['SAEGJobs']:updateJobColumn ( getAccountName ( getPlayerAccount ( p ) ), 'TimesArrested', "AddOne" ) if ( announce ) then local reason = reason or "Classified" local msg = "" if ( element and reason ) then msg = getPlayerName ( p ).." has been jailed by "..getPlayerName ( element ).." for "..tostring ( dur ).." seconds ("..reason..")" elseif ( element ) then msg = getPlayerName ( p ).." has been jailed by "..getPlayerName ( element ).." for "..tostring ( dur ).." seconds" end exports['SAEGMessages']:sendClientMessage ( msg, root, 0, 120, 255 ) exports['SAEGLogs']:outputPunishLog ( p, element or "Console", tostring ( msg ) ) end triggerEvent ( "onPlayerArrested", p, dur, element, reason ) triggerClientEvent ( p, "onPlayerArrested", p, dur, element, reason ) return true end return false end function unjailPlayer ( p, triggerClient ) local p = p or source setElementDimension ( p, 0 ) setElementInterior ( p, 0 ) setElementPosition ( p, 1543.32, -1675.6, 13.56 ) exports['SAEGMessages']:sendClientMessage ( "You've been released from jail! Behave next time.", p, 0, 255, 0 ) jailedPlayers[p] = nil setElementData ( p, "SAEGPolice:JailTime", nil ) setElementData ( p, "isGodmodeEnabled", nil ) exports['SAEGLogs']:outputActionLog ( getPlayerName ( p ).." has been unjailed" ) if ( triggerClient ) then triggerClientEvent ( p, 'SAEGJail:StopJailClientTimer', p ) end end addEvent ( "SAEGJail:UnjailPlayer", true ) addEventHandler ( "SAEGJail:UnjailPlayer", root, unjailPlayer ) function getJailedPlayers ( ) return jailedPlayers end addCommandHandler ( "jail", function ( p, _, p2, time, ... ) if ( exports['SAEGAdministration']:isPlayerStaff ( p ) ) then if ( p2 and time ) then local toJ = getPlayerFromName ( p2 ) or exports['SAEGPlayerFunctions']:getPlayerFromNamePart ( p2 ) if toJ then jailPlayer ( toJ, time, true, p, table.concat ( { ... }, " " ) ) else exports['SAEGMessages']:sendClientMessage ( "No player found with \""..p2.."\" in their name.", p, 255, 0, 0 ) end else exports['SAEGMessages']:sendClientMessage ( "Syntax: /jail [player name/part of name] [seconds] [reason]", p, 255, 255, 0 ) end end end ) addCommandHandler ( "unjail", function ( p, _, p2 ) if ( not exports['SAEGAdministration']:isPlayerStaff ( p ) ) then return false end if ( not p2 ) then return exports['SAEGMessages']:sendClientMessage ( "Syntax: /unjail [player]", p, 255, 255, 0 ) end if ( not getPlayerFromName ( p2 ) ) then p2 = exports['SAEGPlayerFunctions']:getPlayerFromNamePart ( p2 ) if not p2 then return exports['SAEGMessages']:sendClientMessage ( "That player doesn't exist on the server.", p, 255, 0, 0 ) end end if ( jailedPlayers[p2] ) then exports['SAEGMessages']:sendClientMessage ( "You've unjailed "..getPlayerName ( p2 ).."!", p, 0, 255, 0 ) exports['SAEGMessages']:sendClientMessage ( "You've been unjailed by "..getPlayerName ( p ).."!", p2, 0, 255, 0 ) unjailPlayer ( p2, true ) else exports['SAEGMessages']:sendClientMessage ( "That player isn't jailed.", p, 255, 0, 0 ) end end ) addEventHandler ( "onResourceStop", resourceRoot, function ( ) exports['NGSQL']:saveAllData ( false ) end ) addEventHandler ( "onResourceStart", resourceRoot, function ( ) setTimer ( function ( ) local q = exports['NGSQL']:db_query ( "SELECT * FROM accountdata" ) local data = { } for i, v in ipairs ( q ) do data[v['Username']] = v['JailTime'] end for i, v in pairs ( data ) do local p = exports['SAEGPlayerFunctions']:getPlayerFromAcocunt ( i ) if p then local t = tonumber ( getElementData ( p, 'SAEGPolice:JailTime' ) ) or i jailPlayer ( p, tonumber ( t ), false ) end end end, 500, 1 ) end ) addEvent ( "onPlayerArrested", true ) local remainingTime = nil local sx, sy = guiGetScreenSize ( ) addEvent ( "onPlayerArrested", true ) addEventHandler ( "onPlayerArrested", root, function ( dur ) if dur then remainingTime = dur l_tick = getTickCount ( ) addEventHandler ( 'onClientRender', root, dxDrawRemainingJailTime ) end end ) function dxDrawRemainingJailTime ( ) dxDrawText ( tostring ( remainingTime ).. " seconds", 0, 0, (sx/1.1)+2, (sy/1.1)+2, tocolor ( 0, 0, 0, 255 ), 2.5, 'default-bold', 'right', 'bottom' ) dxDrawText ( tostring ( remainingTime ).. " seconds", 0, 0, sx/1.1, sy/1.1, tocolor ( 255, 255, 0, 255 ), 2.5, 'default-bold', 'right', 'bottom' ) if ( getTickCount ( ) - l_tick >= 1000 ) then remainingTime = remainingTime - 1 l_tick = getTickCount ( ) setElementData ( localPlayer, "SAEGPolice:JailTime", remainingTime ) if ( remainingTime < 0 ) then triggerServerEvent ( "SAEGJail:UnjailPlayer", localPlayer, false ) remainingTime = nil l_tick = nil removeEventHandler ( "onClientRender", root, dxDrawRemainingJailTime ) end end end addEvent ( "SAEGJail:StopJailClientTimer", true ) addEventHandler ( "SAEGJail:StopJailClientTimer", root, function ( ) remainingTime = nil l_tick = nil removeEventHandler ( "onClientRender", root, dxDrawRemainingJailTime ) end ) ------------------------------- -- Export functions -- Implemented in NG V1.1.3 ------------------------------- function isPlayerJailed ( ) return ( getElementData ( localPlayer, 'SAEGPolice:JailTime' ) and tonumber ( getElementData ( localPlayer, 'SAEGPolice:JailTime' ) ) ) and tonumber ( getElementData ( localPlayer, 'SAEGPolice:JailTime' ) ) > 0 end "SAEG Scripting Team" type="script" name="SAEG Police" version="1.0" />
  5. example : setWeaponProperty("silenced", "poor", "damage", 0)
  6. and what about : how know players in LS ??
  7. He is just asking. ah ok Bonsai Sry bro
  8. no no u didn't understand me example : it's gui when player Kill some in LS they gui showed to the killed player the he chose Jail Him or Forgive him i hope u understand me now
  9. Best-Killer

    Question

    Hello Guys, How i can make anti DM ?? what functions/events needed ?
  10. lol how u can know my code is solten ?? -.- Thanks u karim
  11. function hack () if antispam == true then setElementFrozen(localPlayer,true) setPedAnimation(localPlayer,"ROB_BANK","CAT_Safe_Open") setTimer(setPedAnimation,3000,1,localPlayer,false) setTimer(setElementFrozen,3000,1,localPlayer,false) showCursor(false) triggerServerEvent ( "give", localPlayer ) antispam = false time = setTimer(function() antispam = true end,30000,1) else if antispam == false then getTime= getTimerDetails(time) exports.SAEGMessages:sendClientMessage("You must to wait "..math.floor(getTime/1000).."scounds to hack again",source,255,0,0) end end end it's showing : you must to wait 30 scounds to hack again i want it : you mus to wait 180 secounds to hack again
  12. argument 2 got nill local rowA = guiGridListAddRow(vehicle_selector_grid) local vehicleName = guiGridListGetItemText(vehicle_selector_grid, rowA,2)
  13. Best-Killer

    Question

    there is a way for guiGridListGetItemText without using guiGridListGetSelectedItem ?
  14. not work
  15. so what i need do now ?
  16. local client = getLocalPlayer() local rootElement = getRootElement() local theMarker = nil local r, b, g = getMarkerColor vehicle.window = guiCreateWindow(550,560,200,200, "Vehicle System", false) guiWindowSetSizable(vehicle_selector_window, false) guiSetVisible(vehicle.window,false) function openGui(vehiclesTable,marker) guiSetVisible(vehicle_selector_window,true) function spawnv(button, press) if(press) then if(button == "1") then local vehicleName = guiGridListGetItemText(vehicle_selector_grid, row,name) triggerServerEvent("vehicle_spawn",client,client,getVehicleModelFromName(vehicleName),theMarker) end if(button == "2") then triggerServerEvent("vehicle_spawn",client,client,getVehicleModelFromName(vehicleName),theMarker) end if(button == "3") then triggerServerEvent("vehicle_spawn",client,client,getVehicleModelFromName(vehicleName),theMarker) end if(button == "4") then x, y, z = getElementPosition(localPlayer) triggerServerEvent("vehicle_spawn",client,client,getVehicleModelFromName(vehicleName),theMarker) end if(button == "5") then triggerServerEvent("vehicle_spawn",client,client,getVehicleModelFromName(vehicleName),theMarker) end if(button == "6") then x, y, z = getElementPosition(localPlayer) triggerServerEvent("vehicle_spawn",client,client,getVehicleModelFromName(vehicleName),theMarker) end end if(button == "7") then triggerServerEvent("vehicle_spawn",client,client,getVehicleModelFromName(vehicleName),theMarker) end end addEventHandler("onClientKey", getRootElement(), spawnv) vehicle.grid = guiCreateGridList(0,20,190,170, false, vehicle.window) local key = guiGridListAddColumn(vehicle.grid, "Key", 0.20) local name = guiGridListAddColumn(vehicle.grid, "Name", 0.65) showCursor(false) theMarker = marker guiGridListClear(vehicle_selector_grid) for i,v in pairs(vehiclesTable) do local row = guiGridListAddRow(vehicle_selector_grid) guiGridListSetItemText(vehicle.grid, row, key, tostring(row+1), false, false) guiGridListSetItemText(vehicle.grid, row, name, getVehicleNameFromModel(v), false, false) end end addEvent("markerHittted", true) addEventHandler("markerHittted", getRootElement(), openGui) function hideGui() guiSetVisible(vehicle_selector_window,false) removeEventHandler("onClientKey", getRootElement(), spawnv) end addEvent("markerLeavved", true) addEventHandler("markerLeavved", getRootElement(), hideGui) 14 bad argument guigridlistgetItemtext expected number at argument 2 got nill 15 bad argument getvehiclemodelfromname exptected string at argument 1 , got boolean
  17. can not delete rank from group
  18. Best-Killer

    Job

    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 =
  19. no one can help u without posting the error
  20. Best-Killer

    Job

    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
  21. Best-Killer

    Job

    ye by type of group Gang , Squad ..... ect
  22. Best-Killer

    Job

    i want if player in gang can not take police job
  23. Best-Killer

    Job

    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,
  24. Best-Killer

    Job

    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 )
  25. errors ? use /debugscript 3
×
×
  • Create New...