Best-Killer1
Members-
Posts
203 -
Joined
-
Last visited
Everything posted by Best-Killer1
-
hhh lol You look like you won't learn, you always need someone to edit for you codes? what is problem here pls ?? local _setElementData = setElementData function setElementData ( element, group, value ) return _setElementData ( element, group, value, true ) end local turfLocs = { } function createTurf ( x, y, z, width, height, owner, forcedId ) local owner = tostring ( owner or "server" ) local r, g, b = exports.SAEGGroups:getGroupColor ( owner ) if not r then r = 255 end if not g then g = 255 end if not b then b = 255 end if ( owner == "server" ) then r, g, b = 255, 255, 255 end local rad = createRadarArea ( x, y, width, height, r, g, b, 170, getRootElement ( ) ) local col = createColCuboid ( x, y, z-5, width, height, 35) if ( not forcedId or turfLocs [ id ] ) then id = 0 while ( turfLocs [ id ] ) do id = id + 1 end else id = forcedId end turfLocs[id] = { } turfLocs[id].col = col turfLocs[id].radar = rad turfLocs[id].owner = owner or "server" turfLocs[id].attackers = nil turfLocs[id].attackProg = 0 turfLocs[id].prepProg = 0 setElementData ( turfLocs[id].col, "SAEGTurf:TurfId", id ) setElementData ( turfLocs[id].col, "SAEGTurf:TurffingTable", turfLocs [ id ] ) addEventHandler ( "onColShapeHit", turfLocs[id].col, onColShapeHit ) addEventHandler ( "onColShapeLeave", turfLocs[id].col, onColShapeLeave ) return turfLocs[id]; end function updateTurfGroupColor ( group ) local r, g, b = exports.saeggroups:getGroupColor ( group ) for i, v in pairs ( turfLocs ) do if ( v.owner == group ) then setRadarAreaColor ( v.radar, r, g, b, 120 ) end end end function onColShapeHit ( player ) if ( player and isElement ( player ) and getElementType ( player ) == "player" and not isPedInVehicle ( player ) ) then local gang = exports.saeggroups:getPlayerGroup ( player ) if getTeamName(getPlayerTeam(player)) ~= "Criminals" then exports['SAEGMessages']:sendClientMessage("You must be criminal.",255,0,0) return end triggerClientEvent ( player, "SAEGTurfs:onClientEnterTurfArea", player, turfLocs [ id ] ) if ( not gang ) then return exports.SAEGMessages:sendClientMessage ( "You're not in a gang, you cannot turf.", player, 255, 255, 0 ) end local id = tonumber ( getElementData ( source, "SAEGTurf:TurfId" ) ) if ( turfLocs[id].owner == gang ) then return end if ( turfLocs[id].attackers and turfLocs[id].attackers ~= gang ) then end if ( not turfLocs[id].attackers ) then local x, y, z = getElementPosition ( source ) setRadarAreaFlashing ( turfLocs[id].radar, true ) turfLocs[id].attackers = gang turfLocs[id].attackProg = 0 turfLocs[id].prepProg = 0 setElementData ( turfLocs[id].col, "SAEGTurf:TurffingTable", turfLocs [ id ] ) end end end function onColShapeLeave ( player ) if ( player and getElementType ( player ) == "player" ) then triggerClientEvent ( player, "SAEGTurfs:onClientExitTurfArea", player, turfLocs [ getElementData ( source, "SAEGTurf:TurfId" ) ] ) end end setTimer ( function ( ) for id, data in pairs ( turfLocs ) do if ( data.attackers ) then local players = { attackers = { }, owners = { } } local isGangInTurf = false local isOwnerInTurf = false for i, v in pairs ( getElementsWithinColShape ( data.col, "player" ) ) do local g = exports.SAEGGroups:getPlayerGroup ( v ) if ( g == data.attackers ) then isGangInTurf = true table.insert ( players.attackers, v ) elseif ( g == data.owner ) then isOwnerInTurf = true table.insert ( players.owners, v ) end end local x, y, z = getElementPosition ( data.col ) if ( isOwnerInTurf and isGangInTurf ) then else -- Add Points To Attackers if ( isGangInTurf ) then -- Prep the war if ( turfLocs[id].attackProg == 0 ) then turfLocs[id].prepProg = data.prepProg + 2 if ( turfLocs[id].prepProg >= 100 ) then turfLocs[id].prepProg = 0 turfLocs[id].attackProg = 1 beginTurfWarOnTurf ( id ) end -- Attack War else turfLocs[id].attackProg = turfLocs[id].attackProg + 1 if ( turfLocs[id].attackProg == 100 ) then setTurfOwner ( id, turfLocs[id].attackers ) end end -- Take points from attackers else -- Prepare war if ( turfLocs[id].attackProg == 0 ) then turfLocs[id].prepProg = data.prepProg - 2 if ( turfLocs[id].prepProg <= 0 ) then setTurfOwner ( id, turfLocs[id].owner ) end -- Attacking war else turfLocs[id].attackProg = data.attackProg - 1 if ( turfLocs[id].attackProg <= 0 ) then setTurfOwner ( id, turfLocs[id].owner ) end end end end for i, v in pairs ( players ) do for k, p in pairs ( v ) do triggerClientEvent ( p, "SAEGTurfs:upadateClientInfo", p, turfLocs [ id ] ) end end end end end, 800, 0 ) addEvent ( "SAEGTurfs:onTurfProgressChange", true ) --[[ addCommandHandler ( "attackprog", function ( p ) local gangAttacks = { } local g = exports.SAEGGroups:getPlayerGroup ( p ) if ( not g ) then return exports.SAEGMessages:sendclientMessage ( "You're not in a gang", p, 255, 255, 0) end for i, v in pairs ( turfLocs ) do if ( v.attackers and v.attackers == g ) then gangAttacks [ i ] = true end end if ( table.len ( gangAttacks ) == 0 ) then return exports.SAEGMessages:sendClientMessage ( "Your gang isn't involved in any gang wars right now.", p, 255, 255, 0 ) end for id, _ in pairs ( gangAttacks ) do local x ,y, z = getElementPosition ( turfLocs[id].col ) outputChatBox ( "----Turf War Status---", p, 255, 255, 255, false ) outputChatBox ( "Current owner: "..turfLocs[id].owner, p, 255, 255, 255, false ) outputChatBox ( "Attacker: "..turfLocs[id].attackers, p, 255, 255, 255, false ) outputChatBox ( "Prep Progress: "..turfLocs[id].prepProg.."%", p, 255, 255, 255, false ) outputChatBox ( "Attack Progress: "..turfLocs[id].attackProg.."%", p, 255, 255, 255, false ) outputChatBox ( "Turf Location: "..getZoneName ( x, y, z )..", "..getZoneName ( x, y, z, true ), p, 255, 255, 255, false ) outputChatBox ( "Turf Server-ID: "..id, p, 255, 255, 255, false ) end end )]] function table.len ( tb ) local c = 0 for i, v in pairs ( tb ) do c = c + 1 end return c end function beginTurfWarOnTurf ( id ) local d = turfLocs [ id ] local x, y, z = getElementPosition ( d.col ) setRadarAreaColor ( d.radar, 255, 255, 255, 170 ) end function setTurfOwner ( id, owner ) setRadarAreaFlashing ( turfLocs[id].radar, false ) turfLocs[id].owner = owner turfLocs[id].attackers = nil turfLocs[id].attackProg = 0 local r, g, b = exports.SAEGGroups:getGroupColor ( owner ) setRadarAreaColor ( turfLocs[id].radar, r, g, b, 120 ) saveTurfs ( ) end function getTurfs ( ) return turfLocs end function saveTurfs ( ) for id, data in pairs ( turfLocs ) do exports.NGSQL:db_exec ( "UPDATE turfs SET owner=? WHERE id=?", data.owner, id ) end return true end addEventHandler( "onResourceStart", resourceRoot, function ( ) exports.NGSQL:db_exec ( "CREATE TABLE IF NOT EXISTS turfs ( id INT, owner VARCHAR(50), x FLOAT, y FLOAT, z FLOAT, width INT, height INT )" ) local query = exports.NGSQL:db_query ( "SELECT * FROM turfs" ) if ( #query == 0 ) then local data = { { -1867.8, -107.43, 15.1, 58, 65 }, { -1866.5, -26.36, 15.29, 49, 200 }, { -1811.33, 743.43, 20, 85, 85 }, { -1991.5, 862.62, 34, 79, 42 }, { -2799.25, -200.6, 7.19, 83, 120 }, { -2136.84, 120.12, 30, 120, 190 }, { -2516.52, 718.16, 27.97, 118, 80 }, { -2516.41, 578.19, 16.62, 100, 100 }, { -2596.49, 818.05, 49.98, 59, 80 }, { -2453.17, 947.58, 45.43, 54, 80 }, { -2740.6, 344.59, 4.41, 68, 61 }, { -2696.24, 227.35, 4.33, 39.5, 50.5 }, { -2397.31, 82.99, 35.3, 133, 160 }, { -2095.33, -280.06, 35.32, 84, 176 }, { -1980.58, 107.69, 27.68, 59, 62 }, { -2129.01, 741.71, 48, 112, 57 }, { -2243.24, 928.4, 66.65, 87, 154 }, { -1701.62, 743.44, 10, 129, 83 }, { -2696.23, -59.88, 4.73, 83, 89 }, { -2541.18, -720.16, 135, 55, 125 }, }
-
hhh lol
-
Turf codes : Client local isRender = false local renderData = nil local removeIfNotText = 0 addEvent ( "SAEGTurfs:onClientEnterTurfArea", true ) addEventHandler ( "SAEGTurfs:onClientEnterTurfArea", root, function ( info ) renderData = info if ( not render ) then addEventHandler ( "onClientRender", root, onClientRender ) render = true end end ) addEvent ( "SAEGTurfs:onClientExitTurfArea", true ) addEventHandler ( "SAEGTurfs:onClientExitTurfArea", root, function ( ) isRender = false renderData = nil end ) addEvent ( "SAEGTurfs:upadateClientInfo", true ) addEventHandler ( "SAEGTurfs:upadateClientInfo", root, function ( data ) renderData = data if ( not render ) then addEventHandler ( "onClientRender", root, onClientRender ) render = true end end ) local _sx, _sy = guiGetScreenSize ( ) local sx, sy = _sx/1280, _sy/720 local attackersProgWidth = 0 local defenderProgWidth = 100 function onClientRender ( ) if ( not render or not renderData ) then render = false renderData = nil return removeEventHandler ( "onClientRender", root, onClientRender ) end local data = renderData if ( not data.attackers ) then if ( removeIfNotText and removeIfNotText > 20 ) then render = false removeIfNotText = 0 return end removeIfNotText = removeIfNotText + 1 return end local mode = "prep" if ( data.prepProg == 0 and data.attackProg > 0 ) then mode = "attack" end if ( mode == "prep" ) then ownerProg = 100 - data.prepProg attackProg = data.prepProg else ownerProg = 100 - data.attackProg attackProg = data.attackProg end local progWidth = 230 dxDrawRectangle ( sx*970, sy*520, sx*280, sy*145, tocolor ( 0, 0, 0, 120 ) ) dxDrawText ( "Turf War Progress", sx*970, sy*520, sx*1250, sy*720, tocolor ( 255, 255, 255, 255 ), (sx/sy)*2, "default-bold", "center" ) dxDrawLine ( sx*980, sy*555, sx*1240, sy*555 ) dxDrawRectangle ( sx*990, sy*570, sx*240, sy*30, tocolor ( 0, 0, 0, 120 ) ) dxDrawRectangle ( sx*995, sy*575, sx*((ownerProg*0.01)*progWidth), sy*20, tocolor ( 0, 255, 0, 255 ) ) dxDrawText ( tostring ( data.owner ).." - "..ownerProg.."%", sx*990, sy*570, sx*1230, sy*600, tocolor ( 255, 255, 255, 255 ), (sx/sy)*1.2, "default-bold", "center", "center" ) dxDrawRectangle ( sx*990, sy*620, sx*240, sy*30, tocolor ( 0, 0, 0, 120 ) ) dxDrawRectangle ( sx*995, sy*625, sx*((attackProg*0.01)*progWidth), sy*20, tocolor ( 255, 0, 0, 255 ) ) dxDrawText ( tostring ( data.attackers ).." - "..attackProg.."%", sx*990, sy*620, sx*1230, sy*650, tocolor ( 255, 255, 255, 255 ), (sx/sy)*1.2, "default-bold", "center", "center" ) end Server-side local _setElementData = setElementData function setElementData ( element, group, value ) return _setElementData ( element, group, value, true ) end local turfLocs = { } function createTurf ( x, y, z, width, height, owner, forcedId ) local owner = tostring ( owner or "server" ) local r, g, b = exports.SAEGGroups:getGroupColor ( owner ) if not r then r = 255 end if not g then g = 255 end if not b then b = 255 end if ( owner == "server" ) then r, g, b = 255, 255, 255 end local rad = createRadarArea ( x, y, width, height, r, g, b, 170, getRootElement ( ) ) local col = createColCuboid ( x, y, z-5, width, height, 35) if ( not forcedId or turfLocs [ id ] ) then id = 0 while ( turfLocs [ id ] ) do id = id + 1 end else id = forcedId end turfLocs[id] = { } turfLocs[id].col = col turfLocs[id].radar = rad turfLocs[id].owner = owner or "server" turfLocs[id].attackers = nil turfLocs[id].attackProg = 0 turfLocs[id].prepProg = 0 setElementData ( turfLocs[id].col, "SAEGTurf:TurfId", id ) setElementData ( turfLocs[id].col, "SAEGTurf:TurffingTable", turfLocs [ id ] ) addEventHandler ( "onColShapeHit", turfLocs[id].col, onColShapeHit ) addEventHandler ( "onColShapeLeave", turfLocs[id].col, onColShapeLeave ) return turfLocs[id]; end function updateTurfGroupColor ( group ) local r, g, b = exports.saeggroups:getGroupColor ( group ) for i, v in pairs ( turfLocs ) do if ( v.owner == group ) then setRadarAreaColor ( v.radar, r, g, b, 120 ) end end end function onColShapeHit ( player ) if ( player and isElement ( player ) and getElementType ( player ) == "player" and not isPedInVehicle ( player ) ) then local gang = exports.saeggroups:getPlayerGroup ( player ) if getTeamName(getPlayerTeam(player)) ~= "Criminals" then exports['SAEGMessages']:sendClientMessage("You must be criminal.",255,0,0) return end triggerClientEvent ( player, "SAEGTurfs:onClientEnterTurfArea", player, turfLocs [ id ] ) if ( not gang ) then return exports.SAEGMessages:sendClientMessage ( "You're not in a gang, you cannot turf.", player, 255, 255, 0 ) end local id = tonumber ( getElementData ( source, "SAEGTurf:TurfId" ) ) if ( turfLocs[id].owner == gang ) then return end if ( turfLocs[id].attackers and turfLocs[id].attackers ~= gang ) then end if ( not turfLocs[id].attackers ) then local x, y, z = getElementPosition ( source ) setRadarAreaFlashing ( turfLocs[id].radar, true ) turfLocs[id].attackers = gang turfLocs[id].attackProg = 0 turfLocs[id].prepProg = 0 setElementData ( turfLocs[id].col, "SAEGTurf:TurffingTable", turfLocs [ id ] ) end end end function onColShapeLeave ( player ) if ( player and getElementType ( player ) == "player" ) then triggerClientEvent ( player, "SAEGTurfs:onClientExitTurfArea", player, turfLocs [ getElementData ( source, "SAEGTurf:TurfId" ) ] ) end end setTimer ( function ( ) for id, data in pairs ( turfLocs ) do if ( data.attackers ) then local players = { attackers = { }, owners = { } } local isGangInTurf = false local isOwnerInTurf = false for i, v in pairs ( getElementsWithinColShape ( data.col, "player" ) ) do local g = exports.SAEGGroups:getPlayerGroup ( v ) if ( g == data.attackers ) then isGangInTurf = true table.insert ( players.attackers, v ) elseif ( g == data.owner ) then isOwnerInTurf = true table.insert ( players.owners, v ) end end local x, y, z = getElementPosition ( data.col ) if ( isOwnerInTurf and isGangInTurf ) then else -- Add Points To Attackers if ( isGangInTurf ) then -- Prep the war if ( turfLocs[id].attackProg == 0 ) then turfLocs[id].prepProg = data.prepProg + 2 if ( turfLocs[id].prepProg >= 100 ) then turfLocs[id].prepProg = 0 turfLocs[id].attackProg = 1 beginTurfWarOnTurf ( id ) end -- Attack War else turfLocs[id].attackProg = turfLocs[id].attackProg + 1 if ( turfLocs[id].attackProg == 100 ) then setTurfOwner ( id, turfLocs[id].attackers ) end end -- Take points from attackers else -- Prepare war if ( turfLocs[id].attackProg == 0 ) then turfLocs[id].prepProg = data.prepProg - 2 if ( turfLocs[id].prepProg <= 0 ) then setTurfOwner ( id, turfLocs[id].owner ) end -- Attacking war else turfLocs[id].attackProg = data.attackProg - 1 if ( turfLocs[id].attackProg <= 0 ) then setTurfOwner ( id, turfLocs[id].owner ) end end end end for i, v in pairs ( players ) do for k, p in pairs ( v ) do triggerClientEvent ( p, "SAEGTurfs:upadateClientInfo", p, turfLocs [ id ] ) end end end end end, 800, 0 ) addEvent ( "SAEGTurfs:onTurfProgressChange", true ) --[[ addCommandHandler ( "attackprog", function ( p ) local gangAttacks = { } local g = exports.SAEGGroups:getPlayerGroup ( p ) if ( not g ) then return exports.SAEGMessages:sendclientMessage ( "You're not in a gang", p, 255, 255, 0) end for i, v in pairs ( turfLocs ) do if ( v.attackers and v.attackers == g ) then gangAttacks [ i ] = true end end if ( table.len ( gangAttacks ) == 0 ) then return exports.SAEGMessages:sendClientMessage ( "Your gang isn't involved in any gang wars right now.", p, 255, 255, 0 ) end for id, _ in pairs ( gangAttacks ) do local x ,y, z = getElementPosition ( turfLocs[id].col ) outputChatBox ( "----Turf War Status---", p, 255, 255, 255, false ) outputChatBox ( "Current owner: "..turfLocs[id].owner, p, 255, 255, 255, false ) outputChatBox ( "Attacker: "..turfLocs[id].attackers, p, 255, 255, 255, false ) outputChatBox ( "Prep Progress: "..turfLocs[id].prepProg.."%", p, 255, 255, 255, false ) outputChatBox ( "Attack Progress: "..turfLocs[id].attackProg.."%", p, 255, 255, 255, false ) outputChatBox ( "Turf Location: "..getZoneName ( x, y, z )..", "..getZoneName ( x, y, z, true ), p, 255, 255, 255, false ) outputChatBox ( "Turf Server-ID: "..id, p, 255, 255, 255, false ) end end )]] function table.len ( tb ) local c = 0 for i, v in pairs ( tb ) do c = c + 1 end return c end function beginTurfWarOnTurf ( id ) local d = turfLocs [ id ] local x, y, z = getElementPosition ( d.col ) setRadarAreaColor ( d.radar, 255, 255, 255, 170 ) end function setTurfOwner ( id, owner ) setRadarAreaFlashing ( turfLocs[id].radar, false ) turfLocs[id].owner = owner turfLocs[id].attackers = nil turfLocs[id].attackProg = 0 local r, g, b = exports.SAEGGroups:getGroupColor ( owner ) setRadarAreaColor ( turfLocs[id].radar, r, g, b, 120 ) saveTurfs ( ) end function getTurfs ( ) return turfLocs end function saveTurfs ( ) for id, data in pairs ( turfLocs ) do exports.NGSQL:db_exec ( "UPDATE turfs SET owner=? WHERE id=?", data.owner, id ) end return true end addEventHandler( "onResourceStart", resourceRoot, function ( ) exports.NGSQL:db_exec ( "CREATE TABLE IF NOT EXISTS turfs ( id INT, owner VARCHAR(50), x FLOAT, y FLOAT, z FLOAT, width INT, height INT )" ) local query = exports.NGSQL:db_query ( "SELECT * FROM turfs" ) if ( #query == 0 ) then local data = { { -1867.8, -107.43, 15.1, 58, 65 }, { -1866.5, -26.36, 15.29, 49, 200 }, { -1811.33, 743.43, 20, 85, 85 }, { -1991.5, 862.62, 34, 79, 42 }, { -2799.25, -200.6, 7.19, 83, 120 }, { -2136.84, 120.12, 30, 120, 190 }, { -2516.52, 718.16, 27.97, 118, 80 }, { -2516.41, 578.19, 16.62, 100, 100 }, { -2596.49, 818.05, 49.98, 59, 80 }, { -2453.17, 947.58, 45.43, 54, 80 }, { -2740.6, 344.59, 4.41, 68, 61 }, { -2696.24, 227.35, 4.33, 39.5, 50.5 }, { -2397.31, 82.99, 35.3, 133, 160 }, { -2095.33, -280.06, 35.32, 84, 176 }, { -1980.58, 107.69, 27.68, 59, 62 }, { -2129.01, 741.71, 48, 112, 57 }, { -2243.24, 928.4, 66.65, 87, 154 }, { -1701.62, 743.44, 10, 129, 83 }, { -2696.23, -59.88, 4.73, 83, 89 }, { -2541.18, -720.16, 135, 55, 125 }, }
-
Same Problem :P
-
Then why not asking bluntz to help you directly ? I won't help you aswell. he don't know anyway Thanx Guys
-
So ? No help ?
-
It's not your code or even his code ,why you lie?,This code is stolen from SAUR RPG already a code like it got removed by the owner of this code like a month ago or so , i don't think so you guys are allowed to use or edit them since the owner of those codes is still removing them! I can't find the topic similer to this because the code is removed ,but here's a code from saur old version posted by you and removed by the owner of it, you can see it HERE and there are alot. Read this TOPIC to know more about stolen resources. try to learn like that you'll never succes you will always need to get leaked scripts or done scripts to edit them! ~Good luck lol bluntz gave me it i don't stole it
-
You're Welcome EveryTime
-
use /debugscript 3 and tell me what is error
-
Test it and tell me the result (pls fast Cuz i will go to sleep )
-
you did make group name SWAT ??
-
criminals can tass others players also all players can use the taser how i can make it work only for Cops ?? Code : arresties = { } tased = { } addEventHandler ( "onPlayerDamage", root, function ( cop, weapon, _, loss ) -- arrest system if ( isElement ( cop ) and weapon and cop ~= source ) then if ( getElementData ( cop, "SAEGEvents:IsPlayerInEvent" ) or getElementData ( source, "SAEGEvents:IsPlayerInEvent" ) ) then return end if ( cop == source ) then return end if ( getElementType ( cop ) == 'vehicle' ) then cop = getVehicleOccupant ( cop ) end if ( not isElement ( cop ) or getElementType ( cop ) ~= 'player' ) then return end if ( not getPlayerTeam ( cop ) ) then return end if ( exports['SAEGPlayerFunctions']:isTeamLaw ( getTeamName ( getPlayerTeam ( cop ) ) ) ) then if ( getElementData ( source, "isSpawnProtectionEnabled" ) == true ) then return exports['SAEGMessages']:sendClientMessage ( "This player has spawn-protection enabled.", cop, 255, 0, 0 ) end if ( getPlayerTeam ( source ) and getTeamName ( getPlayerTeam ( source ) ) == "Staff" ) then return exports['SAEGMessages']:sendClientMessage ( "You cannot arrest/tase on-duty staff.", cop, 255, 0, 0 ) end if ( arresties[source] ) then return exports['SAEGMessages']:sendClientMessage ( "This player is already arrested.", cop, 255, 0, 0 ) end if ( getPlayerWantedLevel ( source ) >= 1 ) then if ( weapon == 3 ) then -- Arrest arrestPlayer ( source, cop ) exports['SAEGMessages']:sendClientMessage ( "You have arrested "..getPlayerName ( source )..", take him to a police station.", cop, 0, 255, 0 ) exports['SAEGMessages']:sendClientMessage ( getPlayerName ( cop ).." arrested you!", source, 255, 255, 0 ) setElementHealth ( source, getElementHealth ( source ) + loss ) setElementData ( source, "SAEGJobs:ArrestingOfficer", cop ) addEventHandler ( "onPlayerQuit", source, onPlayerAttmemptArrestAvoid ); elseif ( weapon == 23 ) then -- Taze Player if ( tased [ source ] ) then return exports.SAEGMessages:sendClientMessage ( "This player is already tased", cop, 255, 255, 255 ) end local a = cop local t = getPlayerTeam ( a ) if ( not t ) then return end if ( getPlayerWantedLevel ( source ) == 0 ) then return end if ( exports.SAEGPlayerFunctions:isTeamLaw ( getTeamName ( t ) ) and not getElementData ( source, "SAEGJobs:ArrestingOfficer" ) ) then -- now we know: -- source -> wanted, not arrested -- w -> teaser toggleAllControls ( source, false ) if ( isPedInVehicle ( source ) ) then removePedFromVehicle ( source ) end setPedAnimation(source, "CRACK", "crckdeth2", 4000, false, true, false) exports.SAEGMessages:sendClientMessage ( "You have tased ".. getPlayerName ( source ), a, 0, 255, 0 ) exports.SAEGMessages:sendClientMessage ( "You have been tased by "..getPlayerName ( a ), source, 255, 0, 0 ) tased [ source ] = true setTimer ( function ( p, c ) if ( isElement ( p ) ) then setPedAnimation ( p ) toggleAllControls ( p, true ) exports.SAEGMessages:sendClientMessage ( "You are no longer tased", p, 0, 255, 0 ) if ( isElement ( c ) ) then exports.SAEGMessages:sendClientMessage ( getPlayerName ( p ).." is now un-tased!", c, 255, 255, 0 ) end end tased [ p ] = false end, 4000, 1, source, a ) end else if ( isPedInVehicle ( cop ) ) then return end exports['SAEGMessages']:sendClientMessage ( "Use a nightstick to arrest and a silenced pistol to tase", cop, 255, 255, 255 ) end else local f = math.floor ( loss * 1.2) setElementHealth ( cop, getElementHealth ( cop ) - f ) exports['SAEGMessages']:sendClientMessage ( "You've lost "..tostring ( f ).."% health for hurting an innocent player.", cop, 255, 255, 0 ) end end end end ) function onPlayerAttmemptArrestAvoid ( ) --outputChatBox ( getPlayerName ( source ).. " attempted to arrest avoid" ) triggerEvent ( "saegpolice:onJailCopCrimals", getElementData ( source, "SAEGJobs:ArrestingOfficer" ) ) end addCommandHandler ( "release", function ( p, _, p2 ) if ( getPlayerTeam ( p ) and exports['SAEGPlayerFunctions']:isTeamLaw ( getTeamName ( getPlayerTeam ( p ) ) ) ) then if ( p2 ) then local c = getPlayerFromName ( p2 ) or exports['SAEGPlayerFunctions']:getPlayerFromNamePart ( p2 ) if c then if ( arresties[c] ) then if ( getElementData ( c, "SAEGJobs:ArrestingOfficer") == p ) then exports['SAEGMessages']:sendClientMessage ( "You have released "..getPlayerName ( c ), p, 0, 255, 0) exports['SAEGMessages']:sendClientMessage ( getPlayerName ( p ).." released you.", c, 0, 255, 0 ) releasePlayer ( c ) local arresties2 = { } for i, v in pairs ( arresties ) do if ( getElementData ( v, "SAEGJobs:ArrestingOfficer" ) == p ) then table.insert ( arresties2, v ) end end triggerClientEvent ( root, "onPlayerEscapeCop", root, c, p, arresties2 ) else exports['SAEGMessages']:sendClientMessage ( "You're not "..getPlayerName ( c ).."'s arresting officer, you cannot release him.", p, 255, 255, 0 ) end else exports['SAEGMessages']:sendClientMessage ( getPlayerName ( c ).." isn't being arrested", p, 255, 255, 0 ) end else exports['SAEGMessages']:sendClientMessage ( p2.." doesn't exist. ", p, 255, 255, 0 ) end else exports['SAEGMessages']:sendClientMessage ( "Syntax error. /release [player]", p, 255, 255, 0 ) end else exports['SAEGMessages']:sendClientMessage ( "You're not a law officer.", p, 255, 255, 0 ) end end ) function arrestPlayer ( crim, cop ) showCursor ( crim, true ) arresties[crim] = true toggleControl ( crim, 'right', false ) toggleControl ( crim, 'left', false ) toggleControl ( crim, 'forwards', false ) toggleControl ( crim, 'backwards', false ) toggleControl ( crim, 'jump', false ) toggleControl ( crim, 'sprint', false ) toggleControl ( crim, 'walk', false ) toggleControl ( crim, 'fire', false ) onTimer ( crim, cop ) triggerClientEvent ( root, "onPlayerStartArrested", root, crim, cop ) end function onTimer ( crim, cop ) if ( isElement ( crim ) and isElement ( cop ) ) then if ( not getPlayerTeam ( cop ) or not exports['SAEGPlayerFunctions']:isTeamLaw ( getTeamName ( getPlayerTeam ( cop ) ) ) ) then return releasePlayer ( crim ) end if ( not arresties[crim] ) then return end local cx, cy, cz = getElementPosition ( crim ) local px, py, pz = getElementPosition ( cop ) local rot = findRotation ( cx, cy, px, py ) setPedRotation ( crim, rot ) setCameraTarget ( crim, crim ) local dist = getDistanceBetweenPoints3D ( cx, cy, cz, px, py, pz ) if ( isPedInVehicle ( cop ) ) then if ( not isPedInVehicle ( crim ) ) then warpPedIntoVehicle ( crim, getPedOccupiedVehicle ( cop ), 1 ) end else if ( isPedInVehicle ( crim ) ) then removePedFromVehicle ( crim ) end end if ( not isPedInVehicle ( crim ) ) then if ( dist >= 20 ) then setElementPosition ( crim, px +1, py+1, pz ) elseif ( dist >= 15 ) then setControlState ( crim, 'walk', false ) setControlState ( crim, 'jump', true ) setControlState ( crim, 'sprint', true ) setControlState ( crim, "forwards", true ) elseif ( dist >= 10 ) then setControlState ( crim, 'walk', false ) setControlState ( crim, 'jump', false ) setControlState ( crim, 'sprint', true ) setControlState ( crim, "forwards", true ) elseif ( dist >= 7 ) then setControlState ( crim, 'walk', false ) setControlState ( crim, 'jump', true ) setControlState ( crim, 'sprint', false ) setControlState ( crim, "forwards", true ) elseif ( dist >= 2 ) then setControlState ( crim, 'walk', true ) setControlState ( crim, 'jump', false ) setControlState ( crim, 'sprint', false ) setControlState ( crim, "forwards", true ) else setControlState ( crim, 'walk', false ) setControlState ( crim, 'jump', false ) setControlState ( crim, 'sprint', false ) setControlState ( crim, "forwards", false ) end end crim.interior = cop.interior; crim.dimension = cop.dimension setTimer ( onTimer, 500, 1, crim, cop ) else arresties[crim] = false if ( not isElement ( cop ) and isElement ( crim ) ) then releasePlayer ( crim ) exports['SAEGMessages']:sendClientMessage ( "Your arresting officer has quit, therefore, you've been released.", crim, 0, 255, 0 ) end end end function findRotation(x1,y1,x2,y2) local t = -math.deg(math.atan2(x2-x1,y2-y1)) if t < 0 then t = t + 360 end; return t; end function releasePlayer ( p ) toggleAllControls ( p, true ) setControlState ( p, 'walk', false ) setControlState ( p, 'jump', false ) setControlState ( p, 'sprint', false ) setControlState ( p, "forwards", true ) setElementData ( p, "SAEGJobs:ArrestingOfficer", nil ) arresties[p] = nil showCursor ( p, false ) removeEventHandler ( "onPlayerQuit", p, onPlayerAttmemptArrestAvoid ); end function onJailCopCriminals( ) for v, _ in pairs ( arresties ) do if ( getElementData ( v, "SAEGJobs:ArrestingOfficer" ) == source ) then releasePlayer ( v ) local time = math.floor ( ( getElementData ( v, "WantedPoints" ) * 2 ) or 50 ) local orgTime = time local vip = getElementData ( v, "VIP" ) if ( exports.SAEGVIP:getVipLevelFromName ( vip ) == 4 ) then time = time - ( time * 0.5 ) exports.SAEGMessages:sendClientMessage ( "You're serving 50% less jail time due to diamond VIP! (Original time: "..orgTime.." seconds)", v, 0, 255, 0 ) elseif ( exports.SAEGVIP:getVipLevelFromName ( vip ) == 3 ) then time = time - ( time * 0.25 ) exports.SAEGMessages:sendClientMessage ( "You're serving 25% less jail time due to gold VIP! (Original time: "..orgTime.." seconds)", v, 0, 255, 0 ) elseif ( exports.SAEGVIP:getVipLevelFromName ( vip ) == 2 ) then time = time - ( time * 0.15 ) exports.SAEGMessages:sendClientMessage ( "You're serving 15% less jail time due to silver VIP! (Original time: "..orgTime.." seconds)", v, 0, 255, 0 ) elseif ( exports.SAEGVIP:getVipLevelFromName ( vip ) == 1 ) then time = time - ( time * 0.05 ) exports.SAEGMessages:sendClientMessage ( "You're serving 5% less jail time due to bronze VIP! (Original time: "..orgTime.." seconds)", v, 0, 255, 0 ) end local time = math.floor ( time ) givePlayerMoney ( source, math.floor ( orgTime*2 ) ) exports['SAEGMessages']:sendClientMessage ( "You were paid $"..math.floor ( orgTime*2 ).." for arresting "..getPlayerName ( v ).."!", source, 0, 255, 0 ) exports['SAEGPolice']:jailPlayer ( v, time, false, source, "Police Arrest" ) updateJobColumn ( getAccountName ( getPlayerAccount ( source ) ), "Arrests", "AddOne" ) end end end addEvent ( "saegpolice:onJailCopCrimals", true ) addEventHandler ( "saegpolice:onJailCopCrimals", root, onJailCopCriminals )
-
"Owner"> "Level_1"> "Level_2"> "Level_3"> "Level_4"> "Level_5"> "Level_6"> "Level_7"> "Level_8"> "Level_9"> "resource.*"> "user.oussama"> "resource.SAEGChangpass">
-
how i can make vehicle group system with colors ? not the marker but i want change color car of the group example SWAT Cars Blue (not the marker) Codes Server-Side : local rootElement = getRootElement() local markers = {} local playerVehicles = {} local playerTrailers = {} local lawTeams = {["Law Enforcement"] = true, ["SWAT"] = true, ["Military"] = true, ["Staff"] = true} --teamName, posX, posY, posZ, R, G, B, Alpha, Vehicle IDs, Rotation, Element data name local vehiclesTable = { ----- MILITARY {{"Military"}, 206.99, 1931.85, 22,0, 0, 255, 150, {487, 425, 520 }, 3, "Group"}, ---- LV HQ BASE AIRCRAFT ---SWAT {{"SWAT"}, 848.93, -2117.51, 1.95,0, 0, 255, 150, {411, 522, 544 }, 90, "Group"}, ----- LS HG Base Cars {{"SWAT"}, 825.98, -2087.69, 43.38,0, 0, 255, 150, {520, 519, 476 }, 1, "Group"}, ----- LS HG Base AirCraft {{"SWAT"}, 836.14, -2020.34, 13.11,0, 0, 255, 150, {411, 522, 544 }, 1, "Group"}, --------- LS HG Base Cars } addEventHandler("onResourceStart", resourceRoot, function () for i,v in pairs(vehiclesTable) do local marker = createMarker(tostring(v[2]), tostring(v[3]), tostring(v[4])-1, "cylinder", 2.5, tostring(v[5]), tostring(v[6]), tostring(v[7]), tostring(v[8]), rootElement) if marker then markers[marker] = {v[1], v[9], v[10], v[11], v[12]} addEventHandler("onMarkerHit", marker, onSpawnerMarkerHit) setElementData(marker,"teamMarker",true) end end end) function onSpawnerMarkerHit(hitPlayer, matchingDimension) if not matchingDimension then return end if getElementType(hitPlayer) == "player" then if isPedInVehicle(hitPlayer) then return end local markerTeam = getElementData(source,"teamMarker") if not markerTeam then return end local teamName = getElementData(hitPlayer,tostring(markers[source][4])) if not teamName then return end for i,v in pairs(markers[source][1]) do if v == teamName then triggerClientEvent(hitPlayer,"show_vehicle_selector",hitPlayer,markers[source][2],source) end end end end addEvent("vehicle_spawn",true) addEventHandler("vehicle_spawn",rootElement, function (player, vehicleID, marker) if isElement(playerVehicles[player]) then destroyElement(playerVehicles[player]) end if isElement(playerTrailers[player]) then destroyElement(playerTrailers[player]) end local x, y, z = getElementPosition(marker) playerVehicles[player] = createVehicle(vehicleID, x, y, z+3, 0, 0, markers[marker][3]) warpPedIntoVehicle(player, playerVehicles[player]) setElementData(playerVehicles[player],"allowedJobs",markers[marker][1]) setElementData(playerVehicles[player],"allowedData",markers[marker][4]) if markers[marker][5] then playerTrailers[player] = createVehicle(markers[marker][4], x-9, y, z + 3, 0, 0, markers[marker][3]) if playerTrailers[player] then setElementData(playerVehicles[player],"trailer",playerTrailers[player]) addEventHandler("onVehicleExplode",playerTrailers[player],function () if isElement(source) then destroyElement(source) end end) end end addEventHandler("onVehicleExplode",playerVehicles[player],function () if isElement(source) then if getElementData(source,"trailer") and isElement(getElementData(source,"trailer")) then destroyElement(getElementData(source,"trailer")) end destroyElement(source) end end) end) function vehicleEnterCheck(player, seat, jacked) if (seat ~= 0) then return end local allowedJobs = getElementData(source, "allowedJobs") if not allowedJobs or not type(allowedJobs) == "table" then return end local allowedData = getElementData(source, "allowedData") local teamName = getElementData(player, tostring(allowedData)) if not teamName then return end local tempTable = {} for index, Job in ipairs(allowedJobs) do tempTable[Job] = true end local driver = getVehicleController(source) local wanted = 0 if (driver) then wanted = getPlayerWantedLevel(driver) end if (tempTable[teamName] or lawTeams[getTeamName(getPlayerTeam(player))] and wanted < 6) then return else cancelEvent() outputChatBox(player, "You cannot enter this vehicle.",255,100,0) end end addEventHandler("onVehicleStartEnter",root,vehicleEnterCheck) function onLogoutOrQuit() if isElement(playerVehicles[source]) then destroyElement(playerVehicles[source]) end if isElement(playerTrailers[source]) then destroyElement(playerTrailers[source]) end end addEventHandler("onPlayerLogout",root,onLogoutOrQuit) addEventHandler("onPlayerQuit",root,onLogoutOrQuit)
-
NGPlayerFunctions>server>Teams change with this code : local teams = { { "Staff", 76, 0, 153 }, { "Military", 0, 102, 0 }, { "SWAT", 0, 0, 204 }, { "Criminals", 255, 0, 0 }, { "Law Enforcement", 0, 100, 255 }, { "Services", 255, 255, 0 }, { "Emergency", 0, 255, 255 }, { "Unemployed", 192, 192, 192 }, } local lawTeams = { ['Law Enforcement'] = true } local team = { } for i, v in ipairs ( teams ) do team[v[1]] = createTeam ( unpack ( v ) ) end function setTeam ( p, tem ) if ( p and getElementType ( p ) == 'player' and tem and type ( tem ) == 'string' ) then for i, v in ipairs ( teams ) do if ( v[1] == tem ) then return setPlayerTeam ( p, getTeamFromName ( v[1] ) ) end end end return false end addEventHandler ( "onResourceStop", root, function ( ) for i, v in ipairs ( getElementsByType ( 'player' ) ) do if ( getPlayerTeam ( v ) ) then setElementData ( v, "SAEGPlayers:SavedTeam", getTeamName ( getPlayerTeam ( v ) ) ) end end end ) addEventHandler ( 'onResourceStart', resourceRoot, function ( ) for i, v in ipairs ( getElementsByType ( 'player' ) ) do local t = getElementData ( v, 'SAEGPlayers:SavedTeam' ) if t and getTeamFromName ( t ) then setPlayerTeam ( v, getTeamFromName ( t ) ) else setPlayerTeam ( v, getTeamFromName ( t, "Unemployed" ) ) end end end ) function isTeamLaw ( team ) local team = tostring ( team ) if ( lawTeams[team] ) then return true end return false end NGJobs>core_client : change with this code : local _guiSetVisible = guiSetVisible function guiSetVisible ( window, visible ) --outputChatBox ( tostring ( window )..": "..tostring( visible ) ) _guiSetVisible ( window, visible ); end local do3dtextrender = false setTimer ( function ( ) do3dtextrender = exports.SAEGLogin:isClientLoggedin ( ) end, 1000, 1 ) addEvent ( "onClientPlayerLogin", true ) addEventHandler ( "onClientPlayerLogin", root, function ( ) do3dtextrender = true end ) jobDescriptions = { ['fisherman'] = [[With the Fisher job, you will be able to spawn a boat and drive around the water to collect caught items. To catch items, you need to be in a boat that's in the water, and you MUST be moving, or else you will just be wasting time. Once your holding area is full, you'll need to return to port to sell your fish.\n\nTo view your net, use the command /net]], ['medic'] = [[When you're a medic, you can go around healing other players and getting paid for it. The money that you get for healing the player, depends on the amount of the health that they had before.]], ['police'] = [[When you're a cop, you will be able to arrest wanted players, so they have to pay the tiem for their crime. To know if a player is wanted, you can check for their name in F5, or look at their name tag, and it will be (theirName)[wantedLevel]. They will also have a police star floating over their head. If a player decides to run from you, you can used the silenced pistol as a taser, and when you shoot them, they'll be put into a tased animation, so you can arrest them.]], ['mechanic'] = [[When you're employed as a mechanic, you can go around anywhere in Los Santos fixing players cars. To fix a car, you just need to click on it and then it'll ask the client if they'd like to fix it. If they accept, a progress bar will start and then when it finishes, their car will be fix and you'll be paid.]], ['criminal'] = [[As a criminal, you can go around stealing cars in Los Santos, picking up free weapons in San Fierron and turfing in Las Ventures, but be careful, the police are always after you.]], ['detective'] = [[When you are a detective in the SAEG:RPG server, you will still have all of the features availble to you as being a normal police officer (police panel, radio chat, arrests), other than when you are a detective you will be called on to crime cases when a fellow police officer is murdered. When you arive at the crime scene, you just have to look around for clues of the killer. You will also have the ability to spawn faster vehicles]], ['pilot'] = [[When you're a pilot, you will fly an aircraft around San Andreas, picking up and delivering passengers from waypoint to waypoint. You will also be able to pick up other players, they will be able to set a waypoint when you deliver them to their waypoint you'll be paid]], ['stunter'] = [[if you're a stunter, you can go around San Andreas doing tricks on bikes or motorcycles. For every stunt that you do, you'll be paid]], ['military'] = [[This Job is only for "Military" Soldiers]], ['swat'] = [[This job is only for "SWAT" Officers]], } sx, sy = guiGetScreenSize ( ) rSX, rSY = sx / 1280, sx / 1024 local JobWindow = guiCreateWindow( ( sx / 2 - (rSX*500) / 2 ), (sy-(rSY*230))-rSY*15, rSX*500, rSY*230, "SAEG:RPG ~ Job System", false) local JobDescription = guiCreateMemo((rSX*10), (rSY*23), (rSX*480), (rSY*150), "Job Description", false, JobWindow) local JobAccept = guiCreateButton((rSX*10), ((rSY*230)-(rSY*25))-rSY*10, (rSX*150), (rSY*25), "Accept Job", false, JobWindow) local JobDeny = guiCreateButton((rSX*170), ((rSY*230)-(rSY*25))-rSY*10, (rSX*150), (rSY*25), "Deny Job", false, JobWindow) guiSetVisible ( JobWindow, false ) guiWindowSetSizable(JobWindow, false) guiWindowSetMovable ( JobWindow, false ) guiSetFont(JobDeny, "default-bold-small") guiSetFont(JobAccept, "default-bold-small") guiMemoSetReadOnly ( JobDescription, true ) --guiSetFont(JobDescription, "default-bold-small") -- settings: { maxDist = 17, showBoarder & Hide rectangle = false } addEventHandler ( 'onClientPreRender', root, function ( ) if ( do3dtextrender ) then for ind, v in ipairs ( getElementsByType ( '3DText' ) ) do local continueRender = true local text = getElementData ( v, 'text' ) local pos = getElementData ( v, 'position' ) local color = getElementData ( v, 'color' ) local parent = getElementData ( v, 'parentElement' ) if ( parent ) then if ( isElement ( parent ) ) then if ( isPedInVehicle ( localPlayer ) and getElementType ( parent ) == 'vehicle' and getPedOccupiedVehicle ( localPlayer ) == parent ) then return end local offset = pos local px, py, pz = getElementPosition ( parent ) pos = { px+offset[1], py+offset[2], pz+offset[3] } if ( parent == localPlayer ) then continueRender = false end else destroyElement ( v ) end end if continueRender and text and pos and color then local x, y, z = unpack ( pos ) local z = z + 1.15 local settings = getElementData ( v, 'Settings' ) or { } local maxDist = settings[1] or 17 if ( settings[2] ) then showBoarder = true else showBoarder = false end local px, py, pz = getElementPosition ( localPlayer ) local _3DDist = getDistanceBetweenPoints3D ( x, y, z, px, py, pz ) if ( _3DDist <= maxDist and isLineOfSightClear ( x, y, z, px, py, pz, true, false, false, true, false, false ) ) then local x, y = getScreenFromWorldPosition ( x, y, z ) local r, g, b = unpack ( color ) if x then local textSize = rSY*2 local textSize = textSize * ( ( maxDist - _3DDist ) / maxDist ) --local textSize = 2 local textWidth = dxGetTextWidth(text,textSize,'default') local height = dxGetFontHeight ( textSize, 'default' ) local x = x-(textWidth/2) if x and y and r and g and b then if ( showBoarder ) then dxDrawRectangle ( x-6, y+1, textWidth+12, height+2, tocolor ( 0, 0, 0, 120 ) ) dxDrawText ( tostring ( text ), x, y, 0, 0, tocolor ( r, g, b, 255 ), textSize ) else dxDrawBoarderedText ( tostring ( text ), x, y, 0, 0, tocolor ( r, g, b, 255 ), textSize ) end end end end end end end end ) function dxDrawBoarderedText ( text, x, y, endX, endY, color, size, font, alignX, alignY, clip, wordBreak, postGUI, colorCode, subPixelPos, fRot, fRotCX, fRotCY, offSet ) local text = tostring ( text ) local x = tonumber(x) or 0 local y = tonumber(y) or 0 local endX = tonumber(endX) or x local endY = tonumber(endY) or y local color = color or tocolor ( 255, 255, 255, 255 ) local size = tonumber(size) or 1 local font = font or "default" local alignX = alignX or "left" local alignY = alignY or "top" local clip = clip or false local wordBreak = wordBreak or false local postGUI = postGUI or false local colorCode = colorCode or false local subPixelPos = subPixelPos or false local fRot = tonumber(fRot) or 0 local fRotCX = tonumber(fRotCX) or 0 local fRotCY = tonumber(fRotCy) or 0 local offSet = tonumber(offSet) or 1 local t_g = text:gsub ( "#%x%x%x%x%x%x", "" ) dxDrawText ( t_g, x-offSet, y-offSet, endX, endY, tocolor(0,0,0,255), size, font, alignX, alignY, clip, wordBreak, postGUI, colorCode, subPixelPos, fRot, fRotCX, fRotCY, offSet ) dxDrawText ( t_g, x-offSet, y, endX, endY, tocolor(0,0,0,255), size, font, alignX, alignY, clip, wordBreak, postGUI, colorCode, subPixelPos, fRot, fRotCX, fRotCY, offSet ) dxDrawText ( t_g, x, y-offSet, endX, endY, tocolor(0,0,0,255), size, font, alignX, alignY, clip, wordBreak, postGUI, colorCode, subPixelPos, fRot, fRotCX, fRotCY, offSet ) dxDrawText ( t_g, x+offSet, y+offSet, endX, endY, tocolor(0,0,0,255), size, font, alignX, alignY, clip, wordBreak, postGUI, colorCode, subPixelPos, fRot, fRotCX, fRotCY, offSet ) dxDrawText ( t_g, x+offSet, y, endX, endY, tocolor(0,0,0,255), size, font, alignX, alignY, clip, wordBreak, postGUI, colorCode, subPixelPos, fRot, fRotCX, fRotCY, offSet ) dxDrawText ( t_g, x, y+offSet, endX, endY, tocolor(0,0,0,255), size, font, alignX, alignY, clip, wordBreak, postGUI, colorCode, subPixelPos, fRot, fRotCX, fRotCY, offSet ) return dxDrawText ( text, x, y, endX, endY, color, size, font, alignX, alignY, clip, wordBreak, postGUI, colorCode, subPixelPos, fRot, fRotCX, fRotCY, offSet ) end 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 ) return text end return false end local peds = { } function refreshGodmodePeds ( ) for i, v in ipairs ( peds ) do destroyElement ( v ) end for i, v in ipairs ( getElementsByType ( 'GodmodePed' ) ) do local id = getElementData ( v, "Model" ) local x, y, z, rz = unpack ( getElementData ( v, "Position" ) ) peds[i] = createPed ( id, x, y, z, rz ) setElementFrozen ( peds[i], true ) addEventHandler ( 'onClientPedDamage', peds[i], function ( ) cancelEvent ( ) end ) end end refreshGodmodePeds ( ) setTimer ( refreshGodmodePeds, 30000, 0 ) openedJob = nil addEvent ( 'SAEGJobs:OpenJobMenu', true ) addEventHandler ( 'SAEGJobs:OpenJobMenu', root, function ( job ) openedJob = job guiSetVisible ( JobWindow, true ) showCursor ( true ) local desc = jobDescriptions [ job ] guiSetText ( JobDescription, tostring ( desc ) ) addEventHandler ( "onClientGUIClick", root, clickingevents_jobmenu ) end ) function clickingevents_jobmenu ( ) if ( source == JobDeny ) then desc = nil openedJob = nil guiSetVisible ( JobWindow, false ) showCursor ( false ) removeEventHandler ( "onClientGUIClick", root, clickingevents_jobmenu ) elseif ( source == JobAccept ) then triggerServerEvent ( "SAEGJobs:SetPlayerJob", localPlayer, openedJob ) desc = nil openedJob = nil guiSetVisible ( JobWindow, false ) showCursor ( false ) removeEventHandler ( "onClientGUIClick", root, clickingevents_jobmenu ) end end addEventHandler ( 'onClientPlayerWasted', root, function ( ) if ( source == localPlayer ) then showCursor ( false ) guiSetVisible ( JobWindow, false ) end end ) addEvent ( "onPlayerResign", true ) NGJobs > core_server change with this code : max_wanted = { community = 2, law = 3, 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]="Chief of Police", }, ['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] ="Soldier", }, ['swat'] = { [0] ="Officer", }, ['riot'] = { [0] ="RIOT Officer", }, ['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, 120, 255 }, { nil, true } ) local p = createElement ( "GodmodePed" ) setElementData ( p, "Model", 287 ) 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") ~= "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, 120, 255 }, { nil, true } ) local p = createElement ( "GodmodePed" ) setElementData ( p, "Model", 285 ) 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") ~= "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 (
-
Great, so did you restarted your server or refreshed the ACL after giving the resource the access? sure i restart the server
-
same i'm sure you did a copy & paste to "resource.resourceName"> It was just an example to know what you need to do, Change the 'resourceName' to your resouce name easy? omg kariim -.- i know how i need just add in the acl admin section -.-
-
Check the Errors to let us know which error this script have? access denied @ 'setaccountpassword' not work
-
i tried to make script for change password what is problem here pls ? Server-Side : function obteneraccount(playerSource) sourceAccount = getPlayerAccount ( playerSource ) if isGuestAccount ( sourceAccount ) then exports.SAEGMessages:sendClientMessage("[sERVER] Please log in to use this feature.", Source, 255, 255, 255, true) else PCuenta = getAccountName(getPlayerAccount(source)) triggerClientEvent("OnDatas",source,PCuenta) end end addEvent("obAccount", true) addEventHandler("obAccount",getRootElement(),obteneraccount) function errorp() exports.SAEGMessages:sendClientMessage("[sERVER] Passwords do not match.", source, 255, 255, 255, true) end addEvent("ErrorPass", true) addEventHandler("ErrorPass",getRootElement(),errorp) function cambiar(newpass1) local account = getPlayerAccount(source) local nCuenta = getAccountName(account) if (account) then if (isGuestAccount(account)) then exports.SAEGMessages:sendClientMessage("[sERVER]Please log in to change the password.", source, 255, 255, 255, true) else setAccountPassword(account, newpass1) exports.SAEGMessages:sendClientMessage("[sERVER] The account password has been changed.", source, 255, 255, 255, true) exports.SAEGMessages:sendClientMessage("[ACCOUNT][uSER: "..nCuenta.." ] - [NEW PASSWORD: "..newpass1.." ].", source, 255, 255, 255, true) end end end addEvent("Cambiar", true) addEventHandler("Cambiar",getRootElement(),cambiar) Clinet-side : GUI = guiCreateWindow(436, 271, 253, 246, "SAEG - Password Changer", false) guiWindowSetSizable(GUI, false) guiSetVisible(GUI, false) Label_Account = guiCreateLabel(10, 31, 52, 15, "Account:", false, GUI) Cuenta = guiCreateLabel(72, 31, 171, 15, "none", false, GUI) guiLabelSetColor(Cuenta, 255, 0, 0) Label_Newpass1 = guiCreateLabel(10, 56, 233, 19, "New Password:", false, GUI) guiLabelSetHorizontalAlign(Label_Newpass1, "center", false) Edit_pass1 = guiCreateEdit(10, 81, 233, 24, "Password", false, GUI) Label_Newpass2 = guiCreateLabel(10, 115, 233, 19, "Repeat New Password:", false, GUI) guiLabelSetHorizontalAlign(Label_Newpass2, "center", false) Edit_pass2 = guiCreateEdit(10, 144, 233, 24, "Password", false, GUI) Boton_change = guiCreateButton(45, 178, 81, 26, "Change", false, GUI) guiSetProperty(Boton_change, "NormalTextColour", "FFAAAAAA") Boton_cancel = guiCreateButton(126, 178, 81, 26, "Cancel", false, GUI) guiSetProperty(Boton_cancel, "NormalTextColour", "FFAAAAAA") Boton_help = guiCreateButton(86, 204, 81, 26, "Help", false, GUI) guiSetProperty(Boton_help, "NormalTextColour", "FFAAAAAA") GUI2 = guiCreateWindow(690, 271, 256, 315, "Help", false) guiWindowSetSizable(GUI2, false) guiSetVisible(GUI2, false) scrollpanel = guiCreateScrollPane(10, 27, 236, 241, false, GUI2) text_help = guiCreateLabel(0, 0, 243, 245, "/changepass = open panel\n\n*remember to log in.\n*CHANGE = change the password.\n*CANCEL = close panel.\n*HELP = open help panel.\n*CLOSE = close help panel\n\n", false, scrollpanel) Boton_close = guiCreateButton(86, 278, 85, 25, "CLOSE", false, GUI2) guiSetProperty(Boton_close, "NormalTextColour", "FFAAAAAA") -- showCursor(false) function Abrir() triggerServerEvent("obAccount", getLocalPlayer(), getLocalPlayer()) end addCommandHandler("changepass", Abrir) function abrir2(PCuenta) guiSetText(Cuenta, PCuenta) guiSetVisible(GUI, true) showCursor(true) end addEvent("OnDatas",true) addEventHandler("OnDatas",getLocalPlayer(),abrir2) function cerrar() guiSetVisible(GUI, false) guiSetVisible(GUI2, false) showCursor(false) end addEventHandler("onClientGUIClick", Boton_cancel, cerrar, false) function abrirhelp() if (guiGetVisible(GUI2)) == false then guiSetVisible(GUI2, true) else guiSetVisible(GUI2, false) end end addEventHandler("onClientGUIClick", Boton_help, abrirhelp, false) function cerrarhelp() guiSetVisible(GUI2, false) end addEventHandler("onClientGUIClick", Boton_close, cerrarhelp, false) function clearedit() if (source == Edit_pass1) then guiSetText(Edit_pass1, "") guiEditSetMasked(Edit_pass1, true) elseif (source == Edit_pass2) then guiSetText(Edit_pass2, "") guiEditSetMasked(Edit_pass2, true) end end addEventHandler("onClientGUIClick", root, clearedit) function cambiarpass() newpass1 = guiGetText(Edit_pass1) newpass2 = guiGetText(Edit_pass2) if (newpass1 == newpass2) then triggerServerEvent ("Cambiar", getLocalPlayer(), newpass1) else triggerServerEvent("ErrorPass", getLocalPlayer(), getLocalPlayer()) end end addEventHandler("onClientGUIClick", Boton_change, cambiarpass, false)
-
the marker up idk why this ss : http://i.imgur.com/7rSyOKQ.jpg and this the code : local rootElement = getRootElement() local markers = {} local playerVehicles = {} local playerTrailers = {} local lawTeams = {["Law Enforcement"] = true, ["SWAT"] = true, ["Military"] = true, ["Staff"] = true} --teamName, posX, posY, posZ, R, G, B, Alpha, Vehicle IDs, Rotation, Element data name local vehiclesTable = { ----- MILITARY {{"king"}, 206.99, 1931.85, 22,0, 0, 255, 150, {487, 425, 520 }, 3, "Group"}, ---- LV HQ BASE AIRCRAFT ---SWAT {{"SWAT"}, 824.13, -2139.37, 1.79,0, 0, 255, 100, {520, }, 1, "Group"}, } addEventHandler("onResourceStart", resourceRoot, function () for i,v in pairs(vehiclesTable) do local marker = createMarker(tostring(v[2]), tostring(v[3]), tostring(v[4]), "cylinder", 2.5, tostring(v[5]), tostring(v[6]), tostring(v[7]), tostring(v[8]), rootElement) if marker then markers[marker] = {v[1], v[9], v[10], v[11], v[12]} addEventHandler("onMarkerHit", marker, onSpawnerMarkerHit) setElementData(marker,"teamMarker",true) end end end) function onSpawnerMarkerHit(hitPlayer, matchingDimension) if not matchingDimension then return end if getElementType(hitPlayer) == "player" then if isPedInVehicle(hitPlayer) then return end local markerTeam = getElementData(source,"teamMarker") if not markerTeam then return end local teamName = getElementData(hitPlayer,tostring(markers[source][4])) if not teamName then return end for i,v in pairs(markers[source][1]) do if v == teamName then triggerClientEvent(hitPlayer,"show_vehicle_selector",hitPlayer,markers[source][2],source) end end end end addEvent("vehicle_spawn",true) addEventHandler("vehicle_spawn",rootElement, function (player, vehicleID, marker) if isElement(playerVehicles[player]) then destroyElement(playerVehicles[player]) end if isElement(playerTrailers[player]) then destroyElement(playerTrailers[player]) end local x, y, z = getElementPosition(marker) playerVehicles[player] = createVehicle(vehicleID, x, y, z+3, 0, 0, markers[marker][3]) warpPedIntoVehicle(player, playerVehicles[player]) setElementData(playerVehicles[player],"allowedJobs",markers[marker][1]) setElementData(playerVehicles[player],"allowedData",markers[marker][4]) if markers[marker][5] then playerTrailers[player] = createVehicle(markers[marker][4], x-9, y, z + 3, 0, 0, markers[marker][3]) if playerTrailers[player] then setElementData(playerVehicles[player],"trailer",playerTrailers[player]) addEventHandler("onVehicleExplode",playerTrailers[player],function () if isElement(source) then destroyElement(source) end end) end end addEventHandler("onVehicleExplode",playerVehicles[player],function () if isElement(source) then if getElementData(source,"trailer") and isElement(getElementData(source,"trailer")) then destroyElement(getElementData(source,"trailer")) end destroyElement(source) end end) end) function vehicleEnterCheck(player, seat, jacked) if (seat ~= 0) then return end local allowedJobs = getElementData(source, "allowedJobs") if not allowedJobs or not type(allowedJobs) == "table" then return end local allowedData = getElementData(source, "allowedData") local teamName = getElementData(player, tostring(allowedData)) if not teamName then return end local tempTable = {} for index, Job in ipairs(allowedJobs) do tempTable[Job] = true end local driver = getVehicleController(source) local wanted = 0 if (driver) then wanted = getPlayerWantedLevel(driver) end if (tempTable[teamName] or lawTeams[getTeamName(getPlayerTeam(player))] and wanted < 6) then return else cancelEvent() outputChatBox(player, "You cannot enter this vehicle.",255,100,0) end end addEventHandler("onVehicleStartEnter",root,vehicleEnterCheck) function onLogoutOrQuit() if isElement(playerVehicles[source]) then destroyElement(playerVehicles[source]) end if isElement(playerTrailers[source]) then destroyElement(playerTrailers[source]) end end addEventHandler("onPlayerLogout",root,onLogoutOrQuit) addEventHandler("onPlayerQuit",root,onLogoutOrQuit)
