1
0
Fork 0
forked from Simnation/Main
This commit is contained in:
Nordi98 2025-06-29 20:42:49 +02:00
parent c3a8620ecb
commit ab720cb5f3
11 changed files with 0 additions and 0 deletions

View file

@ -1,172 +0,0 @@
print'Pug Sling 2.1.3'
CreateThread(function()
local InVehicle
while true do
Wait(100)
local entering = GetVehiclePedIsTryingToEnter(PlayerPedId())
if entering ~= 0 then
TriggerEvent("Pug:ReloadGuns:sling", true)
Wait(2000)
end
if IsPedInAnyVehicle(PlayerPedId()) then
if not InVehicle then
InVehicle = true
TriggerEvent("Pug:ReloadGuns:sling", true)
Wait(2000)
end
else
InVehicle = false
end
end
end)
if not Config.UseOldSlingScript then
RegisterNetEvent('Pug:ReloadGuns:sling', function(bool)
ResetAllWeaponsOnBack(bool)
for _, v in pairs(GetGamePool('CObject')) do
if IsEntityAttachedToEntity(PlayerPedId(), v) then
SetEntityAsMissionEntity(v, true, true)
DeleteObject(v)
DeleteEntity(v)
end
end
end)
RegisterNetEvent('QBCore:Client:OnPlayerLoaded')
AddEventHandler('QBCore:Client:OnPlayerLoaded', function()
Wait(3000)
TriggerEvent("Pug:client:RegisterAllBackWeapons")
end)
RegisterNetEvent('esx:playerLoaded')
AddEventHandler('esx:playerLoaded', function()
Wait(3000)
TriggerEvent("Pug:client:RegisterAllBackWeapons")
end)
-- Change this to your notification script if needed
function SlingNotify(msg, type, length)
if Framework == "ESX" then
FWork.ShowNotification(msg)
elseif Framework == "QBCore" then
FWork.Functions.Notify(msg, type, length)
end
end
-- INVENTORY HAS ITEM CHECK
function CheckHasWeapon(Weapon)
if GetResourceState("qs-inventory") == 'started' then
local count = exports['qs-inventory']:Search(Weapon)
if count > 0 then
return true
else
return false
end
elseif GetResourceState("qb-inventory") == 'started' then
return exports['qb-inventory']:HasItem(Weapon)
elseif GetResourceState("ps-inventory") == 'started' then
return exports['ps-inventory']:HasItem(Weapon)
elseif GetResourceState("ox_inventory") == 'started' then
local count = exports.ox_inventory:GetItemCount(Weapon)
if count > 0 then
return true
else
return false
end
elseif GetResourceState("core_inventory") == 'started' then
if Framework == "QBCore" then
local citizenid = FWork.Functions.GetPlayerData().citizenid
local Primary = exports['core_inventory']:getItems('primary-' .. citizenid, Weapon)
local Secondry = exports['core_inventory']:getItems('secondry-' .. citizenid, Weapon)
if Primary > 0 or Secondry > 0 then
return true
else
return false
end
else
return false
end
elseif Framework == "QBCore" then
local FinalValue = false
local items = FWork.Functions.GetPlayerData().items
for _, v in pairs(items) do
if v.name ~= nil then
if tostring(v.name) == tostring(Weapon) then
FinalValue = true
end
end
end
return FinalValue
end
end
local function CheckJobVerified()
local PlayerJob = Config.FrameworkFunctions.GetPlayer().PlayerData.job.name
for _,v in pairs(Config.RackCapableJobs) do
if tostring(v) == tostring(PlayerJob) then
return true
end
end
return false
end
RegisterCommand(Config.WeaponRackCommand, function()
if CheckJobVerified() then
--IS IN VEHICLE
if IsPedInAnyVehicle(PlayerPedId()) then
local veh = GetVehiclePedIsUsing(PlayerPedId())
local plate = GetVehicleNumberPlateText(veh)
--IS EMERGENCY VEHICLE
if GetVehicleClass(veh) == 18 then
if Framework == "ESX" then
if GetResourceState("qb-inventory") == 'started' or GetResourceState("ps-inventory") == 'started' then
TriggerEvent("inventory:client:SetCurrentStash", "Rack".. plate)
TriggerServerEvent("inventory:server:OpenInventory", "stash", "Rack" .. plate, {
maxweight = Config.RackMaxWeight,
slots = Config.RackSlots,
})
elseif GetResourceState("qs-inventory") == 'started' then
exports['qs-inventory']:RegisterStash("Rack".. plate, Config.RackSlots, Config.RackMaxWeight)
elseif GetResourceState("ox_inventory") == 'started' then
TriggerServerEvent("Pug:server:SlingOpenOxInvRack", "Rack".. plate, Config.RackSlots, Config.RackMaxWeight)
exports.ox_inventory:openInventory('stash', "Rack".. plate)
end
else
FWork.Functions.Progressbar("reaching_rack", "Reaching for rack", 4000, false, true, {
disableMovement = false,
disableCarMovement = false,
disableMouse = false,
disableCombat = true,
}, {
animDict = "move_m@intimidation@cop@unarmed",
anim = "idle",
flags = 49,
}, {}, {}, function()
if GetResourceState("qb-inventory") == 'started' or GetResourceState("ps-inventory") == 'started' then
TriggerEvent("inventory:client:SetCurrentStash", "Rack".. plate)
TriggerServerEvent("inventory:server:OpenInventory", "stash", "Rack" .. plate, {
maxweight = Config.RackMaxWeight,
slots = Config.RackSlots,
})
elseif GetResourceState("qs-inventory") == 'started' then
exports['qs-inventory']:RegisterStash("Rack".. plate, Config.RackSlots, Config.RackMaxWeight)
elseif GetResourceState("ox_inventory") == 'started' then
TriggerServerEvent("Pug:server:SlingOpenOxInvRack", "Rack".. plate, Config.RackSlots, Config.RackMaxWeight)
exports.ox_inventory:openInventory('stash', "Rack".. plate)
end
end, function() -- Cancel
SlingNotify("Canceled", "error", 4500)
end)
end
else
SlingNotify(Config.LangT.EmergencyServiceVehicle, "error")
end
else
SlingNotify(Config.LangT.MustBeInVehicle, "error")
end
else
SlingNotify(Config.LangT.NotPolice, "error")
end
end)
end

