Configuration
This is the configuration that you can give to this script to modify it to your liking
The framework is autodetected but you can change it to a custom one in the shared editable.
Config File
Config = {}
Config.Debug = false --- This disables last man standing to win in order to test the game mode.
-- βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
-- βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
-- βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
-- βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
-- βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
-- βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
--------------------------------------------
--- Framework is autodetected and if you don't have ESX or QBCore
-- you can adda custom framework without any problem in
-- shared/cl_editable.lua and shared/sv_editable.lua
--------------------------------------------
-- βββββββββββββββββββββββββββββββββββββββββββββ
-- βββββββββββββββββββββββββββββββββββββββββββββ
-- βββββββββββββββββββββββββββββββββββββββββββββ
-- βββββββββββββββββββββββββββββββββββββββββββββ
-- βββββββββββββββββββββββββββββββββββββββββββββ
-- βββββββββββββββββββββββββββββββββββββββββββββ
--------------------------------------------
Config.CreateStormCommand = 'createstorm'
Config.AcePermission = 'xstorm'
Config.DrawDistanceLobby = 10.0
Config.HightStartGame = 200
Config.EnableStormInMap = true
--------------------------------------------
Config.EnableDamageIndicator = true
--- This is to enable or disable the damage indicator
-- that you do to a player when he shoots you (he will also see the damage),
-- this includes the headshot indicator and the indicator that you killed him.
--------------------------------------------
Config.RemoveNPCInGame = true
--- You can enable or disable NPC spawning in the game
-- (If you have a separate script that already does this,
-- disable it, so that when you play the game it does not consume more ms).
--------------------------------------------
Config.LobbyColor = {r = 0, g = 50, b = 105, a = 100}
Config.StormColor = {r = 0, g = 255, b = 255, a = 100}
Config.ColorBlipStorm = 1
Config.RoutingBucket = 3189 --- Don't touch if you don't know
Config.AutoHealth = true --- This will cause the player when inside the zone to self-heal.
Config.HealtPower = 1 --- Power of life increase in the area.
Config.AutoParachute = true --- It gives them a parachute again in free or high falls.
--------------------------------------------
-- The higher it is, the higher the synchronization of the closing zone will be.
Config.StormSyncMs = 500
-- This works with ms, do not touch it because if you make the zone closing smoother
-- and more fluid there may be desync and other players will not see the zone as
-- some will see it and it will close slower.
--------------------------------------------
-- ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
-- ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
-- ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
-- ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
-- ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
-- ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
-- This loot will be given when you start the game to all players.
Config.StartLoot = {
['basic'] = {
{ item = 'weapon_pistol', amount = 1},
{ item = 'pistol_ammo', amount = 20},
{ item = 'armor', amount = 5},
-- { money = 'cash', amount = 1000}, --- You can add different types of accounts that you have on your server ('cash', 'money', 'bank', 'black_money', 'coins', 'crypto'}.
},
['normal'] = {
{ item = 'weapon_smg', amount = 1},
{ item = 'smg_ammo', amount = 20},
{ item = 'armor', amount = 10},
-- { money = 'cash', amount = 1000},
},
['advanced'] = {
{ item = 'weapon_carbinerifle', amount = 1},
{ item = 'rifle_suppressor', amount = 1},
{ item = 'rifle_ammo', amount = 20},
{ item = 'heavyarmor', amount = 10},
-- { money = 'cash', amount = 1000},
},
}
-- Reward when you kill a player, you can use him as a refill
Config.RewardKill = {
['basic'] = {
{ money = 'cash', amount = 1000},
{ item = 'pistol_ammo', amount = 5},
{ item = 'armor', amount = 1},
},
['normal'] = {
{ money = 'cash', amount = 5000},
{ item = 'smg_ammo', amount = 8},
{ item = 'armor', amount = 3},
},
['advanced'] = {
{ money = 'cash', amount = 10000},
{ item = 'rifle_ammo', amount = 10},
{ item = 'heavyarmor', amount = 5},
},
}
-- Rewards when you win the game.
Config.RewardWin = {
['basic'] = {
{ money = 'cash', amount = 1000},
{ item = 'weapon_pistol', amount = 1},
},
['normal'] = {
{ money = 'cash', amount = 10000},
{ item = 'weapon_smg', amount = 1},
},
['advanced'] = {
{ money = 'bank', amount = 10000},
{ item = 'weapon_carbinerifle', amount = 1},
},
}
-- βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
-- βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
-- βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
-- βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
-- βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
-- βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
-- Here are the translations of the game, you can find the others Here are the translations of the game, you can find the translations of the interface in ui/lang.js
Config.Translate = {
['status'] = "~w~Status:",
['you_are_joined'] = "~g~You have entered",
['you_are_leave'] = "~y~You are out",
['players_in_game'] = "~w~Players In Lobby:~o~",
['game_start_in'] = "~w~The game started in ~b~",
['is_already_active'] = "The storm is already active, you cannot restart it until you stop it.",
['is_not_active'] = "The storm is not active for you to stop it.",
['your_recived_loot'] = "You received loot.",
['your_recived_reward_kill'] = "You have received the reward for the kill",
['your_recived_reward_win'] = "You have received your reward for your victory",
['dmg_indicator_hs'] = 'HEADSHOT',
['dmg_indicator_dead'] = 'DEAD'
}
You can also edit part of the client side and server side in our shared folder for more compatibility or modify things to your liking.
Client Side Editable
/shared/cl_editable.lua
local Framework
local ESX, QB
if GetResourceState('es_extended') == 'started' then
ESX = exports['es_extended']:getSharedObject()
Framework = 'ESX'
end
if GetResourceState('qb-core') == 'started' then
QBCore = exports['qb-core']:GetCoreObject()
Framework = 'QBCore'
end
Notify = function(msg, type)
if Framework == 'ESX' then
elseif Framework == 'QBCore' then
TriggerEvent('QBCore:Notify', msg, type)
end
end
DrawMarkerLobby = function(x, y, z, radius)
DrawMarker(1, x, y, z, 0, 0, 0, 0, 0, 0, radius * 2.0, radius * 2.0, 1.0, Config.LobbyColor.r, Config.LobbyColor.g, Config.LobbyColor.b, Config.LobbyColor.a, false, true, 2, false, false, false, false)
end
DrawMarkerStorm = function(x, y, z, radius)
DrawMarker(1, x, y, z, 0, 0, 0, 0, 0, 0, radius * 2.0, radius * 2.0, 300.0, Config.StormColor.r, Config.StormColor.g, Config.StormColor.b, Config.StormColor.a, false, true, 2, false, false, false, false)
end
DrawText3D = function(x, y, z, text)
local onScreen, _x, _y = World3dToScreen2d(x, y, z)
if onScreen then
SetTextScale(0.35, 0.35)
SetTextFont(4)
SetTextProportional(1)
SetTextColour(255, 255, 255, 255)
SetTextDropshadow(0, 0, 0, 0, 255)
SetTextEdge(2, 0, 0, 0, 150)
SetTextDropShadow()
SetTextOutline()
BeginTextCommandDisplayText("STRING")
AddTextComponentSubstringPlayerName(text)
EndTextCommandDisplayText(_x, _y)
end
end
RevivePlayer = function()
if Framework == 'QBCore' then
TriggerEvent('hospital:client:Revive')
elseif Framework == 'ESX' then
end
end
CheckIsDeadPlayer = function()
if Framework == 'QBCore' then
QBCore.Functions.GetPlayerData(function(PlayerData)
if PlayerData.metadata["isdead"] or PlayerData.metadata["inlaststand"] then
Citizen.Wait(1000)
RevivePlayer()
discountLives()
Wait(100)
if currentLives() == -1 then
StopClientGame()
else
AirTeleportRandom()
end
end
end)
elseif Framework == 'ESX' then
if IsEntityDead(PlayerPedId()) then
Citizen.Wait(1000)
RevivePlayer()
discountLives()
Wait(100)
if currentLives() == -1 then
StopClientGame()
else
AirTeleportRandom()
end
end
end
end
Server Side Editable
/shared/sv_editable.lua
local Framework
local ESX, QB
if GetResourceState('es_extended') == 'started' then
ESX = exports['es_extended']:getSharedObject()
Framework = 'ESX'
end
if GetResourceState('qb-core') == 'started' then
QBCore = exports['qb-core']:GetCoreObject()
Framework = 'QBCore'
end
GiveItemsToPlayer = function(source, type)
if Framework == 'ESX' then
local xPlayer = ESX.GetPlayerFromId(source)
if xPlayer and Config.StartLoot[type] then
local loot = Config.StartLoot[type]
for _, item in ipairs(loot) do
if item.item then
xPlayer.addInventoryItem(item.item, item.amount)
elseif item.money then
xPlayer.addAccountMoney(item.money, item.amount)
else
if Config.Debug == true then
print('^1Tipo de recompensa no vΓ‘lido')
end
end
end
TriggerClientEvent('biyei_xstorm:client:Notify', source, Config.Translate['your_recived_loot'], 'success')
else
if Config.Debug == true then
print('^1Jugador invΓ‘lido o tipo de recompensa invΓ‘lido')
end
end
elseif Framework == 'QBCore' then
local xPlayer = QBCore.Functions.GetPlayer(source)
if xPlayer and Config.StartLoot[type] then
local loot = Config.StartLoot[type]
for _, item in ipairs(loot) do
if item.item then
xPlayer.Functions.AddItem(item.item, item.amount)
elseif item.money then
xPlayer.Functions.AddMoney(item.money, item.amount)
else
if Config.Debug == true then
print('^1Tipo de recompensa no vΓ‘lido')
end
end
end
TriggerClientEvent('biyei_xstorm:client:Notify', source, Config.Translate['your_recived_loot'], 'success')
else
if Config.Debug == true then
print('^1Jugador invΓ‘lido o tipo de recompensa invΓ‘lido')
end
end
end
end
GiveItemsToPlayerKillRewards = function(source, type)
if Framework == 'ESX' then
local xPlayer = ESX.GetPlayerFromId(source)
if xPlayer and Config.RewardKill[type] then
local rewards = Config.RewardKill[type]
for _, item in ipairs(rewards) do
if item.item then
xPlayer.addInventoryItem(item.item, item.amount)
elseif item.money then
xPlayer.addAccountMoney(item.money, item.amount)
else
if Config.Debug == true then
print('^1Tipo de recompensa no vΓ‘lida')
end
end
end
TriggerClientEvent('biyei_xstorm:client:Notify', source, Config.Translate['your_recived_reward_kill'], 'success')
else
if Config.Debug == true then
print('^1Jugador invΓ‘lido o tipo de recompensa invΓ‘lido')
end
end
elseif Framework == 'QBCore' then
local xPlayer = QBCore.Functions.GetPlayer(source)
if xPlayer and Config.RewardKill[type] then
local loot = Config.RewardKill[type]
for _, item in ipairs(loot) do
if item.item then
xPlayer.Functions.AddItem(item.item, item.amount)
elseif item.money then
xPlayer.Functions.AddMoney(item.money, item.amount)
else
if Config.Debug == true then
print('^1Tipo de recompensa no vΓ‘lido')
end
end
end
TriggerClientEvent('biyei_xstorm:client:Notify', source, Config.Translate['your_recived_reward_kill'], 'success')
else
if Config.Debug == true then
print('^1Jugador invΓ‘lido o tipo de recompensa invΓ‘lido')
end
end
end
end
GiveItemsToPlayerWinRewards = function(source, type)
if Framework == 'ESX' then
local xPlayer = ESX.GetPlayerFromId(source)
if xPlayer and Config.RewardWin[type] then
local rewards = Config.RewardWin[type]
for _, item in ipairs(rewards) do
if item.item then
xPlayer.addInventoryItem(item.item, item.amount)
elseif item.money then
xPlayer.addAccountMoney(item.money, item.amount)
else
if Config.Debug == true then
print('^1Tipo de recompensa no vΓ‘lido')
end
end
end
TriggerClientEvent('biyei_xstorm:client:Notify', source, Config.Translate['your_recived_reward_win'], 'success')
else
if Config.Debug == true then
print('^1Jugador invΓ‘lido o tipo de recompensa invΓ‘lido')
end
end
elseif Framework == 'QBCore' then
local xPlayer = QBCore.Functions.GetPlayer(source)
if xPlayer and Config.RewardWin[type] then
local reward = Config.RewardWin[type]
for _, item in ipairs(reward) do
if item.item then
xPlayer.Functions.AddItem(item.item, item.amount)
elseif item.money then
xPlayer.Functions.AddMoney(item.money, item.amount)
else
if Config.Debug == true then
print('^1Tipo de recompensa no vΓ‘lido')
end
end
end
TriggerClientEvent('biyei_xstorm:client:Notify', source, Config.Translate['your_recived_reward_win'], 'success')
else
if Config.Debug == true then
print('^1Jugador invΓ‘lido o tipo de recompensa invΓ‘lido')
end
end
end
end
ClearInventory = function(source)
if Framework == 'ESX' then
local xPlayer = ESX.GetPlayerFromId(source)
if xPlayer then
TriggerEvent('esx:playerLoadoutCleared', source)
TriggerEvent('esx:playerInventoryCleared', source)
else
if Config.Debug == true then
print('^1Jugador invΓ‘lido')
end
end
elseif Framework == 'QBCore' then
local xPlayer = QBCore.Functions.GetPlayer(source)
if xPlayer then
xPlayer.Functions.ClearInventory()
else
if Config.Debug == true then
print('^1Invalid player')
end
end
end
end
Last updated