Guest User

Untitled

a guest
Mar 14th, 2023
485
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 16.10 KB | None | 0 0
  1. Config = {}
  2. Config.Debug = true
  3.  
  4. --This is for more advanced debug
  5. Config.AdvancedDebug = false
  6.  
  7. --Possible: ESX, QBCORE
  8. Config.FrameWork = "ESX"
  9.  
  10. --Only If you use custom esx prefix
  11. Config.CustomESXPrefixEvents = "esx"
  12.  
  13. Config.InitServer = function()
  14.     if Config.FrameWork == "ESX" then
  15.         ESX = nil
  16.         TriggerEvent("esx:getSharedObject", function(obj) ESX = obj end)
  17.     else
  18.         QBCore = exports["qb-core"]:GetCoreObject()
  19.     end
  20. end
  21.  
  22. Config.InitClient = function()
  23.     if Config.FrameWork == "ESX" then
  24.         ESX = nil
  25.         TriggerEvent("esx:getSharedObject", function(obj) ESX = obj end)
  26.     else
  27.         QBCore = exports["qb-core"]:GetCoreObject()
  28.     end
  29. end
  30.  
  31. Config.ServerName       = "Dein Server"
  32. Config.SavePlayerTime   = 60000 --Saves player data every minute, if player is in a zone
  33.  
  34. --https://docs.fivem.net/docs/game-references/controls/
  35. Config.OpenMenuKey      = 38
  36. Config.OpenTimeout      = 100 --Prevent database spamming / miliseconds
  37.  
  38. --https://i.imgur.com/zpLJp98.png
  39. Config.RespawnScreen    = true
  40. Config.RespawnCountdown = 4 --Seconds!
  41. Config.RespawnInstant   = false
  42.  
  43. --Prevents respawning in the same coords two times in a row
  44. Config.SameRespawnCoords = false
  45.  
  46. --https://i.imgur.com/nqU6H5t.png
  47. Config.OutZoneScreen    = true
  48. Config.OutZoneCountdown = 5 --Seconds!
  49. Config.OutZoneRespawnInstant = false
  50.  
  51. --https://i.imgur.com/9XV34Sy.png
  52. Config.IngameHud = true
  53.  
  54. Config.QuitCommand = "quitffa"
  55.  
  56. --https://i.imgur.com/gU9RdcG.png
  57. --Sets the player options on player register
  58. Config.DefaultPlayerOptions = {
  59.     notifications = true,
  60.     anonym = false,
  61.     hud = true,
  62.     fullplaytime = true,
  63.     crosshair = false,
  64.     hitmarker = false
  65. }
  66. --Here you can decide if you want to show the crosshair all the time or only when player is aiming
  67. Config.AlwaysShowCrosshair = true
  68.  
  69. Config.NametagDistance = 30
  70. Config.LeaderboardMaxPlayers = 99
  71.  
  72. --If this is false the player gets the money on the hand (cash)
  73. Config.GiveMoneyOnKillToBank = false
  74.  
  75. --If this is false then the cash from the player will be removed otherwise the from the bank
  76. Config.RemoveMoneyFromBankOnJoin = false
  77.  
  78. -----------------------------------------------------------------------------------------
  79. --Because a few people had problems with the give item function due to their
  80. --inventory system, I have now packed the function in the config so that everyone
  81. --can customize the function for his inventory :)
  82.  
  83. --This is for giving weapons for server side
  84. --Its mostly used if you have a anticheat and your anticheat is banning the players
  85. --when using the default functions
  86.  
  87. Config.QSInventory = false --esx only
  88. Config.GiveWeaponsServerSide = false
  89.  
  90. Config.GiveWeaponsServerSideFrameWork = "esx" --Possible: esx, qbcore
  91. Config.GiveWeaponServerSideEvent = function(source, weapon, ammo) --Server Side
  92.     if Config.GiveWeaponsServerSideFrameWork == "esx" then
  93.         local xPlayer = ESX.GetPlayerFromId(source)
  94.  
  95.         --You might need to change this if you are using QS Inventory
  96.         xPlayer.triggerEvent('esx:addWeapon', weapon, ammo)
  97.         xPlayer.triggerEvent('esx:addInventoryItem', weapon, false, true)
  98.         -- xPlayer.addWeapon(weapon, ammo) <-- This might now work correctly
  99.     else
  100.         --Qbcore
  101.         QBCore = exports['qb-core']:GetCoreObject()
  102.         local Player = QBCore.Functions.GetPlayer(source)
  103.         Wait(50)
  104.  
  105.         Player.Functions.AddItem(weapon, 1)
  106.         TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items[weapon], "add")
  107.     end
  108. end
  109.  
  110. --This is the function for giving weapons ON LEAVE!!
  111. Config.GiveWeaponFunctionONLEAVE = function(weaponlist) --Client Side
  112.     Config.ClearInventoryFunction()
  113.  
  114.     Wait(50)
  115.  
  116.     if not weaponlist or string.find(json.encode(weaponlist), "CLEAR") or string.find(json.encode(weaponlist), "EMPTY") then return end
  117.     if Config.GiveWeaponsServerSide then
  118.         --This basically triggers "Config.GiveWeaponServerSideEvent"!!!!
  119.         TriggerServerEvent('ffa:idleloadout', weaponlist, Config.LeaveAmmo)
  120.     else
  121.         for k,v in pairs(weaponlist) do
  122.             GiveWeaponToPed(PlayerPedId(), GetHashKey(v))
  123.             SetPedAmmo(PlayerPedId(), GetHashKey(v), Config.LeaveAmmo)
  124.         end
  125.     end
  126. end
  127.  
  128. --This will be triggered if the player left the server while in ffa
  129. --This gives the player his old loadout back on join
  130. --This will also be triggered after the script has been restarted
  131. Config.GiveWeaponFunctionONSERVERJOINorRESTART = function(weaponlist) --Client Side
  132.     Config.ClearInventoryFunction()
  133.  
  134.     Wait(50)
  135.  
  136.     if not weaponlist or string.find(json.encode(weaponlist), "CLEAR") or string.find(json.encode(weaponlist), "EMPTY") then return end
  137.     if Config.GiveWeaponsServerSide then
  138.         --This basically triggers "Config.GiveWeaponServerSideEvent"!!!!
  139.         TriggerServerEvent('ffa:idleloadout', weaponlist, Config.LeaveAmmo)
  140.     else
  141.         for k,v in pairs(weaponlist) do
  142.             GiveWeaponToPed(PlayerPedId(), GetHashKey(v))
  143.             SetPedAmmo(PlayerPedId(), GetHashKey(v), Config.LeaveAmmo)
  144.         end
  145.     end
  146. end
  147.  
  148. --This is the function for giving weapons when a player spawns in a ffa zone
  149. Config.GiveWeaponFunctionONSPAWN = function(weaponlist) --Client Side
  150.     Config.ClearInventoryFunction()
  151.  
  152.     Wait(50)
  153.  
  154.     if not weaponlist or string.find(json.encode(weaponlist), "CLEAR") or string.find(json.encode(weaponlist), "EMPTY") then return end
  155.     if Config.GiveWeaponsServerSide then
  156.         --This basically triggers "Config.GiveWeaponServerSideEvent"!!!!
  157.         TriggerServerEvent('ffa:idleloadout', weaponlist, Config.WeaponAmmo)
  158.     else
  159.         for k,v in pairs(weaponlist) do
  160.             GiveWeaponToPed(PlayerPedId(), GetHashKey(v))
  161.             SetPedAmmo(PlayerPedId(), GetHashKey(v), Config.WeaponAmmo)
  162.         end
  163.     end
  164. end
  165.  
  166. Config.ClearInventoryFunction = function()
  167.     if Config.QSInventory then
  168.         TriggerServerEvent('ffa:clearQSInventory')
  169.     else
  170.         RemoveAllPedWeapons(PlayerPedId())
  171.     end
  172. end
  173.  
  174. Config.GiveWeapon1TimeOnSpawn = true
  175.  
  176. --Sets the weapon ammo on spawn zone
  177. Config.WeaponAmmo = 5000
  178.  
  179. --Sets the weapon ammo on leave
  180. Config.LeaveAmmo = 200
  181.  
  182. -----------------------------------------------------------------------------------------
  183.  
  184. --GLOBALE VARIABLES: streak, scriptinit, gamemodedata, zonedata, inGame, isDeath, killer, incombat
  185.  
  186. Config.Notification = function(text)
  187.     TriggerEvent("esx:showNotification", text)
  188. end
  189.  
  190. Config.AntiCombat = true
  191. Config.AntiCombatTimeout = 3000
  192. --If player is in combat and tries to leave ffa
  193. Config.inCombat = function()
  194.     TriggerEvent("esx:showNotification", Config.Locals.anticombat)
  195. end
  196.  
  197. --If you want to use another notification then usual when you get a killstreak. For example send a announce
  198. Config.KillStreakNotification = function(streak)
  199.     TriggerEvent("esx:showNotification", "KILLSTREAK: " .. streak)
  200.  
  201.     --You can give the player a weapon for example
  202.     if streak == 12 then
  203.         GiveWeaponToPed(PlayerPedId(), GetHashKey("WEAPON_ASSAULTRIFLE"))
  204.     end
  205. end
  206.  
  207. --Can be used for example spawn protection
  208. Config.onSpawn = function()
  209.     SetPedArmour(PlayerPedId(), 100)
  210.     SetEntityHealth(PlayerPedId(), 100.0)
  211.    
  212.     if Config.FrameWork == "ESX" then
  213.         StopScreenEffect("DeathFailOut")
  214.         TriggerServerEvent("esx_ambulancejob:setDeathStatus", false)
  215.         TriggerServerEvent("esx:onPlayerSpawn")
  216.         TriggerEvent("esx:onPlayerSpawn")
  217.         TriggerEvent("playerSpawned")
  218.     else
  219.         StopScreenEffect("DeathFailOut")
  220.         TriggerServerEvent("hospital:server:SetDeathStatus", false)
  221.         TriggerServerEvent("hospital:server:SetLaststandStatus", false)
  222.         TriggerEvent("hospital:client:Revive")
  223.     end
  224.  
  225.     SetPlayerInvincible(PlayerId(), true)
  226.     Wait(2000)
  227.     SetPlayerInvincible(PlayerId(), false)
  228.     TriggerEvent("esx:showNotification", Config.Locals.spawnprotection)
  229. end
  230.  
  231. --You can trigger you own events on kill or death
  232. Config.onKill = function()
  233.     SetPedArmour(PlayerPedId(), 100)
  234.     SetEntityHealth(PlayerPedId(), 100.0)
  235.  
  236.     --Example add another reward besides the Config.Gamemode.KillReward
  237. end
  238.  
  239. Config.onDeath = function()
  240.     if Config.FrameWork == "ESX" then
  241.         TriggerServerEvent("esx_ambulancejob:setDeathStatus", false)
  242.     else
  243.         TriggerServerEvent("hospital:server:SetDeathStatus", false)
  244.     end
  245.  
  246.     if gamemodedata.Name == "Hardcore" then
  247.         TriggerServerEvent("ffa:removeMoney", "all", "bank")
  248.         --TriggerServerEvent("ffa:removeMoney", "1000", "bank") <- You can use "bank" or "cash"
  249.        
  250.         --Its RECOMMEND to use your own event!!
  251.     end
  252. end
  253.  
  254. Config.onQuit = function()
  255.     TriggerEvent("esx:showNotification", Config.Locals.quitffa)
  256. end
  257.  
  258. --Replace with your "open menu notification"
  259. Config.showInfoBar = function(text)
  260.     SetTextComponentFormat("STRING")
  261.     AddTextComponentString(text)
  262.     DisplayHelpTextFromStringLabel(0, 0, 1, -1)
  263. end
  264.  
  265. --Simply sends the Config.KillStreakNotification notification when you get a killstreak
  266. Config.KillStreak = {
  267.     3,
  268.     6,
  269.     12,
  270.     18,
  271.     24,
  272.     30,
  273.     36,
  274.     42,
  275.     48,
  276.     54,
  277.     60,
  278. }
  279.  
  280. Config.HitMarkerColor = {120, 0, 0}
  281. --You can also play a sound on hit if you want to
  282. Config.OnHitmarker = function()
  283.     --Please notice that you need to install https://forum.cfx.re/t/release-play-custom-sounds-for-interactions/8282 to use this event!
  284.  
  285.     --TriggerEvent("InteractSound_CL:PlayOnOne", "hitmarker", 1)
  286. end
  287.  
  288. -----------------------------------------------------------------------------------------
  289.  
  290. Config.Locals = {
  291.     quitffa = "Erfolgreich ffa verlassen!",
  292.     spawnprotection = "Spawn schutz abgelaufen!",
  293.     notenoughmoney = "Nicht genug Geld dabei!",
  294.     zonefull = "Zone ist voll!",
  295.     anticombat = "You are currently in combat, please wait a few seconds!",
  296.     killed = "You have killed [name]"
  297. }
  298.  
  299. -----------------------------------------------------------------------------------------
  300.  
  301. Config.FFAMarker = {
  302.     FFA1 = {
  303.  
  304.         ShowMarker  = true,
  305.         ShowBlip    = true,
  306.  
  307.         UseJob      = false,
  308.         Jobname     = "police",
  309.  
  310.         --https://docs.fivem.net/docs/game-references/markers/
  311.         Marker = {
  312.             Coords        = vector3(-420.356, 1142.452, 324.8536),
  313.             DrawDistance  = 20.0,
  314.             Scale         = vector3(1.5, 1.5, 1.0),
  315.             Colour        = {r = 102, g = 102, b = 204},
  316.             Alpha         = 100,
  317.             Type          = 1,
  318.             MSG           = "Drücke ~INPUT_CONTEXT~ um das Menü zu öffnen",
  319.         },
  320.  
  321.         --https://docs.fivem.net/docs/game-references/blips/
  322.         Blip = {
  323.             Coords  = vector3(-420.356, 1142.452, 324.8536),
  324.             Sprite  = 175,
  325.             Display = 4,
  326.             Scale   = 1.0,
  327.             Colour  = 2,
  328.             Name    = "FFA",
  329.         },
  330.  
  331.     },
  332.  
  333.     FFA2 = {
  334.  
  335.         ShowMarker  = true,
  336.         ShowBlip    = true,
  337.  
  338.         UseJob      = false,
  339.         Jobname     = "police",
  340.  
  341.         --https://docs.fivem.net/docs/game-references/markers/
  342.         Marker = {
  343.             Coords        = vector3(208.00997924805, -922.00244140625, 30.691999435425),
  344.             DrawDistance  = 20.0,
  345.             Scale         = vector3(1.5, 1.5, 1.0),
  346.             Colour        = {r = 102, g = 102, b = 204},
  347.             Alpha         = 100,
  348.             Type          = 1,
  349.             MSG           = "Drücke ~INPUT_CONTEXT~ um das Menü zu öffnen"
  350.         },
  351.  
  352.         --https://docs.fivem.net/docs/game-references/blips/
  353.         Blip = {
  354.             Coords  = vector3(208.00997924805, -922.00244140625, 30.691999435425),
  355.             Sprite  = 175,
  356.             Display = 4,
  357.             Scale   = 1.0,
  358.             Colour  = 2,
  359.             Name    = "FFA",
  360.         },
  361.  
  362.     },
  363. }
  364.  
  365. Config.Zones = {
  366.     Zone0 = {
  367.         Name        = "Only Pistol",
  368.         Desc        = "Wähle mit dieser Karte aus, dass du in der Only Pistole Zone FFA spielen möchtest.",
  369.         AddedDate   = "29.06.2022",
  370.  
  371.         MaxPlayers  = 10,
  372.  
  373.         --OneSync must be set to "infnity" in server settings!
  374.         Dimension   = true,
  375.         DimensionID = 10000, --IMPORT TO CHANGE WHEN CREATING A NEW ZONE! <<<<<<--------
  376.  
  377.         ShowZone    = true,
  378.         ZoneHeight  = 25,
  379.         ZoneAlpha   = 90,
  380.         ZoneColor   = {r = 69, g = 255, b = 141},
  381.  
  382.         ZoneCoords = {
  383.             {-154.50605773926, -937.58984375, 253.3971862793},
  384.             {-157.92643737793, -948.24786376953, 252.89315795898},
  385.             {-162.26533508301, -946.7685546875, 252.89315795898},
  386.             {-168.97314453125, -964.44616699219, 253.3971862793},
  387.  
  388.             {-176.78015136719, -961.36590576172, 253.3971862793},
  389.             {-196.49926757813, -1013.7241821289, 253.3971862793},
  390.             {-151.77670288086, -1030.2932128906, 253.33418273926},
  391.             {-132.67620849609, -977.74255371094, 253.33418273926},
  392.  
  393.             {-137.07427978516, -976.23345947266, 253.33418273926},
  394.             {-129.50109863281, -955.68560791016, 253.33418273926},
  395.             {-135.46151733398, -953.85028076172, 253.33418273926},
  396.             {-132.71960449219, -945.95690917969, 253.33418273926},
  397.         },
  398.  
  399.         Spawnpoints = {
  400.             {-159.85989379883, -990.80316162109, 254.13130187988},
  401.             {-185.45248413086, -1008.3400268555, 254.33544921875},
  402.             {-149.4659576416, -946.77642822266, 254.14801025391},
  403.  
  404.             {-145.21778869629, -947.94635009766, 269.11868286133},
  405.             {-154.05239868164, -980.57952880859, 269.21032714844},
  406.             {-147.44667053223, -992.9580078125, 261.84518432617},
  407.         },
  408.  
  409.         OwnWeapons  = false,
  410.         --https://wiki.rage.mp/index.php?title=Weapons
  411.         Weapons     = {
  412.             "WEAPON_PISTOL",
  413.             "WEAPON_PISTOL_MK2",
  414.             "WEAPON_COMBATPISTOL",
  415.             "WEAPON_PISTOL50",
  416.             "WEAPON_SNSPISTOL",
  417.             "WEAPON_SNSPISTOL_MK2",
  418.             "WEAPON_HEAVYPISTOL",
  419.             "WEAPON_VINTAGEPISTOL",
  420.         },
  421.  
  422.     },
  423.  
  424.     Zone1 = {
  425.         Name        = "Würfelpark",
  426.         Desc        = "Wähle mit dieser Karte aus, dass du in der Würfelpark Zone FFA spielen möchtest.",
  427.         AddedDate   = "19.07.2021",
  428.  
  429.         MaxPlayers  = 20,
  430.  
  431.         --OneSync must be set to "infnity" in server settings!
  432.         Dimension   = true,
  433.         DimensionID = 10001, --IMPORT TO CHANGE WHEN CREATING A NEW ZONE! <<<<<<--------
  434.  
  435.         ShowZone    = true,
  436.         ZoneHeight  = 10,
  437.         ZoneAlpha   = 90,
  438.         ZoneColor   = {r = 255, g = 255, b = 141},
  439.  
  440.         ZoneCoords = {
  441.             {107.23777770996, -1003.2484130859, 29.40472984314},
  442.             {170.03587341309, -819.34228515625, 31.176509857178},
  443.             {290.53610229492, -858.66943359375, 29.24479675293},
  444.             {225.74273681641, -1038.6241455078, 29.359869003296},
  445.         },
  446.  
  447.         Spawnpoints = {
  448.             {236.90498352051, -879.6025390625, 30.492111206055},
  449.             {173.76466369629, -919.04986572266, 30.670347213745},
  450.             {229.20983886719, -956.81567382813, 29.337562561035},
  451.             {202.58497619629, -998.02258300781, 30.108287811279},
  452.             {133.78994750977, -990.29925537109, 29.348255157471},
  453.             {150.9521484375, -963.29431152344, 30.098808288574},
  454.             {261.30218505859, -874.74243164063, 29.177373886108},
  455.             {187.93125915527, -853.60638427734, 31.369457244873},
  456.         },
  457.  
  458.         OwnWeapons  = false,
  459.         --https://wiki.rage.mp/index.php?title=Weapons
  460.         Weapons     = {
  461.             "WEAPON_PISTOL",
  462.             "WEAPON_ASSAULTRIFLE",
  463.         },
  464.  
  465.     },
  466.  
  467.     Zone2 = {
  468.         Name        = "Observatorium",
  469.         Desc        = "Wähle mit dieser Karte aus, dass du in der Observatorium Zone FFA spielen möchtest.",
  470.         AddedDate   = "19.07.2021",
  471.  
  472.         MaxPlayers  = 20,
  473.  
  474.         --OneSync must be set to "infnity" in server settings!
  475.         Dimension   = true,
  476.         DimensionID = 10002, --IMPORT TO CHANGE WHEN CREATING A NEW ZONE! <<<<<<--------
  477.  
  478.         ShowZone    = true,
  479.         ZoneHeight  = 10,
  480.         ZoneAlpha   = 50,
  481.         ZoneColor   = {r = 255, g = 255, b = 141},
  482.  
  483.         --Credits: https://github.com/prefech/JD_SafeZone
  484.         ZoneCoords  = {
  485.             {-484.13290405273, 1099.4439697266, 325.44760131836},
  486.             {-403.48867797852, 1079.1002197266, 325.44760131836},
  487.             {-367.90661621094, 1230.1385498047, 325.44760131836},
  488.             {-442.13290405273, 1255.0555419922, 325.44760131836},
  489.         },
  490.  
  491.         Spawnpoints = {
  492.             {-414.14004516602, 1135.4301757813, 325.9045715332},
  493.             {-435.78497314453, 1138.2543945313, 325.9045715332},
  494.             {-413.11117553711, 1233.4633789063, 325.90438842773},
  495.             {-375.32080078125, 1228.6291503906, 325.90438842773},
  496.             {-437.88909912109, 1208.4266357422, 325.90438842773},
  497.             {-397.75546264648, 1128.2397460938, 322.97259521484},
  498.         },
  499.  
  500.         OwnWeapons  = false,
  501.         --https://wiki.rage.mp/index.php?title=Weapons
  502.         Weapons     = {
  503.             "WEAPON_PISTOL",
  504.             "WEAPON_ASSAULTRIFLE",
  505.         },
  506.  
  507.     },
  508.    
  509. }
  510.  
  511. Config.Gamemode = {
  512.    
  513.     Gamemode1 = {
  514.         Name        = "Hardcore",
  515.         Desc        = "Es gelten die selben Regeln wie im normalen Spielmodus, stirbst du, verlierst du <span>ALL</span> dein <span>GELD</span> was du dabei hast! Für jede Eliminierung die du erzielst, erhälst du <span>$90,000</span> auf deinem Konto gut geschrieben!",
  516.         Death       = "Alles Geld Verlieren",
  517.        
  518.         JoinPrice   = 20000,
  519.         KillReward  = 90000,
  520.     },
  521.  
  522.     Gamemode2 = {
  523.         Name        = "Normal",
  524.         Desc        = "Es gelten die typischen FFA Regeln! Du kannst durch das spielen von FFA auszeichnungen erhalten. Durch das erbringen von Auszeichnungen erhälst du weitere Belohnungen!",
  525.         Death       = "Garnichts :)",
  526.  
  527.         JoinPrice   = 10000,
  528.         KillReward  = 35000,
  529.     },
  530.  
  531. }
Advertisement
Add Comment
Please, Sign In to add comment