View file

@ -1,300 +0,0 @@
Config = {}
Config.UseOldSlingScript = false -- MAKKE THIS TRUE IF YOU WANT TO USE THE OLD VERSION OF THE SCRIPT. VIDEO FOUND HERE: https://youtu.be/Pf-B03cmFtQ
if not Config.UseOldSlingScript then
---------- [Framework] ----------
-- (DONT TOUCH THIS UNLESS YOU HAVE A CUSTOM FRAMEWORK)
if GetResourceState('es_extended') == 'started' then
Framework = "ESX" -- (ESX) or (QBCore)
elseif GetResourceState('qb-core') == 'started' then
Framework = "QBCore" -- (ESX) or (QBCore)
end
if Framework == "QBCore" then
Config.CoreName = "qb-core" -- your core name
FWork = exports[Config.CoreName]:GetCoreObject()
elseif Framework == "ESX" then
Config.CoreName = "es_extended" -- your core name
FWork = exports[Config.CoreName]:getSharedObject()
end
------------------------------
---------- [INTAGERS] ----------
Config.LoopSpeed = 500 -- How fast the loop to check weapons runs. Lower numbers are lest optimized.
Config.RackMaxWeight = 45000 -- Rack stash weight capacity.
Config.RackSlots = 2 -- Rack stash amount of item slots available.
Config.WeaponLimit = 10 -- Ammount of weapons/items that will show up on the player when they have the item or weapon
Config.AmountOfTimesToCheckIfTheModelIsLoaded = 10 -- This value adjust the amount of times to check to see if a modle is loaded. The check runs every 100 milliseconds
------------------------------
---------- [STRINGS] ----------
Config.WeaponRackCommand = "rack" -- /rack command to rack weapons into any service vehicles
Config.WeaponSettingCommand = "setweapon" -- (GLOBAL POSITION FOR EVERYONE) /setweapon command to begin editing where the weapons/items should sit on the player
Config.PersonalWeponSettingsCommand = "weaponposition" -- (PLAYERS PERSONAL POSITION THAT THEY SET HOW THEY LIKE) You can remove this command from the server.lua
------------------------------
---------- [TABLES] ----------
Config.RackCapableJobs = { -- Jobs that can do the /rack command
"leo",
"police",
"sheriff",
}
------------------------------
Config.LangT = {
DeleteFromConfig = "DELETE FROM CONFIG",
Change = "CHANGE ",
ToggleWeapons = "ALL WEAPONS ON/OFF",
RotateZ = "ROTATE Z",
Up = "UP",
Down = "DOWN",
Left = "LEFT",
Right = "RIGHT",
In = "In",
Out = "Out",
Rotate = "ROTATE",
MustBeInVehicle = "You must be in a vehicle",
NotPolice = "You are not a police Officer",
EmergencyServiceVehicle = "Must be in a emergency service vehicle!",
}
-- THE ATTACHMENTS WORK BUT SOME SERVERS HAD CRASHING ISSUES WHEN THEY WERE UNHASHED. YOU CAN UNHASH THEM BUT IF YOU CRASH THEN HASH THEM BACK OUT.
Config.WeaponsOnBack = {-- THE ATTACHMENTS WORK BUT SOME SERVERS HAD CRASHING ISSUES WHEN THEY WERE UNHASHED. YOU CAN UNHASH THEM BUT IF YOU CRASH THEN HASH THEM BACK OUT.
-- Pistols
["weapon_pistol"] = { model = "w_pi_pistol" },
-- Assault Rifles
["weapon_carbinerifle"] = { -- THE ATTACHMENTS WORK BUT SOME SERVERS HAD CRASHING ISSUES WHEN THEY WERE UNHASHED. YOU CAN UNHASH THEM BUT IF YOU CRASH THEN HASH THEM BACK OUT.
model = "w_ar_carbinerifle",
-- Attachments = {
-- ["COMPONENT_CARBINERIFLE_CLIP_01"] = {Base = 'WAPClip',Component = "W_AR_CARBINERIFLE_MAG1"},
-- ["COMPONENT_CARBINERIFLE_CLIP_02"] = {Base = 'WAPClip',Component = "W_AR_CARBINERIFLE_MAG2"},
-- ["COMPONENT_AT_AR_FLSH"] = {Base = 'WAPFlshLasr',Component = "W_AT_AR_FLSH"},
-- ["COMPONENT_AT_SCOPE_MEDIUM"] = {Base = 'WAPScop',Component = "W_AT_SCOPE_MEDIUM"},
-- ["COMPONENT_AT_AR_SUPP"] = {Base = 'WAPSupp', Component = "W_AT_AR_SUPP"},
-- ["COMPONENT_AT_AR_AFGRIP"] = {Base = 'WAPGrip',Component = "W_AT_AR_AFGRIP"},
-- }
},
["weapon_compactrifle"] = {
model = "w_ar_assaultrifle_smg",
-- Attachments = {
-- ["COMPONENT_COMPACTRIFLE_CLIP_01"] = {Base = 'WAPClip', Component = "w_ar_assaultrifle_smg_mag1"},
-- ["COMPONENT_COMPACTRIFLE_CLIP_02"] = {Base = 'WAPClip', Component = "w_ar_assaultrifle_smg_mag2"},
-- ["COMPONENT_AT_AR_FLSH"] = {Base = 'WAPFlshLasr', Component = "W_AT_AR_FLSH"},
-- ["COMPONENT_AT_SCOPE_MACRO"] = {Base = 'WAPScop', Component = "w_at_scope_macro"},
-- ["COMPONENT_AT_AR_AFGRIP"] = {Base = 'WAPGrip', Component = "W_AT_AR_AFGRIP"},
-- }
},
["weapon_carbinerifle_mk2"] = {
model = "w_ar_carbineriflemk2",
-- Attachments = {
-- ["COMPONENT_CARBINERIFLE_MK2_CLIP_01"] = {Base = 'WAPClip', Component = "w_ar_carbineriflemk2_mag1"},
-- ["COMPONENT_CARBINERIFLE_MK2_CLIP_02"] = {Base = 'WAPClip', Component = "w_ar_carbineriflemk2_mag2"},
-- ["COMPONENT_AT_AR_FLSH"] = {Base = 'WAPFlshLasr', Component = "W_AT_AR_FLSH"},
-- ["COMPONENT_AT_SIGHTS"] = {Base = 'WAPScop', Component = "w_at_sights_1"},
-- ["COMPONENT_AT_AR_SUPP"] = {Base = 'WAPSupp', Component = "W_AT_AR_SUPP"},
-- ["COMPONENT_AT_MUZZLE_01"] = {Base = 'WAPSupp', Component = "w_at_muzzle_1"},
-- ["COMPONENT_AT_AR_AFGRIP_02"] = {Base = 'WAPGrip', Component = "w_at_afgrip_2"},
-- ["COMPONENT_CARBINERIFLE_MK2_CAMO"] = {Base = 'Cosmetic', Component = "w_at_cr_camo1"},
-- }
},
["weapon_assaultrifle"] = {
model = "w_ar_assaultrifle",
-- Attachments = {
-- ["COMPONENT_ASSAULTRIFLE_CLIP_01"] = {Base = 'WAPClip', Component = "w_ar_assaultrifle_mag1"},
-- ["COMPONENT_ASSAULTRIFLE_CLIP_02"] = {Base = 'WAPClip', Component = "w_ar_assaultrifle_mag2"},
-- ["COMPONENT_ASSAULTRIFLE_CLIP_03"] = {Base = 'WAPClip', Component = "w_ar_assaultrifle_boxmag"},
-- ["COMPONENT_AT_AR_FLSH"] = {Base = 'WAPFlshLasr', Component = "W_AT_AR_FLSH"},
-- ["COMPONENT_AT_SCOPE_MACRO"] = {Base = 'WAPScop', Component = "w_at_scope_macro"},
-- ["COMPONENT_AT_AR_SUPP_02"] = {Base = 'WAPSupp', Component = "w_at_ar_supp_02"},
-- ["COMPONENT_AT_AR_AFGRIP"] = {Base = 'WAPGrip', Component = "W_AT_AR_AFGRIP"},
-- }
},
["weapon_specialcarbine"] = {
model = "w_ar_specialcarbine",
-- Attachments = {
-- ["COMPONENT_SPECIALCARBINE_CLIP_01"] = {Base = 'WAPClip', Component = "w_ar_specialcarbine_mag1"},
-- ["COMPONENT_SPECIALCARBINE_CLIP_02"] = {Base = 'WAPClip', Component = "w_ar_specialcarbine_mag2"},
-- ["COMPONENT_SPECIALCARBINE_CLIP_03"] = {Base = 'WAPClip', Component = "w_ar_specialcarbine_boxmag"},
-- ["COMPONENT_AT_AR_FLSH"] = {Base = 'WAPFlshLasr', Component = "W_AT_AR_FLSH"},
-- ["COMPONENT_AT_SCOPE_MEDIUM"] = {Base = 'WAPScop', Component = "w_at_scope_medium"},
-- ["COMPONENT_AT_AR_SUPP_02"] = {Base = 'WAPSupp', Component = "w_at_ar_supp_02"},
-- ["COMPONENT_AT_AR_AFGRIP"] = {Base = 'WAPGrip', Component = "W_AT_AR_AFGRIP"},
-- ["COMPONENT_SPECIALCARBINE_VARMOD_LOWRIDER"] = {Base = 'Cosmetic', Component = "w_ar_specialcarbine_luxe"},
-- }
},
["weapon_bullpuprifle"] = {
model = "w_ar_bullpuprifle",
-- Attachments = {
-- ["COMPONENT_BULLPUPRIFLE_CLIP_01"] = {Base = 'WAPClip', Component = "w_ar_bullpuprifle_mag1"},
-- ["COMPONENT_BULLPUPRIFLE_CLIP_02"] = {Base = 'WAPClip', Component = "w_ar_bullpuprifle_mag2"},
-- ["COMPONENT_AT_AR_FLSH"] = {Base = 'WAPFlshLasr', Component = "W_AT_AR_FLSH"},
-- ["COMPONENT_AT_SCOPE_SMALL"] = {Base = 'WAPScop', Component = "w_at_scope_small"},
-- ["COMPONENT_AT_AR_SUPP"] = {Base = 'WAPSupp', Component = "w_at_ar_supp"},
-- ["COMPONENT_AT_AR_AFGRIP"] = {Base = 'WAPGrip', Component = "W_AT_AR_AFGRIP"},
-- }
},
["weapon_advancedrifle"] = {
model = "w_ar_advancedrifle",
-- Attachments = {
-- ["COMPONENT_ADVANCEDRIFLE_CLIP_01"] = {Base = 'WAPClip', Component = "w_ar_advancedrifle_mag1"},
-- ["COMPONENT_ADVANCEDRIFLE_CLIP_02"] = {Base = 'WAPClip', Component = "w_ar_advancedrifle_mag2"},
-- ["COMPONENT_AT_AR_FLSH"] = {Base = 'WAPFlshLasr', Component = "W_AT_AR_FLSH"},
-- ["COMPONENT_AT_SCOPE_SMALL"] = {Base = 'WAPScop', Component = "w_at_scope_small"},
-- ["COMPONENT_AT_AR_SUPP"] = {Base = 'WAPSupp', Component = "w_at_ar_supp"},
-- }
},
-- Sub Machine Guns
["weapon_microsmg"] = {
model = "w_sb_microsmg",
-- Attachments = {
-- ["COMPONENT_MICROSMG_CLIP_01"] = {Base = 'WAPClip', Component = "w_sb_microsmg_mag1"},
-- ["COMPONENT_MICROSMG_CLIP_02"] = {Base = 'WAPClip', Component = "w_sb_microsmg_mag2"},
-- ["COMPONENT_AT_PI_FLSH"] = {Base = 'WAPFlshLasr', Component = "w_at_pi_flsh"},
-- ["COMPONENT_AT_SCOPE_MACRO"] = {Base = 'WAPScop', Component = "w_at_scope_macro"},
-- ["COMPONENT_AT_AR_SUPP_02"] = {Base = 'WAPSupp', Component = "w_at_ar_supp_02"},
-- }
},
["weapon_assaultsmg"] = {
model = "w_sb_assaultsmg",
-- Attachments = {
-- ["COMPONENT_ASSAULTSMG_CLIP_01"] = {Base = 'WAPClip', Component = "W_SB_ASSAULTSMG_Mag1"},
-- ["COMPONENT_ASSAULTSMG_CLIP_02"] = {Base = 'WAPClip', Component = "W_SB_ASSAULTSMG_Mag2"},
-- ["COMPONENT_AT_AR_FLSH"] = {Base = 'WAPFlshLasr', Component = "W_AT_AR_FLSH"},
-- ["COMPONENT_AT_SCOPE_MACRO"] = {Base = 'WAPScop', Component = "w_at_scope_macro"},
-- ["COMPONENT_AT_AR_SUPP_02"] = {Base = 'WAPSupp', Component = "w_at_ar_supp_02"},
-- }
},
["weapon_smg"] = {
model = "w_sb_smg",
-- Attachments = {
-- ["COMPONENT_SMG_CLIP_01"] = {Base = 'WAPClip', Component = "w_sb_smg_mag1"},
-- ["COMPONENT_SMG_CLIP_02"] = {Base = 'WAPClip', Component = "w_sb_smg_mag2"},
-- ["COMPONENT_SMG_CLIP_03"] = {Base = 'WAPClip', Component = "w_sb_smg_boxmag"},
-- ["COMPONENT_AT_AR_FLSH"] = {Base = 'WAPFlshLasr', Component = "W_AT_AR_FLSH"},
-- ["COMPONENT_AT_SCOPE_MACRO_02"] = {Base = 'WAPScop_2', Component = "w_at_scope_macro_2"},
-- ["COMPONENT_AT_PI_SUPP"] = {Base = 'WAPSupp', Component = "w_at_pi_supp"},
-- }
},
["weapon_smg_mk2"] = {
model = "w_sb_smgmk2",
-- Attachments = {
-- ["COMPONENT_SMG_MK2_CLIP_01"] = {Base = 'WAPClip', Component = "w_sb_smgmk2_mag1"},
-- ["COMPONENT_SMG_MK2_CLIP_02"] = {Base = 'WAPClip', Component = "w_sb_smgmk2_mag2"},
-- ["COMPONENT_AT_AR_FLSH"] = {Base = 'WAPFlshLasr', Component = "W_AT_AR_FLSH"},
-- ["COMPONENT_AT_SIGHTS"] = {Base = 'WAPScop', Component = "w_at_sights_1"},
-- ["COMPONENT_AT_SCOPE_SMALL"] = {Base = 'WAPScop', Component = "w_at_scope_small"},
-- ["COMPONENT_AT_AR_AFGRIP_02"] = {Base = 'WAPGrip', Component = "w_at_afgrip_2"},
-- }
},
["weapon_gusenberg"] = {
model = "w_sb_gusenberg",
-- Attachments = {
-- ["COMPONENT_GUSENBERG_CLIP_01"] = {Base = 'WAPClip', Component = "w_sb_gusenberg_mag1"},
-- ["COMPONENT_GUSENBERG_CLIP_02"] = {Base = 'WAPClip', Component = "w_sb_gusenberg_mag2"},
-- }
},
-- Sniper Rifles
["weapon_musket"] = { model = "w_ar_musket" },
["weapon_sniperrifle"] = {
model = "w_sr_sniperrifle",
-- Attachments = {
-- ["COMPONENT_SNIPERRIFLE_CLIP_01"] = {Base = 'WAPClip', Component = "w_sr_sniperrifle_mag1"},
-- ["COMPONENT_AT_SCOPE_LARGE"] = {Base = 'WAPScop', Component = "w_at_scope_large"},
-- ["COMPONENT_AT_SCOPE_MAX"] = {Base = 'WAPScop', Component = "w_at_scope_max"},
-- ["COMPONENT_AT_AR_SUPP_02"] = {Base = 'WAPSupp', Component = "w_at_ar_supp_02"},
-- }
},
-- Shotguns
["weapon_sawnoffshotgun"] = { model = "w_sg_sawnoff" },
["weapon_assaultshotgun"] = {
model = "w_sg_assaultshotgun",
-- Attachments = {
-- ["COMPONENT_ASSAULTSHOTGUN_CLIP_01"] = {Base = 'WAPClip', Component = "w_sg_assaultshotgun_mag1"},
-- ["COMPONENT_ASSAULTSHOTGUN_CLIP_02"] = {Base = 'WAPClip', Component = "w_sg_assaultshotgun_mag2"},
-- ["COMPONENT_AT_AR_FLSH"] = {Base = 'WAPFlshLasr', Component = "W_AT_AR_FLSH"},
-- ["COMPONENT_AT_AR_SUPP"] = {Base = 'WAPSupp', Component = "w_at_ar_supp"},
-- ["COMPONENT_AT_AR_AFGRIP"] = {Base = 'WAPGrip', Component = "w_at_ar_afgrip"},
-- }
},
["weapon_bullpupshotgun"] = {
model = "w_sg_bullpupshotgun",
-- Attachments = {
-- ["COMPONENT_AT_AR_FLSH"] = {Base = 'WAPFlshLasr', Component = "W_AT_AR_FLSH"},
-- ["COMPONENT_AT_AR_SUPP_02"] = {Base = 'WAPSupp', Component = "w_at_ar_supp_02"},
-- ["COMPONENT_AT_AR_AFGRIP"] = {Base = 'WAPGrip', Component = "w_at_ar_afgrip"},
-- }
},
["weapon_pumpshotgun"] = {
model = "w_sg_pumpshotgun",
-- Attachments = {
-- ["COMPONENT_AT_AR_FLSH"] = {Base = 'WAPFlshLasr', Component = "W_AT_AR_FLSH"},
-- ["COMPONENT_AT_SR_SUPP"] = {Base = 'WAPSupp', Component = "W_AT_AR_SUPP"},
-- }
},
["weapon_heavyshotgun"] = {
model = "w_sg_heavyshotgun",
-- Attachments = {
-- ["COMPONENT_HEAVYSHOTGUN_CLIP_01"] = {Base = 'WAPClip', Component = "w_sg_heavyshotgun_mag1"},
-- ["COMPONENT_HEAVYSHOTGUN_CLIP_02"] = {Base = 'WAPClip', Component = "w_sg_heavyshotgun_mag2"},
-- ["COMPONENT_HEAVYSHOTGUN_CLIP_03"] = {Base = 'WAPClip', Component = "w_sg_heavyshotgun_boxmag"},
-- ["COMPONENT_AT_AR_FLSH"] = {Base = 'WAPFlshLasr', Component = "W_AT_AR_FLSH"},
-- ["COMPONENT_AT_AR_SUPP_02"] = {Base = 'WAPSupp', Component = "w_at_ar_supp_02"},
-- ["COMPONENT_AT_AR_AFGRIP"] = {Base = 'WAPGrip', Component = "w_at_ar_afgrip"},
-- }
},
-- Melee Weapons
["weapon_machete"] = { model = "w_me_machette_lr" },
["weapon_bat"] = { model = "w_me_bat" },
-- Items
["cokebaggy"] = { model = "bkr_prop_coke_cutblock_01" },
["markedbills"] = { model = "prop_money_bag_01" },
["meth"] = { model = "hei_prop_pill_bag_01" },
["weed_brick"] = { model = "bkr_prop_weed_drying_02a" },
["fishingrod"] = { model = "prop_fishing_rod_02" },
["fishingrod2"] = { model = "prop_fishing_rod_01" },
["fishingrod3"] = { model = "prop_fishing_rod_01" },
-- Addon weapons
-- ["weapon_katana"] = { model = "w_me_katana"},
-- ["weapon_remington"] = { model = "w_sg_remington" },
-- ["weapon_mp5"] = { model = "w_sb_mp5" },
-- ["weapon_huntingrifle"] = { model = "w_sr_huntingrifle" },
}
------------------------------
------------------------------
--## DONT CHANGE ANY OF THESE ##--
Config.FrameworkFunctions = {
-- Client-side trigger callback
TriggerCallback = function(...)
if Framework == 'QBCore' then
FWork.Functions.TriggerCallback(...)
else
FWork.TriggerServerCallback(...)
end
end,
-- Server-side register callback
CreateCallback = function(...)
if Framework == 'QBCore' then
FWork.Functions.CreateCallback(...)
else
FWork.RegisterServerCallback(...)
end
end,
GetPlayer = function()
local self = {}
if Framework == 'QBCore' then
player = FWork.Functions.GetPlayerData()
self.PlayerData = { job = { name = player.job.name} }
return self
else
player = FWork.GetPlayerData()
self.PlayerData = { job = { name = player.job.name }}
return self
end
return nil
end,
}
------------------------------
------------------------------
end

