Jump to content

Best-Killer1

Members
  • Posts

    203
  • Joined

  • Last visited

Details

  • Gang
    SAEG:RPG

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Best-Killer1's Achievements

Chump

Chump (17/54)

3

Reputation

  1. ERROR: SAEGPolice\jail_s.lua:187: table index is nil code : local WARP_LOCS = { DEFAULT = { }, ADMIN = { }, RELEASE = { } } addEventHandler ( "onResourceStart", resourceRoot, function ( ) local warp_default = get ( "*JAIL_WARP_LOCATION" ); local warp_admin = get ( "*JAIL_WARP_ADMIN_LOCATION" ); local warp_release = get ( "*JAIL_WARP_RELEASE_LOCATION" ); if ( not warp_default ) then outputDebugString ( "Couldn't find '*JAIL_WARP_LOCATION' setting in SAEGPolice" ); WARP_LOCS.DEFAULT = { 0, 0, 0 } else local warp_default = split ( warp_default, "," ); if ( #warp_default ~= 3 ) then outputDebugString ( "'*JAIL_WARP_LOCATION' setting value should be x,y,z (no spaces, please confirm format is correct)" ); WARP_LOCS.DEFAULT = { 0, 0, 0 } elseif ( not tonumber ( warp_default[1] ) or not tonumber ( warp_default[2] ) or not tonumber ( warp_default[3] ) ) then outputDebugString ( "Failed to convert all '*JAIL_WARP_LOCATION' coordinates to floats. Please confirm they are numbers" ); WARP_LOCS.DEFAULT = { 0, 0, 0 } else WARP_LOCS.DEFAULT = { tonumber(warp_default[1]), tonumber(warp_default[2]), tonumber(warp_default[3]) }; end end if ( not warp_release ) then outputDebugString ( "Couldn't find '*JAIL_WARP_RELEASE_LOCATION' setting in SAEGPolice" ); WARP_LOCS.RELEASE = { 0, 0, 0 } else local warp_release = split ( warp_release, "," ); if ( #warp_release ~= 3 ) then outputDebugString ( "'*JAIL_WARP_RELEASE_LOCATION' setting value should be x,y,z (no spaces, please confirm format is correct)" ); WARP_LOCS.RELEASE = { 0, 0, 0 } elseif ( not tonumber ( warp_release[1] ) or not tonumber ( warp_release[2] ) or not tonumber ( warp_release[3] ) ) then outputDebugString ( "Failed to convert all '*JAIL_WARP_RELEASE_LOCATION' coordinates to floats. Please confirm they are numbers" ); WARP_LOCS.RELEASE = { 0, 0, 0 } else WARP_LOCS.RELEASE = { tonumber(warp_release[1]), tonumber(warp_release[2]), tonumber(warp_release[3]) }; end end if ( not warp_admin ) then outputDebugString ( "Couldn't find '*JAIL_WARP_ADMIN_LOCATION' setting in SAEGPolice" ); WARP_LOCS.ADMIN = { 0, 0, 0 } else local warp_admin = split ( warp_admin, "," ); if ( #warp_admin ~= 3 ) then outputDebugString ( "'*JAIL_WARP_ADMIN_LOCATION' setting value should be x,y,z (no spaces, please confirm format is correct)" ); WARP_LOCS.ADMIN = { 0, 0, 0 } elseif ( not tonumber ( warp_admin[1] ) or not tonumber ( warp_admin[2] ) or not tonumber ( warp_admin[3] ) ) then outputDebugString ( "Failed to convert all '*JAIL_WARP_ADMIN_LOCATION' coordinates to floats. Please confirm they are numbers" ); WARP_LOCS.ADMIN = { 0, 0, 0 } else WARP_LOCS.ADMIN = { tonumber(warp_admin[1]), tonumber(warp_admin[2]), tonumber(warp_admin[3]) }; end end outputDebugString ( "Default jail warp location: "..tostring ( table.concat( WARP_LOCS.DEFAULT, ", " ) ) ) outputDebugString ( "Admin jail warp location: "..tostring ( table.concat( WARP_LOCS.ADMIN, ", " ) ) ) outputDebugString ( "Release jail warp location: "..tostring ( table.concat( WARP_LOCS.RELEASE, ", " ) ) ) end ); local jailedPlayers = { } function isPlayerJailed ( p ) if ( p and getElementType ( p ) == 'player' ) then if ( jailedPlayers[p] ) then return tonumber ( getElementData ( p, 'SAEGPolice:JailTime' ) ) else return false end end return nil end function jailPlayer ( p, dur, announce, element, reason ) if( p and dur ) then local announce = announce or false jailedPlayers[p] = dur setElementInterior ( p, 0 ) setElementDimension ( p, 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, triggerClient ) local p = p or source setElementDimension ( p, 0 ) setElementInterior ( p, 0 ) setElementPosition ( p, 1543.32, -1675.6, 13.56 ) exports['SAEGMessages']:sendClientMessage ( "You've been released from jail! Behave next time.", p, 0, 255, 0 ) jailedPlayers[p] = nil setElementData ( p, "SAEGPolice:JailTime", nil ) setElementData ( p, "isGodmodeEnabled", nil ) exports['SAEGLogs']:outputActionLog ( getPlayerName ( p ).." has been unjailed" ) if ( triggerClient ) then triggerClientEvent ( p, 'SAEGJail:StopJailClientTimer', p ) end end addEvent ( "SAEGJail:UnjailPlayer", true ) addEventHandler ( "SAEGJail:UnjailPlayer", root, unjailPlayer ) function getJailedPlayers ( ) return jailedPlayers end addCommandHandler ( "jail", function ( p, _, p2, time, ... ) if ( exports['SAEGAdministration']:isPlayerStaff ( p ) ) then if ( p2 and time ) then local toJ = getPlayerFromName ( p2 ) or exports['NGPlayerFunctions']:getPlayerFromNamePart ( p2 ) if toJ then jailPlayer ( toJ, time, true, p, table.concat ( { ... }, " " ) ) else exports['SAEGMessages']:sendClientMessage ( "No player found with \""..p2.."\" in their name.", p, 255, 0, 0 ) end else exports['SAEGMessages']:sendClientMessage ( "Syntax: /jail [player name/part of name] [seconds] [reason]", p, 255, 255, 0 ) end end end ) addCommandHandler ( "unjail", function ( p, _, p2 ) if ( not exports['SAEGAdministration']:isPlayerStaff ( p ) ) then return false end if ( not p2 ) then return exports['SAEGMessages']:sendClientMessage ( "Syntax: /unjail [player]", p, 255, 255, 0 ) end if ( not getPlayerFromName ( p2 ) ) then p2 = exports['SAEGPlayerFunctions']:getPlayerFromNamePart ( p2 ) if not p2 then return exports['SAEGMessages']:sendClientMessage ( "That player doesn't exist on the server.", p, 255, 0, 0 ) end end if ( jailedPlayers[p2] ) then exports['SAEGMessages']:sendClientMessage ( "You've unjailed "..getPlayerName ( p2 ).."!", p, 0, 255, 0 ) exports['SAEGMessages']:sendClientMessage ( "You've been unjailed by "..getPlayerName ( p ).."!", p2, 0, 255, 0 ) unjailPlayer ( p2, true ) else exports['SAEGMessages']:sendClientMessage ( "That player isn't jailed.", p, 255, 0, 0 ) end end ) addEventHandler ( "onResourceStop", resourceRoot, function ( ) exports['NGSQL']:saveAllData ( false ) end ) addEventHandler ( "onResourceStart", resourceRoot, function ( ) setTimer ( function ( ) local q = exports['NGSQL']:db_query ( "SELECT * FROM accountdata" ) local data = { } for i, v in ipairs ( q ) do data[v['Username']] = v['JailTime'] end for i, v in pairs ( data ) do local p = exports['SAEGPlayerFunctions']:getPlayerFromAcocunt ( i ) if p then local t = tonumber ( getElementData ( p, 'SAEGPolice:JailTime' ) ) or i jailPlayer ( p, tonumber ( t ), false ) end end end, 500, 1 ) end ) addEvent ( "onPlayerArrested", true )
  2. already it's fixed thanks you for trying for help
  3. Radar Showing Before login and defult radar showing with the new radar any help pls ? this the code Menu = {} Menu.__index = Menu Menu.instances = {} function onClientResourceStart() Pages = {} Pages.MAPA = {} Pages.MAPA.map = Map.new(x*30,y*30,x*1306,y*708) Pages.MAPA.map:setColor(255,255,255,200) Pages.MAPA.radar = Map.new(x*20,y*563,x*318,y*185) Pages.MAPA.radar:setColor(255,255,255,200) Pages.MAPA.radar.style = 1 Pages.MAPA.radar.blipSize = x*20 Pages.MAPA.radar:setVisible(true) MapaSwitch = function() Pages.MAPA.map:setVisible(not Pages.MAPA.map.visible) Pages.MAPA.radar:setVisible(not Pages.MAPA.map.visible) showChat(not Pages.MAPA.map.visible) end if(not isKeyBound('F11', 'down', MapaSwitch)) then bindKey('F11', 'down', MapaSwitch) end setPlayerHudComponentVisible("radar",false) toggleControl("radar",false) end addEventHandler("onClientResourceStart",resourceRoot,onClientResourceStart) function onClientResourceStop() setPlayerHudComponentVisible("radar",true) toggleControl("radar",true) end addEventHandler("onClientResourceStop",resourceRoot,onClientResourceStop) function isKeyBound(key, keyState, handler) local handlers = getFunctionsBoundToKey(key) for k,v in pairs(handlers or {}) do if(v == handler) then return true end end return false end
  4. function poop () setElementData(source, "ttt", (getElementData(source, "ttt") or 0) + 1) setElementData(source, "ttt", (getElementData(source, "ttt") or 0) + 0) end addEventHandler("onPlayerMute", getRootElement(),poop) addEventHandler("onPlayerUnMute", getRootElement(),poop) try that i'm not sure about it work or no
  5. Hello i tried to make the gate open for staffs too but it's not work what is the problem ?? this code : --- GATE SYSTEM BY DARHAL --- miniDistance = 3 --RESOURCE SETTINGS --HERE CHANGE THE RESOURCE NAME TO THE GROUPS SYSTEM THAT YOU USE local GROUPS_RESOURCE_NAME = "SAEGGroups" -- CHANGE THAT LINE TO YOUR GROUP SYSTEM NAME function GPG(plr) if plr and getACC(plr) then return exports.SAEGGroups:getPlayerGroup ( plr) or exports.SAEGAdministration:isPlayerStaff ( plr) end end -- GATE MANAGERS LIST (ACCOUNT NAME) managers = { --[[YOU CAN ADD ANY ACCOUNT BY SIMPLY ADDING THIS LINE : "account name", To the list above--]] "oussama", "", } -- ALLOWED OBJECTS THAT MANAGERS CAN USE TO PLACE GATE allowedModels = { 980 , 967 , 16773 , 10829 , 10832, 2990 , 2933 , 971 , 9042 , 8957, 3089, 2955 , 2947 , 2924 , 2911 , 1491 , 1504 , 1505 , 1507 , 1523 , 1557 , 8378 , 10671 , 11313 , 10641 , 7910 , 10149, 16775, 2634, }
  6. i tried to make staff panel it's work fine but when i freez player i can't unfreez also jetpack too code : addEvent ("OnCheckButtonFreeze", true) addEventHandler ("OnCheckButtonFreeze", root, function ( thePlayer ) if ( isElementFrozen ( thePlayer ) ) then guiSetText(ButtonFreeze, "Freeze") guiSetText(ButtonFreezePlayer, "Unfreeze") else guiSetText(ButtonFreeze, "Unfreeze") guiSetText(ButtonFreezePlayer, "Freeze") end end) addEvent ("OnCheckButtonJetPack", true) addEventHandler ("OnCheckButtonJetPack", root, function ( thePlayer ) if ( doesPedHaveJetPack ( thePlayer ) ) then guiSetText(ButtonGiveJetPack, "GiveJetpack") guiSetText(GiveJetPackPlayer, "RemoveJetPack") else guiSetText(ButtonGiveJetPack, "RemoveJetPack") guiSetText(GiveJetPackPlayer, "GiveJetPack") end end)
  7. how i can change the speed ?? this code handlingChange22 = function(l_5_0, l_5_1) if getElementModel(l_5_0) == 411 and l_5_1 == 0 then setVehicleHandling(l_5_0, "maxVelocity", 10000) setVehicleHandling(l_5_0, "engineAcceleration", 500) setVehicleHandling(l_5_0, "tractionBias", 0.80) setVehicleHandling(l_5_0, "suspensionLowerLimit", -0.100) setVehicleHandling(l_5_0, "driveType", "awd") setVehicleHandling(l_5_0, "modelFlags", 9999122304) setVehicleHandling(l_5_0, "handlingFlags", 99992948352) end end example i wanna make the speed 500 any one can show me for learn ?
  8. Hey Guys i have 15 day i'm serching for that radar please who can give me it pls
  9. remove it fast pls it's not allowed
  10. Dude BVZ Login Panel ? ahaha
  11. dude bro dude i start learning LUA (MTA) 15 day ago and much people helped me like JR10/Karim/Rob .............. but they don't love people ask help for leaked script or about de-compiler not yours script ___________________________________________ Thanks to all people who helped me
  12. i fix it but now i can't deposit / withdraw money from the bank Code : local _settings = get(""); local settings = {}; for k, v in pairs(_settings) do k = split(k, ".")[2]; settings[k] = v; end if (settings.key:len() < 1 or settings.key:len() > 1) then settings.key = "N"; end if (not settings.blip or tonumber(settings.blip) == nil) then settings.blip = false; end addEventHandler("onResourceStart", resourceRoot, function() if (settings.database == "mysql") then local host, db, username, password, port, socket = unpack(settings.database_data); if not (host and db and username and password) then outputDebugString("Business: Failed to connect to the MySQL server - The data is invalid"); return; end if (tonumber(port)) then port = "port="..port..";"; else port = ""; end if (socket and socket ~= "") then socket = "socket="..socket..";"; else socket = ""; end database = Connection("mysql", "host="..host..";dbname="..db..";"..port..socket, username, password); if (not database) then outputDebugString("Business: Failed to connect to the MySQL server"); return; end else database = Connection("sqlite", "files/business.db"); if (not database) then outputDebugString("Business: Failed to connect to the SQLite file"); return; end end database:exec("CREATE TABLE IF NOT EXISTS business(id INT, name TEXT, owner TEXT, cost INT, pos TEXT, payout INT, payout_time INT, payout_otime INT, payout_unit TEXT, payout_cur_time INT, bank INT)"); database:query(dbCreateBusinessesCallback, "SELECT * FROM business"); end); function dbCreateBusinessesCallback(query_handle) local sql = query_handle:poll(0); if (sql and #sql > 0) then for index, row in ipairs(sql) do local pos = split(row["pos"], ","); local b_marker = Marker(pos[1], pos[2], pos[3], "cylinder", 1.5, settings.marker_color[1], settings.marker_color[2], settings.marker_color[3], settings.marker_color[4]); b_marker.interior = pos[4]; b_marker.dimension = pos[5]; if (settings.blip ~= false) then if (row["owner"] == "For Sale") then local b_blip = Blip.createAttachedTo(b_marker, settings.blip, 2, 255, 0, 0, 255, 0, 100.0); b_blip.interior = pos[4]; b_blip.dimension = pos[5]; else local b_blip = Blip.createAttachedTo(b_marker, settings.blip, 2, 255, 0, 0, 255, 0, 100.0); b_blip.interior = pos[4]; b_blip.dimension = pos[5]; end end addEventHandler("onMarkerHit", b_marker, onBusinessMarkerHit); addEventHandler("onMarkerLeave", b_marker, onBusinessMarkerLeave); local timer = Timer(businessPayout, row["payout_cur_time"] , 1, b_marker); b_marker:setData("b_data", {row["id"], row["name"], row["owner"], row["cost"], row["payout"], row["payout_time"], row["payout_otime"], row["payout_unit"], row["bank"], timer}); end end end addCommandHandler("business", function(player) if (ACL.hasObjectPermissionTo(player, "function.banPlayer")) then triggerClientEvent(player, "business.showCreateBusinessWindow", player); else player:outputMessage("Business: You don't have access to this command.", 255, 0, 0); end end); function Player:outputMessage(message, r, g, b) if (settings.info_messages_type == "dx") then dxOutputMessage(message, self, r, g, b); else self:outputChat(message, r, g, b, true); end end function outputMessage(message, player, r, g, b) if (settings.info_messages_type == "dx") then dxOutputMessage(message, player, r, g, b); else player:outputChat(message, r, g, b, true); end end function dxOutputMessage(message, player, r, g, b) triggerClientEvent(player, "business.dxOutputMessage", player, message, r, g, b); end addEvent("business.outputMessage", true); addEventHandler("business.outputMessage", root, function(message, r, g, b) source:outputMessage(message, r, g, b); end); addEvent("business.createBusiness", true); addEventHandler("business.createBusiness", root, function(x, y, z, interior, dimension, name, cost, payout, payout_time, payout_unit) database:query(dbCreateBusinessCallback, {client, x, y, z, interior, dimension, name, cost, payout, payout_time, payout_unit}, "SELECT * FROM business"); end); function dbCreateBusinessCallback(query_handle, client, x, y, z, interior, dimension, name, cost, payout, payout_time, payout_unit) local sql = query_handle:poll(0); if (sql) then local id; if (#sql > 0) then id = sql[#sql]["id"] + 1; else id = 1; end local unit; if (payout_unit == "Seconds") then unit = 1000; elseif (payout_unit == "Minutes") then unit = 60000; elseif (payout_unit == "Hours") then unit = 3600000; elseif (payout_unit == "Days") then unit = 86400000; end x = tonumber(x); y = tonumber(y); z = tonumber(z); interior = tonumber(interior); dimension = tonumber(dimension); cost = tonumber(cost); payout = tonumber(payout); payout_time = tonumber(payout_time); z = z - 1; database:exec("INSERT INTO business(id,name,owner,cost,pos,payout,payout_time,payout_otime,payout_unit,payout_cur_time,bank) VALUES(?,?,?,?,?,?,?,?,?,?,?)", id, name, "For Sale", cost, x..","..y..","..z..","..interior..","..dimension, payout, payout_time * unit, payout_time, payout_unit, payout_time * unit, 0); local b_marker = Marker(x, y, z, "cylinder", 1.5, settings.marker_color[1], settings.marker_color[2], settings.marker_color[3], settings.marker_color[4]); b_marker.interior = interior; b_marker.dimension = dimension; if (settings.blip ~= false) then local b_blip = Blip.createAttachedTo(b_marker, settings.blip, 2, 255, 0, 0, 255, 0, 100.0); b_blip.interior = interior; b_blip.dimension = dimension; end local timer = Timer(businessPayout, payout_time * unit , 1, b_marker); b_marker:setData("b_data", {id, name, "For Sale", cost, payout, payout_time * unit, payout_time, payout_unit, 0, timer}); addEventHandler("onMarkerHit", b_marker, onBusinessMarkerHit); addEventHandler("onMarkerLeave", b_marker, onBusinessMarkerLeave); if (#tostring(id) == 1) then id = "0".. tostring(id) end client:outputMessage("Business: Business(ID #"..id..") has been created successfully", 0, 255, 0); end end function onBusinessMarkerHit(hElement, mDim) if (hElement:getType() ~= "player") then return; end if (hElement:isInVehicle()) then return; end if (not mDim) then return; end triggerClientEvent(hElement, "business.showInstructions", hElement); end function onBusinessMarkerLeave(hElement, mDim) if (hElement:getType() ~= "player") then return; end if (hElement:isInVehicle()) then return; end if (not mDim) then return; end triggerClientEvent(hElement, "business.hideInstructions", hElement); end function businessPayout(b_marker) local b_data = b_marker:getData("b_data"); local id, name, owner, cost, payout, payout_time, payout_otime, payout_unit, bank, timer = unpack(b_data); if (owner ~= "For Sale") then bank = bank + payout; database:exec("UPDATE business SET bank = ? WHERE id = ?", bank, id); if (settings.inform_player_of_payout) then local account = Account(owner); if (account) then local player = account:getPlayer(); if (player and player.isElement) then player:outputMessage("Business: Business \" "..name.." \" has paid out($"..payout..")", 0, 255, 0); end end end end timer = Timer(businessPayout, payout_time, 1, b_marker); b_marker:setData("b_data", {id, name, owner, cost, payout, payout_time, payout_otime, payout_unit, bank, timer}); end addEventHandler("onResourceStop", resourceRoot, function() for index, b_marker in ipairs(Element.getAllByType("marker", resourceRoot)) do local b_data = b_marker:getData("b_data"); local id, name, owner, cost, payout, payout_time, payout_otime, payout_unit, bank, timer = unpack(b_data); if (timer and timer:isValid()) then local left = timer:getDetails(); if (left >= 50) then database:exec("UPDATE business SET payout_cur_time = ? WHERE id = ?", left, id); else database:exec("UPDATE business SET payout_cur_time = ? WHERE id = ?", payout_time, id); end end end end); function Ped:isInMarker(marker) local colshape = marker.colShape; return self:isWithinColShape(colshape); end addEventHandler("onResourceStart", resourceRoot, function() for index, player in ipairs(Element.getAllByType("player")) do bindKey(player, settings.key, "up", onPlayerAttemptToOpenBusiness); end end); addEventHandler("onPlayerJoin", root,function() bindKey(source, settings.key, "up", onPlayerAttemptToOpenBusiness); end); function onPlayerAttemptToOpenBusiness(player) for index, b_marker in ipairs(Element.getAllByType("marker", resourceRoot)) do if (player:isInMarker(b_marker)) then local b_data = b_marker:getData("b_data"); local id, name, owner, cost, payout, payout_time, payout_otime, payout_unit, bank, timer = unpack(b_data); triggerClientEvent(player, "business.showBusinessWindow", player, b_marker, getAccountName(getPlayerAccount(player)) == Owner, ACL.hasObjectPermissionTo(player, "function.showbus")); break; end end end function Ped:getMarker() for index, b_marker in ipairs(Element.getAllByType("marker", resourceRoot)) do if (self:isInMarker(b_marker)) then return b_marker; end end end addEvent("business.buy", true); addEventHandler("business.buy", root, function() local account = client.account; if (not account or account:isGuest()) then return; end local b_marker = client:getMarker(); if (not isElement(b_marker)) then return; end local b_data = b_marker:getData("b_data"); local id, name, owner, cost, payout, payout_time, payout_otime, payout_unit, bank, timer = unpack(b_data); if (owner ~= "For Sale") then client:outputMessage("Business: This business is owned", 255, 0, 0); return; end database:query(dbBuyBusinessCallback, {client, b_marker, id, name, owner, cost, payout, payout_time, payout_otime, payout_unit, bank, timer}, "SELECT * FROM business WHERE owner = ?", account.name); end); addEvent("business.sell", true); addEventHandler("business.sell", root, function() local account = client.account; if (not account or account:isGuest()) then return; end local b_marker = client:getMarker(); if (not isElement(b_marker)) then return; end local b_data = b_marker:getData("b_data");
×
×
  • Create New...