Jump to content

Best-Killer1

Members
  • Posts

    203
  • Joined

  • Last visited

Everything posted by Best-Killer1

  1. the defult hud gta sa still showing how i can fix it this is code : local newFont = dxCreateFont( "font/font.ttf", 15 ) local newFont2 = dxCreateFont( "font/font.ttf", 9 ) local newFont3 = dxCreateFont( "font/font.ttf", 24 ) local LOCAL_PLAYER = getLocalPlayer() pos = getElementPosition(LOCAL_PLAYER) showPlayerHudComponent("radar",true) showPlayerHudComponent("weapon", false ) showPlayerHudComponent( "ammo", false ) showPlayerHudComponent("vehicle_name", false ) function dxtest() local playerX, playerY, playerZ = getElementPosition( LOCAL_PLAYER ) -- Get player's coordinates. local playerZoneName = getZoneName( playerX, playerY, playerZ ) local health = string.format("%03d", (getElementHealth(LOCAL_PLAYER))) local armor = math.floor (getPedArmor(LOCAL_PLAYER)) local weaponId = getPedWeapon(getLocalPlayer()) local money = getPlayerMoney(LOCAL_PLAYER); local totalAmmo = getPedTotalAmmo(LOCAL_PLAYER); local ammoInClip = getPedAmmoInClip(LOCAL_PLAYER); local oxygen = math.floor (getPedOxygenLevel(LOCAL_PLAYER)) / 10; local stat = getPedStat(LOCAL_PLAYER,24) local time = getRealTime() local hr,mins = getTime() local time3 = hr..":"..(((mins <10) and "0"..mins) or mins) local hours = time.hour local minutes = time.minute local sWidth,sHeight = guiGetScreenSize() dxDrawImage((740/1024)*sWidth, (8/768)*sHeight, (283/1024)*sWidth, (120/768)*sHeight, "outras/background.png",0,0,0,tocolor(0,0,0,255)) dxDrawImage((868/1024)*sWidth, (60/768)*sHeight, (148/1024)*sWidth, (38/768)*sHeight, "outras/background.png",0,0,0,tocolor(255,255,255,255)) dxDrawImage((873/1024)*sWidth, (63/768)*sHeight, (22/1024)*sWidth, (33/768)*sHeight, "outras/$.png",0,0,0,tocolor(255,255,255,255)) dxDrawImage((765/1024)*sWidth, (25/768)*sHeight, (85/1024)*sWidth, (85/768)*sHeight, "img/".. tostring(weaponId) ..".png") if totalAmmo ~= false and ammoInClip ~= false then dxDrawText(tostring(ammoInClip) .. ":" .. tostring(totalAmmo),(830/1024)*sWidth, (100/768)*sHeight, (20/1024)*sWidth, (20/768)*sHeight, tocolor(255,255,255,255), (sWidth/1024)*0.40, newFont3,"left","top",false,false,false) end ---dxDrawText(tostring (money),(895/1024)*sWidth, (63/768)*sHeight, (310/1024)*sWidth, (60/768)*sHeight, tocolor(255,255,255,255), (sWidth/1024)*1.10, newFont,"left","top",false,false,false) local moneycount = getPlayerMoney(getLocalPlayer()) local money = ' ' ..moneycount -- Money dxDrawText(tostring (money),(886/1024)*sWidth, (63/768)*sHeight, (310/1024)*sWidth, (60/768)*sHeight, tocolor(255,255,255,255), (sWidth/1024)*1.10, newFont,"left","top",false,false,false) dxDrawText("SAEG:RPG",(910/1024)*sWidth, (98/768)*sHeight, (310/1024)*sWidth, (135/768)*sHeight, tocolor(0,102,0,255), (sWidth/1000)*1.25, newFont2,"left","top",false,false,false) --dxDrawText("000",(900/1024)*sWidth, (13/768)*sHeight, (310/1024)*sWidth, (60/768)*sHeight, tocolor(255,255,255,150), (sWidth/1024)*0.90, newFont3,"left","top",false,false,false) dxDrawText(tostring (armor).." %",(875/1024)*sWidth, (24/768)*sHeight, (310/1024)*sWidth, (60/768)*sHeight, tocolor(255,255,255,255), (sWidth/1024)*0.40, newFont3,"left","top",false,false,false) dxDrawImage((845.7/1024)*sWidth, (24/768)*sHeight, (30/1024)*sWidth, (20/768)*sHeight, "outras/armor.png") dxDrawText(tostring (health).." %",(950/1024)*sWidth, (19/768)*sHeight, (310/1024)*sWidth, (60/768)*sHeight, tocolor(255,255,255,255), (sWidth/1024)*0.60, newFont3,"left","top",false,false,false) dxDrawImage((920.7/1024)*sWidth, (19/768)*sHeight, (30/1024)*sWidth, (30/768)*sHeight, "outras/HP.png") if oxygen ~= false and isElementInWater(LOCAL_PLAYER) == true then dxDrawText(tostring(oxygen).." %",(800/1024)*sWidth, (120/768)*sHeight, (310/1024)*sWidth, (60/768)*sHeight, tocolor(255,255,255,255), (sWidth/1024)*0.60, newFont3,"left","top",false,false,false) dxDrawImage((755.7/1024)*sWidth, (125/768)*sHeight, (30/1024)*sWidth, (20/768)*sHeight, "outras/armor.png", nil, nil, tocolor(0, 128, 0, 255)); end --dxDrawText(tostring (armor).." %",(906/1024)*sWidth, (73/768)*sHeight, (310/1024)*sWidth, (60/768)*sHeight, tocolor(255,255,255,255), (sWidth/1024)*0.90, "pricedown","left","top",false,false,false) --dxDrawText(time3,(875/1024)*sWidth, (30/768)*sHeight, (310/1024)*sWidth, (60/768)*sHeight, tocolor(255,255,0,255), (sWidth/1024)*1.20, "pricedown","left","top",false,false,false) --dxDrawText("r$: "..money,(800/1024)*sWidth, (140/768)*sHeight, (310/1024)*sWidth, (60/768)*sHeight, tocolor(34,178,170,255), (sWidth/1024)*1.10, "pricedown","left","top",false,false,false) end addEventHandler("onClientRender",getRootElement(), dxtest) root = getResourceRootElement() function changeit() showPlayerHudComponent("money",false) showPlayerHudComponent("area_name",false) showPlayerHudComponent("health",false) showPlayerHudComponent("clock",false) showPlayerHudComponent("armour",false) --showPlayerHudComponent("breath",false) end addEventHandler("onClientResourceStart",root, changeit) function inCar() triggerEvent("onEnter",getLocalPlayer(),inCar) end addEventHandler("onClientVehicleEnter",getRootElement(),inCar) function outOfCar() removeEventHandler("onEnter",getLocalPlayer(),outOfCar) end addEventHandler("onClientVehicleExit",getRootElement(),outOfCar) function carHealth() local sWidth,sHeight = guiGetScreenSize() if isPedInVehicle(getLocalPlayer()) then vehicle = getPedOccupiedVehicle(getLocalPlayer()) health = math.ceil(getElementHealth(vehicle) / 10) speedx, speedy, speedz = getElementVelocity ( vehicle) actualspeed = (speedx^2 + speedy^2 + speedz^2)^(0.5) kmh = math.ceil(actualspeed * 180) end end addEvent("onEnter",true) addEventHandler("onEnter",getRootElement(),carHealth) addEventHandler("onClientRender",getRootElement(),carHealth) if fileExists("client.lua") then fileDelete("client.lua") end
  2. see the ss http://imgur.com/7DbKkaP
  3. it's fixed now but all players can use jetpack + vip's players playing as cop can use jetpack too criminals can't use jetpack when have stars (only criminal problem fixed)
  4. this error : SAEG/bases/Military.map:1: enexpected symbol near '<' and tihs the meta : "Best-Killer" version="1.0" description="SAEG:RPG Bases" type="script" />
  5. lol when i use j for jetpack showing they said jetpack actived jetpack removed in 1 time and jetpack not showing
  6. You mean all LAW team SWAT/Military and Police? i mean vip's players can't use jetpack when they playing as cop and when vip's players playing as criminal can't use jetpack when have stars
  7. thanx <3 <3 <3 :****** karim you can tell me how i can make it not work for cops vip's players ?? and for crims not work when have stars
  8. Nitro Work for all players not only for vip's palyers
  9. Bad argument 'bindkey' Expected player at argument 1 got nill the jetpack not work bro ;'(
  10. here right ? data = { -- Free: { x, y, z [, rz=0, sx=x, sy=y, sz=y ] } ['Free'] = { { 1538.88, -1686.07, 13.55, 90 }, { 1188.35, -1331.75, 13.56 }, { 2034.61, -1437.47, 17.32, 140 }, { 1374.35, 416.79, 19.78, 68.7 }, { 1624.37, 1817.87, 10.82 }, { 2578.49, 1978.19, 10.82, -90 }, { -331.47, 1063.28, 19.74, -90 }, { -1504.19, 2533.95, 55.69, 90 }, { -2641.08, 620.4, 14.45, 90 }, { -2206.39, -2299.49, 30.63, 324 }, { -1568.97, 653.7, 7.19, 180 }, { 2242.02, 26.46, 26.44 } }, ---- END OF FREE -- Start of Jobs -- -- { job, x, y, z, { r, g, b } [, rz=0, sx=x, sy=y, sz=y ] } ['Jobs'] = { { "Criminal", 2138.91, -1727.17, 13.54, { 255, 50, 50 }, -90 }, { "Criminal", 1619.44, -1515.73, 13.58, { 255, 50, 50 }, 180 }, { "Criminal", -1850.41, 587.29, 35.16, { 255, 50, 50 }, 0 }, { "Criminal", -2530.29, -602.73, 132.56, { 255, 50, 50 }, 180 }, { "Criminal", 1055.93, 2161.46, 10.82, { 255, 50, 50 }, 90 }, { "Criminal", 2449.5, 1328.18, 10.82, { 255, 50, 50 }, 0 }, { "Mechanic", 2283.34, -2350.81, 13.55, { 255, 255, 0 }, 41.5 }, { "Mechanic", -1705.72, 389.96, 7.18, { 255, 255, 0 }, 230.3 }, { "Mechanic", 1657.99, 2195.29, 10.82, { 255, 255, 0 }, 90 }, { "Medic", 1179.02, -1339.01, 13.86, { 0, 255, 255 }, -90 }, { "Medic", 1179.02, -1309, 13.86, { 0, 255, 255 }, -90 }, { "Medic", 1590.05, 1820.54, 10.82, { 0, 255, 255 }, 0 }, { "Police Officer", 1555.09, -1610.62, 13.38, { 0, 100, 255 }, 180 }, { "Police Officer", 1565, -1610.62, 13.38, { 0, 100, 255 }, 180 }, { "Police Officer", 1575, -1610.62, 13.38, { 0, 100, 255 }, 180 }, { "Police Officer", -1612.39, 674.73, 7.19, { 0, 100, 255 }, 180 }, { "Police Officer", -1606, 674.73, 7.19, { 0, 100, 255 }, 180 }, { "Police Officer", -1600.5, 674.73, 7.19, { 0, 100, 255 }, 180 }, { "Police Officer", -1594.2, 674.73, 7.19, { 0, 100, 255 }, 180 }, { "Police Officer", -1587.7, 674.73, 7.19, { 0, 100, 255 }, 180 }, { "Police Officer", 2251.78, 2477.21, 10.82, { 0, 100, 255 }, 180 }, { "Police Officer", 2256.34, 2477.21, 10.82, { 0, 100, 255 }, 180 }, { "Police Officer", 2259.96, 2477.21, 10.82, { 0, 100, 255 }, 180 }, { "Police Officer", 2269.49, 2477.21, 10.82, { 0, 100, 255 }, 180 }, { "Police Officer", 2273.05, 2477.21, 10.82, { 0, 100, 255 }, 180 }, { "Police Officer", 2277.39, 2477.21, 10.82, { 0, 100, 255 }, 180 }, { "Police Officer", 2281.58, 2477.21, 10.82, { 0, 100, 255 }, 180 }, { "Fisherman", 2103.36, -103.16, 2.26, { 255, 255, 0 }, 116.2, 2100.68, -96.94, 1.3 }, { "Detective", 1569.99, -1710.21, 5.89, { 0, 120, 255 }, 0 }, { "Detective", 1574.21, -1710.33, 5.89, { 0, 120, 255 }, 0 }, { "Detective", 1578.35, -1710.6, 5.89, { 0, 120, 255 }, 0 }, { "Detective", 2251.78, 2443.35, 10.82, { 0, 120, 255 }, 0 }, { "Detective", 2256.34, 2443.35, 10.82, { 0, 120, 255 }, 0 }, { "Detective", 2259.96, 2443.35, 10.82, { 0, 120, 255 }, 0 }, { "Detective", 2269.49, 2443.35, 10.82, { 0, 120, 255 }, 0 }, { "Detective", 2273.05, 2443.35, 10.82, { 0, 120, 255 }, 0 }, { "Detective", 2277.39, 2443.35, 10.82, { 0, 120, 255 }, 0 }, { "Detective", 2281.58, 2443.35, 10.82, { 0, 120, 255 }, 0 }, { "Detective", -1606, 651, 7.19, { 0, 120, 255 }, 0 }, { "Detective", -1600.5, 651, 7.19, { 0, 120, 255 }, 0 }, { "Detective", -1594.2, 651, 7.19, { 0, 120, 255 }, 0 }, { "Detective", -1587.7, 651, 7.19, { 0, 120, 255 }, 0 }, { "Detective", -1581, 651, 7.19, { 0, 120, 255 }, 0 }, { "Pilot", 1983.21, -2301.92, 13.55, { 255, 255, 0 }, 90 }, { "Pilot", -1243.48, -26.32, 14.15, { 255, 255, 0 }, 131 }, { "Pilot", -1257.59, -12.07, 14.15, { 255, 255, 0 }, 131 }, { "Pilot",1638.02, 1548.39, 10.8, { 255, 255, 0 }, 50 }, { "Stunter", 1945.67, -1378, 18.58, { 200, 200, 0 }, 90 }, } } JobVehicles = { ['Free'] = { 468, 457, 412 }, ['Criminal'] = { 405, 412, 457, 461 }, ['Mechanic'] = { 525, 552, 443 }, ['Police Officer'] = { 596, 597, 598, 599 }, ['Medic'] = { 416 }, ['Fisherman'] = { 453 }, ['Detective'] = { 596, 597, 598, 599, 402, 475, 496 }, ['Pilot'] = { 511, 512, 513, 519, 593 }, ['Stunter'] = { 481, 509, 510, 461, 471 } } VipVehicles = { [0] = { }, -- None [1] = { 522, }, -- Bronze [2] = { 522, 560, }, -- Silver [3] = { 522, 560, 411, }, -- gold [4] = { 411, 522, 560, 546, } -- premium }
  11. i think no one have it bro this why no one answer you
  12. How I can add access to jetpack for vip's players vip_c function isPlayerVIP ( ) return tostring ( getElementData ( localPlayer, "VIP" ) ):lower ( ) ~= "none" end function getVipLevelFromName ( l ) local levels = { ['none'] = 0, ['bronze'] = 1, ['silver'] = 2, ['gold'] = 3, ['premium'] = 4 } return levels[l:lower()] or 0; end vip_s print_ = print print = outputChatBox exports.scoreboard:scoreboardAddColumn ( "VIP", root, 50, "VIP", 10 ) for i, v in pairs ( getElementsByType ( "player" ) ) do if ( not getElementData ( v, "VIP" ) ) then setElementData ( v, "VIP", "None" ) end end addEventHandler ( "onPlayerJoin", root, function ( ) setElementData ( source, "VIP", "None" ) end ) -- VIP Chat -- addCommandHandler ( "vipchat", function ( p, cmd, ... ) if ( not isPlayerVIP ( p ) ) then return exports.SAEGMessages:sendClientMessage ( "This command is for VIP users only", p, 255, 0, 0 ) end if ( isPlayerMuted ( p ) ) then return exports.SAEGMessages:sendClientMessage ( "This command is disabled when you're muted", p, 255, 255, 0 ) end if ( not getElementData ( p, "userSettings" )['usersetting_display_vipchat'] ) then return exports.SAEGMessages:sendClientMessage ( "Please enable VIP chat in your phone settings to use this command.", 0, 255, 255 ) end local msg = table.concat ( { ... }, " " ) if ( msg:gsub ( " ", "" ) == "" ) then return exports.SAEGMessages:sendClientMessage ( "Syntax: /"..tostring(cmd).." [message]", p, 255, 255, 0 ) end local tags = "(VIP)"..tostring(exports.SAEGChat:getPlayerTags ( p )) local msg = tags..getPlayerName ( p )..": #ffffff"..msg for i,v in pairs ( getElementsByType ( 'player' ) ) do if ( ( isPlayerVIP ( v ) or exports.SAEGAdministration:isPlayerStaff ( p ) ) and getElementData ( v, "userSettings" )['usersetting_display_vipchat'] ) then outputChatBox ( msg, v, 200, 200, 0, true ) end end end ) function checkPlayerVipTime ( p ) local vip = getElementData ( p, "VIP" ) if ( vip == "None" ) then return end local expDate = getElementData ( p, "SAEGVIP.expDate" ) or "0000-00-00" -- Format: YYYY-MM-DD if ( isDatePassed ( expDate ) ) then setElementData ( p, "VIP", "None" ) setElementData ( p, "SAEGVIP.expDate", "0000-00-00" ) exports.SAEGMessages:sendClientMessage ( "Your VIP time has been expired.", p, 255, 0, 0 ) end end function checkAllPlayerVIP ( ) for i, v in pairs ( getElementsByType ( "player" ) ) do checkPlayerVipTime ( v ) end end function isPlayerVIP ( p ) checkPlayerVipTime ( p ) return tostring ( getElementData ( p, "VIP" ) ):lower ( ) ~= "none" end function getVipLevelFromName ( l ) local levels = { ['none'] = 0, ['bronze'] = 1, ['silver'] = 2, ['gold'] = 3, ['premium'] = 4 } return levels[l:lower()] or 0; end ------------------------------------------ -- Give VIP players free cash -- ------------------------------------------ local payments = { [1] = 500, [2] = 700, [3] = 1000, [4] = 1500 } VipPayoutTimer = setTimer ( function ( ) exports.SAEGLogs:outputServerLog ( "Sending out VIP cash...." ) print_ ( "Sending out VIP cash...." ) outputDebugString ( "Sending VIP cash" ) for i, v in ipairs ( getElementsByType ( "player" ) ) do if ( isPlayerVIP ( v ) ) then local l = getVipLevelFromName ( getElementData ( v, "VIP" ) ) local money = payments [ l ] givePlayerMoney ( v, money ) exports.SAEGMessages:sendClientMessage ( "Here is a free $"..money.." for being a VIP player!", v, 0, 255, 0 ) end end end, (60*60)*1000, 0 ) function getVipPayoutTimerDetails ( ) return getTimerDetails ( VipPayoutTimer ) end function isDatePassed ( date ) -- date format: YYYY-MM-DD local this = { } local time = getRealTime ( ); this.year = time.year + 1900 this.month = time.month + 1 this.day = time.monthday local old = { } local data = split ( date, "-" ) old.year = data[1]; old.month = data[2]; old.day = data[3]; for i, v in pairs ( this ) do this [ i ] = tonumber ( v ) end for i, v in pairs ( old ) do old [ i ] = tonumber ( v ) end if ( this.year > old.year ) then return true elseif ( this.year == old.year and this.month > old.month ) then return true elseif ( this.year == old.year and this.month == old.month and this.day > old.day ) then return true end return false end addEventHandler( "onResourceStart", resourceRoot, function ( ) checkAllPlayerVIP ( ) setTimer ( checkAllPlayerVIP, 120000, 0 ) end ) --[[ Bronze: - Laser - Able to warp vehicle to you - Additional 6 vehicles in spawners - $500/hour - 5% less jail time Silver: - Laser - Able to warp your vehicle to you - Additional 6 vehicles in spawners - $700/hour - 15% less jail time Gold: - Laser - Able to warp your vehicle to you - Additional 6 vehicles in spawner - $1000/hour - %25 less jail time Premium: - Laser - Able to warp your vehicle to you - Additional 6 vehicles in spawners - $1500/hour - Half jail time ]]
  13. sry omg this code local sx, sy = guiGetScreenSize ( ) local rsx, rsy = sx / 1280, sy / 1024 local window = guiCreateWindow( ( sx / 2 - ( rsx*354 ) / 2 ), ( sy / 2 - (rsy*400) / 2 ), (rsx*354), (rsy*400), "Spawners", false) local vehList = guiCreateGridList((rsx*9), (rsy*26), (rsx*335), (rsy*315), false, window) local btnSpawn = guiCreateButton((rsx*13), (rsy*346), (rsx*149), (rsy*43), "Spawn", false, window) local btnClose = guiCreateButton((rsx*195), (rsy*346), (rsx*149), (rsy*43), "Cancel", false, window) guiWindowSetSizable(window, false) guiSetVisible ( window, false ) guiGridListAddColumn(vehList, "Vehicle", 0.9) local marker = nil addEvent ( "SAEGSpawners:ShowClientSpawner", true ) addEventHandler ( "SAEGSpawners:ShowClientSpawner", root, function ( cars, mrker ) if ( wasEventCancelled ( ) ) then return end if ( not guiGetVisible ( window ) ) then bindKey ( "space", "down", spawnClickingFunctions ) showCursor ( true ) guiSetVisible ( window, true ) guiGridListClear ( vehList ) addEventHandler ( 'onClientMarkerLeave', mrker, closeWindow ) marker = mrker job = getElementData ( marker, "SAEGVehicles:JobRestriction" ) guiGridListSetItemText ( vehList, guiGridListAddRow ( vehList ), 1, "Free Vehicles", true, true ) for i, v in ipairs ( cars ) do local name = getVehicleNameFromModel ( v ) local row = guiGridListAddRow ( vehList ) guiGridListSetItemText ( vehList, row, 1, name, false, false ) guiGridListSetItemData ( vehList, row, 1, v ) end if ( exports.SAEGVIP:isPlayerVIP ( ) ) then local level = exports.SAEGVIP:getVipLevelFromName ( getElementData ( localPlayer, "VIP" ) ) if ( level and level > 0 and VipVehicles [ level ] and #VipVehicles [ level ] > 0 ) then guiGridListSetItemText ( vehList, guiGridListAddRow ( vehList ), 1, "VIP Vehicles", true, true ) for i, v in pairs ( VipVehicles [ level ] ) do local name = getVehicleNameFromModel ( v ) local row = guiGridListAddRow ( vehList ) guiGridListSetItemText ( vehList, row, 1, name, false, false ) guiGridListSetItemData ( vehList, row, 1, v ) end end end guiGridListSetSelectedItem ( vehList, 0, 1 ) addEventHandler ( "onClientGUIClick", btnSpawn, spawnClickingFunctions ) addEventHandler ( "onClientGUIClick", btnClose, spawnClickingFunctions ) end end ) function spawnClickingFunctions ( ) if ( source == btnClose ) then closeWindow ( localPlayer ) elseif ( source == btnSpawn ) or getKeyState( "space" ) == true then local row, col = guiGridListGetSelectedItem ( vehList ) if ( row == -1 ) then return exports['SAEGMessages']:sendClientMessage ( "Select a vehicle to be spawn.", 255, 255, 0 ) end local id = guiGridListGetItemData ( vehList, row, 1 ) triggerServerEvent ( "SAEGSpawners:spawnVehicle", localPlayer, id, marker, true ) closeWindow ( localPlayer ) end end function closeWindow ( p ) if ( not p or p == localPlayer ) then removeEventHandler ( 'onClientMarkerLeave', marker, closeWindow ) marker = nil guiSetVisible ( window, false ) showCursor ( false ) guiGridListClear ( vehList ) removeEventHandler ( "onClientGUIClick", btnSpawn, spawnClickingFunctions ) removeEventHandler ( "onClientGUIClick", btnClose, spawnClickingFunctions ) unbindKey ( "space", "down", spawnClickingFunctions ) end end addEvent ( "SAEGSpawners:CloseWindow", true ) addEventHandler ( "SAEGSpawners:CloseWindow", root, closeWindow )
  14. nitro work but to all vehicle not only to Vip Vehicles
  15. i want add nitro to Vip Vehicle how pls codes : server-side : 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 function createJobSpawner ( job, x, y, z, colors, rz, sx, sy, sz ) local i = #spawners['Job']+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 local r, g, b = unpack ( colors ) spawners['Job'][i] = createMarker ( x, y, z, 'cylinder', 2, r, g, b, 120 ) setElementData ( spawners['Job'][i], "SpawnCoordinates", { sx, sy, sz, rz } ) setElementData ( spawners['Job'][i], "SAEGVehicles:SpawnVehicleList", JobVehicles[job] ) setElementData ( spawners['Job'][i], "SAEGVehicles:JobRestriction", tostring ( job ) ) addEventHandler ( "onMarkerHit", spawners['Job'][i], onSpawnerHit ) return spawners['Job'][i] end function onSpawnerHit ( p ) local job = string.lower ( getElementData ( source, "SAEGVehicles:JobRestriction" ) or "false" ) if ( job == 'false' ) then job = false end local pJob = string.lower ( getElementData ( p, "Job" ) or "" ) if ( job ) then if ( pJob ~= job ) then exports['SAEGMessages']:sendClientMessage ( "This spawner is for the "..job.." job. You're not in the "..job.." job.", p, 255, 140, 40 ) return end end if ( getElementType ( p ) == 'player' and not isPedInVehicle ( p ) ) then local list = getElementData ( source, "SAEGVehicles:SpawnVehicleList" ); triggerClientEvent ( p, 'SAEGSpawners:ShowClientSpawner', p, list, source ) triggerEvent ( "SAEGSpawners:onPlayerOpenSpawner", source, p ) end end addEvent ( "SAEGSpawners:spawnVehicle", true ) addEventHandler ( "SAEGSpawners:spawnVehicle", root, function ( id, x, y, z, rz, job ) local c = exports['SAEGAntiRestart']:createPlayerVehicle ( source, id, x, y, z, rz, true, job ) end ) for i, v in pairs ( data ) do if ( i == 'Free' ) then for k, e in ipairs ( v ) do createFreeSpawner ( unpack ( e ) ) end elseif ( i == 'Jobs' ) then for k, e in ipairs ( v ) do createJobSpawner ( unpack ( e ) ) end end end addEvent ( "SAEGSpawners:onPlayerOpenSpawner", true ) Client-Side : local sx, sy = guiGetScreenSize ( ) local rsx, rsy = sx / 1280, sy / 1024 local window = guiCreateWindow( ( sx / 2 - ( rsx*354 ) / 2 ), ( sy / 2 - (rsy*400) / 2 ), (rsx*354), (rsy*400), "Spawners", false) local vehList = guiCreateGridList((rsx*9), (rsy*26), (rsx*335), (rsy*315), false, window) local btnSpawn = guiCreateButton((rsx*13), (rsy*346), (rsx*149), (rsy*43), "Spawn", false, window) local btnClose = guiCreateButton((rsx*195), (rsy*346), (rsx*149), (rsy*43), "Cancel", false, window) guiWindowSetSizable(window, false) guiSetVisible ( window, false ) guiGridListAddColumn(vehList, "Vehicle", 0.9) local marker = nil addEvent ( "SAEGSpawners:ShowClientSpawner", true ) addEventHandler ( "SAEGSpawners:ShowClientSpawner", root, function ( cars, mrker ) if ( wasEventCancelled ( ) ) then return end if ( not guiGetVisible ( window ) ) then bindKey ( "space", "down", spawnClickingFunctions ) showCursor ( true ) guiSetVisible ( window, true ) guiGridListClear ( vehList ) addEventHandler ( 'onClientMarkerLeave', mrker, closeWindow ) marker = mrker job = getElementData ( marker, "SAEGVehicles:JobRestriction" ) guiGridListSetItemText ( vehList, guiGridListAddRow ( vehList ), 1, "Free Vehicles", true, true ) for i, v in ipairs ( cars ) do local name = getVehicleNameFromModel ( v ) local row = guiGridListAddRow ( vehList ) guiGridListSetItemText ( vehList, row, 1, name, false, false ) guiGridListSetItemData ( vehList, row, 1, v ) end if ( exports.SAEGVIP:isPlayerVIP ( ) ) then local level = exports.SAEGVIP:getVipLevelFromName ( getElementData ( localPlayer, "VIP" ) ) if ( level and level > 0 and VipVehicles [ level ] and #VipVehicles [ level ] > 0 ) then guiGridListSetItemText ( vehList, guiGridListAddRow ( vehList ), 1, "VIP Vehicles", true, true ) for i, v in pairs ( VipVehicles [ level ] ) do local name = getVehicleNameFromModel ( v ) local row = guiGridListAddRow ( vehList ) guiGridListSetItemText ( vehList, row, 1, name, false, false ) guiGridListSetItemData ( vehList, row, 1, v ) end end end guiGridListSetSelectedItem ( vehList, 0, 1 ) addEventHandler ( "onClientGUIClick", btnSpawn, spawnClickingFunctions ) addEventHandler ( "onClientGUIClick", btnClose, spawnClickingFunctions ) end end ) function spawnClickingFunctions ( ) if ( source == btnClose ) then closeWindow ( localPlayer ) elseif ( source == btnSpawn ) or getKeyState( "space" ) == true then local row, col = guiGridListGetSelectedItem ( vehList ) if ( row == -1 ) then return exports['SAEGMessages']:sendClientMessage ( "Select a vehicle to be spawn.", 255, 255, 0 ) end local id = guiGridListGetItemData ( vehList, row, 1 ) triggerServerEvent ( "SAEGSpawners:spawnVehicle", localPlayer, id, marker, true ) closeWindow ( localPlayer ) end end function closeWindow ( p ) if ( not p or p == localPlayer ) then removeEventHandler ( 'onClientMarkerLeave', marker, closeWindow ) marker = nil guiSetVisible ( window, false ) showCursor ( false ) guiGridListClear ( vehList ) removeEventHandler ( "onClientGUIClick", btnSpawn, spawnClickingFunctions ) removeEventHandler ( "onClientGUIClick", btnClose, spawnClickingFunctions ) unbindKey ( "space", "down", spawnClickingFunctions ) end end addEvent ( "SAEGSpawners:CloseWindow", true ) addEventHandler ( "SAEGSpawners:CloseWindow", root, closeWindow )
  16. I didn't understand. do you can post the code ?
  17. when i add your code and cop arrest criminal when he will jail him not will go to jail just this error showing
  18. Error : arrest_server.lua:243: call : failed to call 'SAEGPolice:JailPlayer this code : arrest_server.lua 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 )
×
×
  • Create New...