View file

@ -1,31 +0,0 @@
lua54 'yes'
fx_version 'cerulean'
game 'gta5'
author 'Discord: zpug'
description 'pug-sling'
version '2.1.3'
shared_scripts {
'config.lua',
'old-sling/config-old.lua',
}
server_script 'server/main.lua'
client_script {
'client/main.lua',
'client/open.lua',
'old-sling/client-old.lua',
}
file 'json/config-weapons.json'
escrow_ignore {
'config.lua',
'client/open.lua',
'server/main.lua',
'json/config-weapons.json',
'old-sling/config-old.lua',
}
dependency '/assetpacks'

View file

@ -1 +0,0 @@
[{"z":0.17,"WeaponModel":"fishingrod","bone":36,"zR":-13.5,"WeaponProp":"prop_fishing_rod_02","yR":103.34645567461848,"xR":-9.01574753224849,"x":0.0,"y":-0.08999999999999},{"z":0.03999999999999,"WeaponModel":"weapon_pistol","bone":36,"zR":0.0,"WeaponProp":"w_pi_pistol","yR":-209.99999856576324,"xR":-185.59054903686048,"x":-0.13999999999999,"y":-0.13999999999999},{"z":0.14999999999999,"WeaponModel":"fishingrod2","bone":36,"zR":-9.0,"WeaponProp":"prop_fishing_rod_01","yR":114.92125941440465,"xR":-18.54330701753497,"x":0.0,"y":-0.10999999999999},{"z":-0.08,"WeaponModel":"weapon_advancedrifle","bone":36,"zR":-1.5,"WeaponProp":"w_ar_advancedrifle","yR":-180.27558963745833,"xR":3.85826759040355,"x":0.06999999999999,"y":-0.14999999999999},{"z":0.03,"WeaponModel":"weapon_bat","bone":36,"zR":-1.5,"WeaponProp":"w_me_bat","yR":95.1181093044579,"xR":-2.36220469698309,"x":0.0,"y":-0.15999999999999},{"z":-0.04999999999999,"WeaponModel":"weapon_carbinerifle_mk2","bone":36,"zR":1.5,"WeaponProp":"w_ar_carbineriflemk2","yR":130.62992081046105,"xR":1.53543286025524,"x":0.29,"y":-0.16999999999999},{"z":0.04999999999999,"WeaponModel":"weapon_carbinerifle","bone":36,"zR":-7.5,"WeaponProp":"w_ar_carbinerifle","yR":64.48818914592266,"xR":0.51181092858314,"x":0.17,"y":0.17},{"z":0.07,"WeaponModel":"weapon_bullpupshotgun","bone":36,"zR":-4.5,"WeaponProp":"w_sg_bullpupshotgun","yR":0.0,"xR":0.0,"x":0.0,"y":-0.13999999999999},{"z":-0.10999999999999,"WeaponModel":"weapon_musket","bone":36,"zR":0.0,"WeaponProp":"w_ar_musket","yR":186.1023604311049,"xR":0.51181094720959,"x":0.39,"y":-0.15999999999999},{"z":0.21,"WeaponModel":"weapon_sawnoffshotgun","bone":36,"zR":-36.0,"WeaponProp":"w_sg_sawnoff","yR":121.37795131653549,"xR":20.82677146419882,"x":0.4,"y":0.02},{"z":0.03,"WeaponModel":"weed_brick","bone":36,"zR":-15.0,"WeaponProp":"bkr_prop_weed_drying_02a","yR":-61.33858216926455,"xR":-1.61417311057448,"x":0.0,"y":-0.2},{"z":0.09,"WeaponModel":"weapon_compactrifle","bone":36,"zR":-4.5,"WeaponProp":"w_ar_assaultrifle_smg","yR":55.31496053561568,"xR":8.14960626885295,"x":0.0,"y":0.17},{"z":0.12999999999999,"WeaponModel":"meth","bone":36,"zR":-19.5,"WeaponProp":"hei_prop_pill_bag_01","yR":96.22047184035182,"xR":-7.5984251499176,"x":-0.24,"y":-0.09999999999999},{"z":0.06,"WeaponModel":"weapon_bullpuprifle","bone":36,"zR":0.0,"WeaponProp":"w_ar_bullpuprifle","yR":0.0,"xR":0.0,"x":0.17,"y":-0.14999999999999},{"z":-0.15,"WeaponModel":"fishingrod3","bone":36,"zR":-15.0,"WeaponProp":"prop_fishing_rod_01","yR":77.51968448981643,"xR":-18.7795277684927,"x":0.0,"y":-0.10999999999999},{"z":0.2,"WeaponModel":"weapon_machete","bone":36,"zR":-1.5,"WeaponProp":"w_me_machette_lr","yR":-75.86614115163684,"xR":-71.1417325772345,"x":-0.06,"y":-0.04999999999999},{"z":0.05,"WeaponModel":"weapon_heavyshotgun","bone":36,"zR":1.5,"WeaponProp":"w_sg_heavyshotgun","yR":61.0629915446043,"xR":-2.75590546429157,"x":0.13999999999999,"y":-0.14999999999999},{"z":0.08,"WeaponModel":"weapon_pumpshotgun","bone":36,"zR":12.0,"WeaponProp":"w_sg_pumpshotgun","yR":83.81889715790749,"xR":1.33858261629939,"x":0.35,"y":-0.15999999999999},{"z":-0.23,"WeaponModel":"cokebaggy","bone":36,"zR":84.0,"WeaponProp":"bkr_prop_coke_cutblock_01","yR":-2.44094524532556,"xR":5.3937011770904,"x":-0.3,"y":0.05},{"z":0.06,"WeaponModel":"weapon_assaultsmg","bone":36,"zR":-6.0,"WeaponProp":"w_sb_assaultsmg","yR":26.57480303198099,"xR":-9.96062995865941,"x":0.11999999999999,"y":-0.14999999999999},{"z":-0.09999999999999,"WeaponModel":"weapon_assaultshotgun","bone":36,"zR":0.0,"WeaponProp":"w_sg_assaultshotgun","yR":39.88188944756985,"xR":-171.22047116979958,"x":0.11999999999999,"y":-0.14999999999999},{"z":0.06,"WeaponModel":"weapon_specialcarbine","bone":36,"zR":0.0,"WeaponProp":"w_ar_specialcarbine","yR":0.39370089769363,"xR":1.18110233917832,"x":0.22,"y":-0.15999999999999},{"z":-0.10999999999999,"WeaponModel":"weapon_sniperrifle","bone":36,"zR":0.0,"WeaponProp":"w_sr_sniperrifle","yR":-1.33858224377036,"xR":185.2755897305906,"x":0.05,"y":-0.14999999999999},{"z":0.09999999999999,"WeaponModel":"weapon_smg","bone":36,"zR":-12.0,"WeaponProp":"w_sb_smg","yR":60.98425174131989,"xR":15.47244081273675,"x":0.19,"y":0.14},{"z":-0.02,"WeaponModel":"weapon_microsmg","bone":36,"zR":-10.5,"WeaponProp":"w_sb_microsmg","yR":66.81102283298969,"xR":180.23622082546354,"x":0.24,"y":0.16},{"z":0.04,"WeaponModel":"weapon_gusenberg","bone":36,"zR":0.0,"WeaponProp":"w_sb_gusenberg","yR":0.0,"xR":0.0,"x":0.28,"y":-0.14999999999999},{"z":-0.15999999999999,"WeaponModel":"markedbills","bone":36,"zR":-10.5,"WeaponProp":"prop_money_bag_01","yR":88.93700690940023,"xR":21.37795263901353,"x":-0.52,"y":-0.07999999999999}]

