Jump to content

Best-Killer

Members
  • Posts

    494
  • Joined

  • Last visited

Everything posted by Best-Killer

  1. i'm trying to make more payout to vips players when hack the atm did you understand ?
  2. hackcld = {} addEvent("giveMny", true) addEventHandler("giveMny", root, function (mny) local vip = getElementData ( client, "VIP" ) if isTimer(hackcld[getPlayerSerial(client)]) then return exports.SAEGMessages:sendClientMessage( "ATM: can't hack the ATM now!",client, 255, 0, 0) end if ( exports.SAEGVIP:getVipLevelFromName ( vip ) == 2 ) then mny = mny+mny*0.25 elseif ( exports.SAEGVIP:getVipLevelFromName ( vip ) == 3 ) then mny = mny+mny*0.5 elseif ( exports.SAEGVIP:getVipLevelFromName ( vip ) == 4 ) then mny = mny+mny*0.75 end givePlayerMoney(client, math.floor(mny)) hackcld[getPlayerSerial(client)] = setTimer(function () end, 175000, 1) exports.SAEGMessages:sendClientMessage( "ATM: You successfully hacked the ATM and got "..mny.."$!",client, 0, 255, 0) end) addEventHandler("onClientGUIClick",root, function () local client = getLocalPlayer() if ( source == GUIEditor.button[12] ) then guiSetVisible(GUIEditor.window[1],false) showCursor(false) elseif ( source == GUIEditor.button[13] ) then local mode = nil if guiRadioButtonGetSelected ( GUIEditor.radiobutton[1] ) then mode = 'deposit' else mode = 'withdraw' end triggerServerEvent ( "SAEGBank:ModifyAccount", localPlayer, tostring ( mode ), tonumber ( guiGetText ( GUIEditor.edit[2] ) ) ) end if ( source == GUIEditor.button[1] ) then mny = (4999) triggerServerEvent ( "giveMny",client,mny) end end ) Vip can't get more than 4999$ (it's fine with not vips players ) giving 4999$ no errors no warnings with is the problem guys ?
  3. local spawners = { ['Free'] = { }, ['Job'] = { } } local spawnedVehciles = { } function createFreeSpawner ( x, y, z, rz, sx, sy, sz ) local i = #spawners['Free']+1 local z = z - 1 local sx, sy, sz = sx or x, sy or y, sz or z+1.5 local rz = rz or 0 spawners['Free'][i] = createMarker ( x, y, z, 'cylinder', 2, 255, 255, 255, 120 ) setElementData ( spawners['Free'][i], "SpawnCoordinates", { sx, sy, sz, rz } ) setElementData ( spawners['Free'][i], "SAEGVehicles:SpawnVehicleList", JobVehicles['Free'] ) setElementData ( spawners['Free'][i], "SAEGVehicles:JobRestriction", false ) addEventHandler ( "onMarkerHit", spawners['Free'][i], onSpawnerHit ) return spawners['Free'][i] end
  4. i changed it to marker and same problem ahahaha sory yes i mean line 8
  5. error : bad argument unpack table expected got boolean (line 11 ) local playerVehicles = { } function createPlayerVehicle ( p, id, marker, warp ) if ( isElement ( playerVehicles[p] ) ) then destroyElement ( playerVehicles[p] ) end local spawncord = getElementData ( source, "SpawnCoordinates" ) local x, y, z, rz = unpack(spawncord) local job = getElementData ( source, "SAEGVehicles:JobRestriction" ) or false playerVehicles[p] = createVehicle ( id, x, y, z, 0, 0, rz ) exports['SAEGLogs']:outputActionLog ( getPlayerName ( p ).." spawned a(n) "..getVehicleNameFromModel ( id ) ) --exports['SAEGJobs']:create3DText ( getPlayerName ( p ).."'s Vehicle", { 0, 0, 0.5 }, { 255, 255, 255 }, playerVehicles[p], { 7, true } ) if ( warp and isElement ( playerVehicles[p] ) ) then warpPedIntoVehicle ( p, playerVehicles[p] ) end if job then setElementData ( playerVehicles[p], "SAEGAntiRestart:VehicleJobRestriction", tostring ( job ) ) addEventHandler ( "onVehicleStartEnter", playerVehicles[p], checkRestrictions ) end return playerVehicles[p] end
  6. Thx dude but i got another ez way ^^
  7. thx dude ^^ guys now i got numbers .. ect i'll use that function spawnveh(button, press) if(press) then if(button == tostring(i)) then triggerServerEvent("vehicle_spawn",client,client,getVehicleModelFromName(v),theMarker) exports["SAEGMessages"]:sendClientMessage("You "..tonumber(getVehicleModelFromName(v)).."e.",client,255,100,0) end end i'm using the msg for test ^^ i'm not geting the model id from name what is the problem ?? that full code local client = getLocalPlayer() local rootElement = getRootElement() local theMarker = nil addEvent("showVehicle",true) addEventHandler("showVehicle",rootElement, function (vehiclesTable,marker) theMarker = marker guiSetVisible(window ,true) showCursor(false) guiGridListClear(grid ) for i,v in pairs(vehiclesTable) do function spawnveh(button, press) if(press) then if(button == tostring(i)) then triggerServerEvent("vehicle_spawn",client,client,getVehicleModelFromName(v),theMarker) exports["SAEGMessages"]:sendClientMessage("You "..tonumber(getVehicleModelFromName(v)).."e.",client,255,100,0) end end end local row = guiGridListAddRow(grid ) guiGridListSetItemText(grid , row, 1, tostring(i), false, true) guiGridListSetItemText(grid , row, 2, getVehicleNameFromModel(v), false, false) addEventHandler("onClientKey", rootElement,spawnveh) end end)
  8. Best-Killer

    Qustion

    How to number rows of grid list ?? i'm making a Vehicle Spawners by clicking button to spawn the vehicle look at the code you will understand what i want window = guiCreateWindow(550,560,200,200,"SAEG Vehicle Spawner",false) guiWindowSetSizable(window,false) grid = guiCreateGridList(0,20,190,170,false,window) guiGridListAddColumn(vehicle_selector_grid, "Key", 0.20) guiGridListAddColumn(vehicle_selector_grid, "Name", 0.65) guiWindowSetSizable(window,false) guiSetVisible(window,false) addEvent("showVehicle",true) addEventHandler("showVehicle",rootElement, function (vehiclesTable,marker) theMarker = marker guiSetVisible(window,true) showCursor(false) guiGridListClear(window) for i,v in pairs(vehiclesTable) do local row = guiGridListAddRow(window) guiGridListSetItemText(window, row, 2, getVehicleNameFromModel(v), false, false) end end) Now i have gui & gridlist with vehicles name what the next i have to do guys ?? Note : i don't know how to add numbers to grid any one tell me what i have to use right now pls
  9. nvm fixed just forget to add 2nd clinet
  10. Hello All What is the problem pls ? 0 errors addEvent("clanSystem:acceptInvite",true) addEventHandler("clanSystem:acceptInvite",root, function (thePlayer, clanName) local bool, theClan, inviter = isPlayerInvited(thePlayer) if bool then if clanName == theClan then exports["SAEGMessages"]:sendClientMessage("teest"..tostring(clanName).."",client,255,0,0) setElementData(thePlayer,"clan",tostring(clanName)) triggerEvent("onPlayerJoinClan",thePlayer,thePlayer,clanName) addMemberToClan(clanName, getAccountName(getPlayerAccount(thePlayer)), "Member", inviter) exports["SAEGMessages"]:sendClientMessage("Clan system: Welcome to ".. tostring(clanName) .."!",thePlayer,0,255,0) for index, player in pairs(getPlayersByClan(clanName)) do exports["SAEGMessages"]:sendClientMessage("Clan system: ".. getPlayerName(thePlayer) .." has joined the clan!",player,0,255,0) end players_invited[thePlayer] = false end end end) elseif (source == gui_elment["accept_invite"]) then local clanName = guiGridListGetItemText(gui_elment["create_clan"]["types_invites_grid"], guiGridListGetSelectedItem(gui_elment["create_clan"]["types_invites_grid"]), 1) if (not clanName) then return end triggerServerEvent("clanSystem:acceptInvite", client, tostring(clanName)) guiGridListRemoveRow(gui_elment["types_invites_grid"], guiGridListGetSelectedItem(gui_elment["types_invites_grid"]))
  11. function addTurf( player, cmd, width, height) if ( exports.NGAdministration:isPlayerStaff ( player ) and exports.NGAdministration:getPlayerStaffLevel ( player, 'int' ) >= 4 ) then if ( not width ) then return exports.NGMessages:sendClientMessage ( "Missing width argument, correct syntax: /addturf width height", player, 225, 0, 0) end if ( not height ) then return exports.NGMessages:sendClientMessage ( "Missing height argument, correct syntax: /addturf width height", player, 225, 0, 0) end -------if ( type ( width ) ~= 'string' and type ( height ) ~= 'string' ) then return exports.SAEGMessages:sendClientMessage( "SAEGTurf: Expected numbers for width and/or height", player, 0, 255, 0 ) end local x, y, z = getElementPosition ( player ) createTurf ( x, y, z, width, height, "server", id ) exports.NGSQL:db_query ( "INSERT INTO turfs(`id`, `owner`, `x`, `y`, `z`, `width`, `height`) VALUES (?, ?, ?, ?, ?, ?, ?)", id, 'server', math.floor(x), math.floor(y), math.floor(z), tonumber(width), tonumber(height)) exports.NGMessages:sendClientMessage( "SAEGTurf: A new turf was added successfully", player, 0, 255, 0 ) end end addCommandHandler( "addturf", addTurf )
  12. lol i forget them , but still same problem
  13. ok my scripts are leaked ok ? and do not help me
  14. mx, my, mz is the pos of the createColSphere cuz i want the system work like ilegal system : if arrested player in LS he got release in LS if SF he got release in sf did you understand !
  15. function sendTurfPayout ( ) local groupTurfs = { } for i, v in pairs ( turfLocs ) do if ( not groupTurfs [ v.owner ] ) then groupTurfs [ v.owner ] = 0 end if ( not v.attackers ) then groupTurfs [ v.owner ] = groupTurfs [ v.owner ] + 1 end end for i, v in pairs ( getElementsByType ( 'player' ) ) do local g = expors .SAEGGroups:getGroups () or exports.SAEGGroups:getPlayerGroup ( v ) if ( groupTurfs [ g ] > 0 ) then local c = groupTurfs [ g ] * tonumber ( get ( "*PAYOUT_CASH" ) ) exports.SAEGGroups:setGroupBank ( g, exports.SAEGGroups:getGroupBank ( g ) + tostring(c) ) end end end setTimer ( sendTurfPayout, (60*tonumber(get("*PAYOUT_TIME")))*100, 0 ) exports.SAEGGroupsgetPlayerGroup fine but SAEGGroups:getGroups group isn't defined and with that code , money are withdrawed to clan bank but only when the player group online ig i want if player not online ig or online ig the money withdraw to Groupbank !! any help pls ? Note : to that Moderator who removing my posts without make sure my codes aren't stolen or leaked pm me i want know you then i'll give you proffs that my codes arent't leaked or stolen Wtf pffffffffffff Stop removing them really i'm using Nerg Gaming Game mode & developring them want proff Pm me
  16. ah i'm sory and this jail Client Side 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 ( mx, my, mz ) 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, mx, my, mz, 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
  17. OMG it's Nerd gaming scripts and Other SAEG using WSS leaked police and the other saeg is not mine he did it when i left mta for 3 month did you understand now ?? check my all old topics and you know if i'm using WSS leaked or no pffffffffff i swear it's Nerd gaming scripts Comon pls help
  18. defult admin panel ?
  19. arrest Client - coptargets = 0 --ADDS BLIPS AND MARKERS FOR POLICE STATIONS addEvent("copdirections", true) function copshops() if coptargets == 0 then coptargets = 1 blip1 = createBlip ( 2246.1008300781, 2453.1953125, 9.8203125, 30, 3, 0, 0, 255, 255, 50, getLocalPlayer() ) marker1 = createMarker ( 2246.1008300781, 2453.1953125, 9.8203125, "cylinder", 6, 0, 0, 255, 55, getLocalPlayer() ) colshape1 = createColSphere ( 2246.1008300781, 2453.1953125, 9.8203125, 6 ) setElementData ( colshape1, "purpose", "copshop" ) blip2 = createBlip ( -1406.9072265625, 2655.0927734375, 55.6875, 30, 3, 0, 0, 255, 255, 50, getLocalPlayer() ) marker2 = createMarker ( -1406.9072265625, 2655.0927734375, 55.6875, "cylinder", 6, 0, 0, 255, 55, getLocalPlayer() ) colshape2 = createColSphere ( -1406.9072265625, 2655.0927734375, 55.6875, 6 ) setElementData ( colshape2, "purpose", "copshop" ) blip3 = createBlip ( -209.9542, 977.7558, 18.188976, 30, 3, 0, 0, 255, 255, 50, getLocalPlayer() ) marker3 = createMarker ( -209.9542, 977.7558, 18.188976, "cylinder", 6, 0, 0, 255, 55, getLocalPlayer() ) colshape3 = createColSphere (-209.9542, 977.7558, 18.188976, 6 ) setElementData ( colshape3, "purpose", "copshop" ) blip4 = createBlip ( -1628.2619628906, 676.62005615234, 6.1901206970215, 30, 3, 0, 0, 255, 255, 50, getLocalPlayer() ) marker4 = createMarker ( -1628.2619628906, 676.62005615234, 6.1901206970215, "cylinder", 6, 0, 0, 255, 55, getLocalPlayer() ) colshape4 = createColSphere ( -1628.2619628906, 676.62005615234, 6.1901206970215, 6 ) setElementData ( colshape4, "purpose", "copshop" ) blip5 = createBlip ( 624.66278076172, -605.72027587891, 15.923292160034, 30, 3, 0, 0, 255, 255, 50, getLocalPlayer() ) marker5 = createMarker ( 624.66278076172, -605.72027587891, 15.923292160034, "cylinder", 6, 0, 0, 255, 55, getLocalPlayer() ) colshape5 = createColSphere ( 624.66278076172, -605.72027587891, 15.923292160034, 6 ) setElementData ( colshape5, "purpose", "copshop" ) blip6 = createBlip ( 1565.3386230469, -1628.5202636719, 12.382812, 30, 3, 0, 0, 255, 255, 50, getLocalPlayer() ) marker6 = createMarker ( 1565.3386230469, -1628.5202636719, 12.382812, "cylinder", 6, 0, 0, 255, 55, getLocalPlayer() ) colshape6 = createColSphere ( 1565.3386230469, -1628.5202636719, 12.382812, 6 ) setElementData ( colshape6, "purpose", "copshop" ) blip7 = createBlip ( -2164.3779296875, -2389.533203125, 29.617206573486, 30, 3, 0, 0, 255, 255, 50, getLocalPlayer() ) marker7 = createMarker ( -2164.3779296875, -2389.533203125, 29.617206573486, "cylinder", 6, 0, 0, 255, 55, getLocalPlayer() ) colshape7 = createColSphere ( -2164.3779296875, -2389.533203125, 29.617206573486, 6 ) setElementData ( colshape7, "purpose", "copshop" ) end end addEventHandler("copdirections", getRootElement(), copshops) addEvent ( "onPlayerStartArrested", true ) function copshophit (theshape) if isElement(theshape) then if (getElementData(theshape, "purpose") == "copshop" ) then if ( getElementType( source ) == "player" ) then if ( getElementData ( source, "SAEGJobs:ArrestingOfficer" ) ) then local mx, my, mz = getElementPosition(theshape) triggerServerEvent ("saegpolice:onJailCopCrimals", getLocalPlayer (), source, mx, my, mz ) end end end end end addEventHandler ( "onClientElementColShapeHit", getRootElement(), copshophit) addEventHandler ( "onPlayerStartArrested", getRootElement(), copshophit) arrest server side : 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 ) triggerClientEvent( cop,"copdirections",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", false ) setElementData ( p, "SAEGJobs:ArrestingOfficer", nil ) arresties[p] = nil showCursor ( p, false ) removeEventHandler ( "onPlayerQuit", p, onPlayerAttmemptArrestAvoid ); end function onJailCopCriminals( mx, my, mz ) for v, _ in pairs ( arresties ) do if ( getElementData ( v, "SAEGJobs:ArrestingOfficer" ) == source ) then releasePlayer ( v ) local time = math.floor ( ( getElementData ( v, "WantedPoints" ) ) 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, mx, my, mz, source, "Police Arrest" ) updateJobColumn ( getAccountName ( getPlayerAccount ( source ) ), "Arrests", "AddOne" ) end end end addEvent ( "saegpolice:onJailCopCrimals", true ) addEventHandler ( "saegpolice:onJailCopCrimals", root, onJailCopCriminals ) Jail_ server side : 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, 33 ) 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, mx, my, mz, triggerClient ) local p = p or source setElementDimension ( p, 0 ) setElementInterior ( p, 0 ) setElementPosition ( p, mx, my, mz ) 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 ) jail_serverside .lua:54: Bad Argument @ 'setElementPosition' expected vector 3 at argument 2 , got nill It's not WSS leaked OMG guys i'm using Nerd gaming scripts and trying to developer them , Thx to who can help
  20. jail server side line 54 please help guys
×
×
  • Create New...