View file

@ -1,107 +0,0 @@
if Config.UseOldSlingScript then
Config2 = {}
Config2.CoreName = "qb-core" -- Only change this if you have changed your core name.
Config2.Inventory = "qb-inventory" -- Inventory type (ox_inventory, qb-inventory, lj-inventory etc.)
Config2.LoopSpeed = 500 -- How fast the loop to check weapons runs. Lower numbers are lest optimized.
Config2.Placement = {
["Back"] = {
bone = 24816,
x = 0.275, -- up and down
y = -0.165, -- in and out
z = 0.02, -- left and right
x_rotation = 0.0,
y_rotation = 0.0,
z_rotation = 0.0
},
["Front"] = {
bone = 10706,
x = 0.0, -- up and down
y = 0.19, -- in and out
z = -0.25, -- left and right
x_rotation = 0.0, -- flips the gun how you would want
y_rotation = 75.0, -- tilts sideways
z_rotation = 180.0 -- tilts into ped
}
}
Config2.PlacementSecond = {
["Back"] = {
bone = 24816,
x = 0.235, -- up and down
y = -0.165, -- in and out
z = -0.08, -- left and right
x_rotation = 180.0, -- flips the gun how you would want
y_rotation = 0.0, -- tilts sideways
z_rotation = 0.0 -- tilts into ped
},
["Front"] = {
bone = 24816,
x = 0.275, -- up and down
y = -0.165, -- in and out
z = 0.02, -- left and right
x_rotation = 0.0, -- flips the gun how you would want
y_rotation = 0.0, -- tilts sideways
z_rotation = 0.0 -- tilts into ped
}
}
Config2.PlacementThird = {
["Back"] = {
bone = 10706,
x = 0.0, -- up and down
y = 0.19, -- in and out
z = -0.25, -- left and right
x_rotation = 0.0, -- flips the gun how you would want
y_rotation = 75.0, -- tilts sideways
z_rotation = 180.0 -- tilts into ped
},
["Front"] = {
bone = 24816,
x = 0.235, -- up and down
y = -0.165, -- in and out
z = -0.08, -- left and right
x_rotation = 180.0, -- flips the gun how you would want
y_rotation = 0.0, -- tilts sideways
z_rotation = 0.0 -- tilts into ped
}
}
-- To add custom rotations to items or weapons all you need to do is add the "x_rotation = 0.0, y_rotation = 90.0, z_rotation = 0.0"
-- as seen for the "weapon_machete" for example and adjust the values of the rotations.
Config2.WeaponsOnBack = {
-- assault rifles:
["weapon_carbinerifle"] = { model = "w_ar_carbinerifle" },
["weapon_compactrifle"] = { model = "w_ar_assaultrifle_smg" },
["weapon_carbinerifle_mk2"] = { model = "w_ar_carbineriflemk2" },
["weapon_assaultrifle"] = { model = "w_ar_assaultrifle" },
["weapon_specialcarbine"] = { model = "w_ar_specialcarbine" },
["weapon_bullpuprifle"] = { model = "w_ar_bullpuprifle" },
["weapon_advancedrifle"] = { model = "w_ar_advancedrifle" },
-- sub machine guns:
["weapon_microsmg"] = { model = "w_sb_microsmg" },
["weapon_assaultsmg"] = { model = "w_sb_assaultsmg" },
["weapon_smg"] = { model = "w_sb_smg" },
["weapon_smg_mk2"] = { model = "w_sb_smgmk2" },
["weapon_gusenberg"] = { model = "w_sb_gusenberg" },
-- sniper rifles:
["weapon_sniperrifle"] = { model = "w_sr_sniperrifle" },
-- shotguns:
["weapon_sawnoffshotgun"] = { model = "w_sg_sawnoff" },
["weapon_assaultshotgun"] = { model = "w_sg_assaultshotgun" },
["weapon_bullpupshotgun"] = { model = "w_sg_bullpupshotgun" },
["weapon_pumpshotgun"] = { model = "w_sg_pumpshotgun" },
["weapon_musket"] = { model = "w_ar_musket" },
["weapon_heavyshotgun"] = { model = "w_sg_heavyshotgun" },
-- mele weapons
["weapon_machete"] = { model = "w_me_machette_lr", x_rotation = 0.0, y_rotation = 90.0, z_rotation = 0.0 },
["weapon_bat"] = { model = "w_me_bat", x_rotation = 0.0, y_rotation = 90.0, z_rotation = 0.0 },
["coke_brick"] = { model = "bkr_prop_coke_cutblock_01", x_rotation = 0.0, y_rotation = 90.0, z_rotation = 90.0 },
["markedbills"] = { model = "prop_money_bag_01", x_rotation = 0.0, y_rotation = 90.0, z_rotation = 0.0 },
-- Addon weapons
["weapon_katana"] = { model = "w_me_katana", x_rotation = 0.0, y_rotation = 90.0, z_rotation = 0.0 },
["weapon_remington"] = { model = "w_sg_remington" },
["weapon_mp5"] = { model = "w_sb_mp5" },
["weapon_huntingrifle"] = { model = "w_sr_huntingrifle" },
}
end

View file

@ -1,40 +0,0 @@
# pug-sling
Advanced weapons slings for the qbcore framework. Any weapon in the players inventory will show up on there back.
# -- if you are using ox_inventory make sure to change Config.Inventory no other inventory name matters.
# -- If you are using illenium-appearance make sure to head to illenium-appearance/server/server.lua and replace these commands with these.
lib.addCommand("reloadskin", { help = _L("commands.reloadskin.title") }, function(source)
local src = source
TriggerClientEvent("illenium-appearance:client:reloadSkin", src)
Wait(500)
TriggerClientEvent("Pug:ReloadGuns:sling", src)
end)
lib.addCommand("clearstuckprops", { help = _L("commands.clearstuckprops.title") }, function(source)
local src = source
TriggerClientEvent("illenium-appearance:client:ClearStuckProps", src)
Wait(500)
TriggerClientEvent("Pug:ReloadGuns:sling", src)
end)
# --
# -- Support
Full support provided in my discord here: https://discord.gg/jYZuWYjfvq
# --
# -- My other scripts
https://pug-webstore.tebex.io/
# --
# -- Config file
To add a new weapon you must change the first option to the qbcore shared.lua.
# --
# -- Commands
`/sling` - Will toggle the weapon placement on the front and back.
# --
# -- Use this event to clear items stuck on players without removing the weapons on the players back
TriggerEvent("Pug:ReloadGuns:sling")
# --

View file

@ -1,56 +0,0 @@
# pug-sling 2.0
# -- If you are using illenium-appearance make sure to head to illenium-appearance/server/server.lua and replace these commands with these.
lib.addCommand("reloadskin", { help = _L("commands.reloadskin.title") }, function(source)
local src = source
TriggerClientEvent("illenium-appearance:client:reloadSkin", src)
Wait(500)
TriggerClientEvent("Pug:ReloadGuns:sling", src)
end)
lib.addCommand("clearstuckprops", { help = _L("commands.clearstuckprops.title") }, function(source)
local src = source
TriggerClientEvent("illenium-appearance:client:ClearStuckProps", src)
Wait(500)
TriggerClientEvent("Pug:ReloadGuns:sling", src)
end)
# --
# -- Use this event to clear items stuck on players without removing the weapons on the players back
TriggerEvent("Pug:ReloadGuns:sling")
# --
Advanced Weapon Sling | Weapons On Back: For any questions please contact me here: https://discord.com/invite/jYZuWYjfvq
PREVIEW HERE: https://youtu.be/hluGYRiVY1E
This script is partially locked using escrow encryption. Most of the script is accessible in client/open.lua, and config.lua.
Full QBCore & ESX Compatibility.
This completely configurable script consist of:
● Wearable weapons and items that are placed onto the player when they have the set weapon or item anywhere within their inventory.
● Advanced system controlling and moving around items/weapons in 3D space to get the best position of where the items/weapons should sit on the player.
● Option for individual players to tailor the placement of items and weapons on their characters, enabling unique item positioning for each player. (QBCORE ONLY)
● Full control over the items/weapons with the ability to adjust rotation, XYZ position, and edit the entire script from in-game without doing any code or configuring.
● /rack Command Utilizes the custom weapon racking system, which is exclusively available for select jobs and used to store weapons in emergency service vehicles.
● Version 1.0 comes with this script and is a completely different system shown off and explained in the video.
● Anti-Car tornadoing mechanics designed to prevent car tornadoing from ever occurring on your server.
● /weaponposition command for individual players to set personal weapon and item placements (optional).
● /setweapon command to begin editing where the weapons/items should sit on the player.
● Advanced checks to avoid and stop car tornadoing that occurs in every FiveM server.
● 30 weapons and items pre-configured for you.
● 0:00 ms ResMon for complete optimization.
● qb-inventory support.
● ox_inventory support.
● qs-inventory support.
● ps-inventory support.
● Request inventory support and i will do it for this script if it is possible.
Requirements consist of:
QBCore OR ESX (other frameworks will work but not supported)
qb-inventory OR ox_inventory OR qs-inventory OR ps-inventory (any qb-inventory resource name changed will work)
1400 LINES OF CODE

View file

@ -1,65 +0,0 @@
if not Config.UseOldSlingScript then
Config.FrameworkFunctions.CreateCallback('Pug:server:GetWeaponConfig', function(source, cb)
local File = LoadResourceFile(GetCurrentResourceName(), "./json/config-weapons.json")
cb(File)
end)
RegisterNetEvent("Pug:server:SaveWeaponFile", function(JsonWeapons, Personal)
local src = source
if Personal then
if Framework == "QBCore" then
local Player = FWork.Functions.GetPlayer(src)
if Player ~= nil then
Player.Functions.SetMetaData("pug-weapondata", JsonWeapons)
Player.Functions.Save()
end
else
end
else
local JsonWeapon = json.encode(JsonWeapons)
SaveResourceFile(GetCurrentResourceName(), "./json/config-weapons.json", JsonWeapon)
TriggerClientEvent("Pug:client:RegisterAllBackWeapons", -1, JsonWeapon)
end
end)
---------- [OX_INVENTORY RACK STASH SUPPORT] ----------
local StashCreated = {}
RegisterNetEvent("Pug:server:SlingOpenOxInvRack", function(StashName, Slots, Space)
if not StashCreated[StashName] then
StashCreated[StashName] = true
exports.ox_inventory:RegisterStash(
StashName,
StashName,
Slots,
Space
)
end
end)
------------------------------
---------- [Commands] ----------
if Framework == "QBCore" then
FWork.Commands.Add(Config.WeaponSettingCommand, "Adjust server weapons positions", {}, false, function(source, args)
local src = source
TriggerClientEvent("Pug:client:OpenSlingEditor",src)
end,"admin")
FWork.Commands.Add(Config.PersonalWeponSettingsCommand, "Adjust personal weapons positions", {}, false, function(source, args)
local src = source
TriggerClientEvent("Pug:client:OpenSlingEditor",src, true)
end)
else
FWork.RegisterCommand(Config.WeaponSettingCommand, 'admin', function(xPlayer, args)
local src = xPlayer.source
TriggerClientEvent("Pug:client:OpenSlingEditor",src)
end, true, {help = 'Create business menu', validate = true, arguments = {} })
FWork.RegisterCommand(Config.PersonalWeponSettingsCommand, 'admin', function(xPlayer, args)
local src = xPlayer.source
TriggerClientEvent("Pug:client:OpenSlingEditor",src, true)
end, true, {help = 'Create business menu', validate = true, arguments = {} })
end
------------------------------
end