forked from Simnation/Main
ed
This commit is contained in:
parent
aca2e75b3b
commit
2e1498dd79
9 changed files with 5 additions and 5 deletions
411
resources/[weapons]/[Scripts]/nordi_weapon_handling/client.lua
Normal file
411
resources/[weapons]/[Scripts]/nordi_weapon_handling/client.lua
Normal file
|
@ -0,0 +1,411 @@
|
|||
local lockKey = Config.LockKey
|
||||
local breathing = false
|
||||
local stamina = false
|
||||
local staminaval = Config.Stamina
|
||||
|
||||
local sniperRifle = 100416529
|
||||
local heavySniper = 205991906
|
||||
local heavySniperMk2 = 177293209
|
||||
local marksmanRifle = -952879014
|
||||
|
||||
local grenade = -1813897027
|
||||
local stickybomb = 741814745
|
||||
local proxmine = -1420407917
|
||||
local pipebomb = -1169823560
|
||||
|
||||
function notify(text)
|
||||
SetNotificationTextEntry("STRING")
|
||||
AddTextComponentString(text)
|
||||
DrawNotification(true, false)
|
||||
end
|
||||
|
||||
if Config.UseLindenInventory == false then
|
||||
if Config.AutoReload then
|
||||
SetWeaponsNoAutoreload(false)
|
||||
else
|
||||
SetWeaponsNoAutoreload(true)
|
||||
end
|
||||
end
|
||||
|
||||
Citizen.CreateThread(function()
|
||||
while true do
|
||||
Citizen.Wait(10)
|
||||
|
||||
local playerPed = GetPlayerPed(-1)
|
||||
local player = PlayerId()
|
||||
|
||||
hasWeapon,pedWeapon = GetCurrentPedWeapon(playerPed)
|
||||
|
||||
if hasWeapon ~= false and pedWeapon ~= 0 then
|
||||
while hasWeapon ~= false do
|
||||
Citizen.Wait(1)
|
||||
local hasWeapon, pedWeapon = GetCurrentPedWeapon(playerPed)
|
||||
local weaponType = GetWeaponDamageType(pedWeapon)
|
||||
local weaponShootingType = GetWeapontypeGroup(pedWeapon)
|
||||
|
||||
|
||||
while not HasAnimDictLoaded("mp_arresting") do
|
||||
Citizen.Wait(1)
|
||||
RequestAnimDict("mp_arresting")
|
||||
end
|
||||
|
||||
if pedWeapon == grenade or pedWeapon == stickybomb or pedWeapon == proxmine or pedWeapon == pipebomb then
|
||||
break
|
||||
end
|
||||
|
||||
if weaponType == 1 or weaponType == 2 or weaponType == 12 or weaponType == 6 or weaponType == 14 or weaponType == 13 then
|
||||
break
|
||||
else
|
||||
if not Config.UseCrosshair then
|
||||
HideHudComponentThisFrame(14)
|
||||
|
||||
if pedWeapon == sniperRifle or pedWeapon == heavySniper or pedWeapon == heavySniperMk2 or pedWeapon == marksmanRifle then
|
||||
ShowHudComponentThisFrame(14)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
if Config.UseWeaponLock == true then
|
||||
if Config.WeaponLock[pedWeapon] == 0 then
|
||||
if IsPedInAnyVehicle(playerPed, true) then
|
||||
|
||||
if IsControlJustPressed(0, lockKey) and Config.WeaponsNoLock[pedWeapon] == false then
|
||||
Config.WeaponLock[pedWeapon] = 1
|
||||
if Config.WeaponLockMessage then
|
||||
if Config.UseBigNotify then
|
||||
exports['b1g_notify']:Notify('true', str_weapon_locked)
|
||||
|
||||
else
|
||||
notify(str_weapon_locked)
|
||||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
|
||||
if IsControlJustPressed(0, lockKey) and Config.WeaponsNoLock[pedWeapon] == false then
|
||||
Config.WeaponLock[pedWeapon] = 1
|
||||
if Config.WeaponLockMessage then
|
||||
if Config.UseBigNotify then
|
||||
exports['b1g_notify']:Notify('true', str_weapon_locked)
|
||||
else
|
||||
notify(str_weapon_locked)
|
||||
end
|
||||
end
|
||||
RequestAnimDict("mp_arresting")
|
||||
TaskPlayAnim(playerPed, "mp_arresting", "a_uncuff", 2.0, 2.0, 1000, 52, 0, false, false, false)
|
||||
end
|
||||
end
|
||||
else
|
||||
if IsPedInAnyVehicle(playerPed, true) then
|
||||
|
||||
if IsControlJustPressed(0, lockKey) and Config.WeaponsNoLock[pedWeapon] == false then
|
||||
Config.WeaponLock[pedWeapon] = 0
|
||||
if Config.WeaponLockMessage then
|
||||
if Config.UseBigNotify then
|
||||
exports['b1g_notify']:Notify('adm', str_weapon_unlocked)
|
||||
else
|
||||
notify(str_weapon_unlocked)
|
||||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
|
||||
if IsControlJustPressed(0, lockKey) and Config.WeaponsNoLock[pedWeapon] == false then
|
||||
Config.WeaponLock[pedWeapon] = 0
|
||||
if Config.WeaponLockMessage then
|
||||
if Config.UseBigNotify then
|
||||
exports['b1g_notify']:Notify('adm', str_weapon_unlocked)
|
||||
else
|
||||
notify(str_weapon_unlocked)
|
||||
end
|
||||
end
|
||||
RequestAnimDict("mp_arresting")
|
||||
TaskPlayAnim(playerPed, "mp_arresting", "a_uncuff", 2.0, 2.0, 1000, 52, 0, false, false, false)
|
||||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
end
|
||||
|
||||
|
||||
if Config.UseWeaponLock == false or Config.WeaponLock[pedWeapon] == 0 or Config.WeaponsNoLock[pedWeapon] then
|
||||
|
||||
if IsPedShooting(playerPed) then
|
||||
|
||||
local _,pedWeapon = GetCurrentPedWeapon(playerPed)
|
||||
|
||||
local pedCamPitch = GetGameplayCamRelativePitch()
|
||||
local weaponRecoil = Config.WeaponRecoil[pedWeapon]
|
||||
if weaponRecoil == nil then
|
||||
weaponRecoil = Config.StandardWerte.Recoil
|
||||
end
|
||||
local weaponShake = Config.WeaponShake[pedWeapon]
|
||||
if weaponShake == nil then
|
||||
weaponShake = Config.StandardWerte.Shake
|
||||
end
|
||||
local recoilSpeed = Config.WeaponRecoilSpeed
|
||||
ViewMode = GetFollowPedCamViewMode()
|
||||
|
||||
if ViewMode == 4 then
|
||||
newWeaponRecoil = weaponRecoil * Config.FirstPersonRecoilFactor
|
||||
SetGameplayCamRelativePitch(pedCamPitch + newWeaponRecoil, recoilSpeed)
|
||||
else
|
||||
SetGameplayCamRelativePitch(pedCamPitch + weaponRecoil, recoilSpeed)
|
||||
end
|
||||
|
||||
if Config.WeaponShake and stamina == false then
|
||||
ShakeGameplayCam("SMALL_EXPLOSION_SHAKE", weaponShake)
|
||||
end
|
||||
if Config.UseCustomDamage then
|
||||
SetWeaponDamageModifierThisFrame(pedWeapon, Config.WeaponDamage[pedWeapon] or Config.StandardWerte.Damage)
|
||||
end
|
||||
|
||||
if Config.UseScreenEffect then
|
||||
AnimpostfxPlay(Config.ScreenEffect, Config.ScreenEffectLength, Config.ScreenEffectLoop)
|
||||
end
|
||||
|
||||
if IsPedInAnyVehicle(playerPed, true) then
|
||||
Citizen.Wait(0)
|
||||
PedVehicle = GetVehiclePedIsIn(playerPed, false)
|
||||
PedVehicleType = GetVehicleClass(PedVehicle)
|
||||
|
||||
for class, allowed in pairs(Config.VehicleWhitelist) do
|
||||
if class == PedVehicleType and allowed == true then
|
||||
local vehRecoilVal = Config.VehicleRecoilValue
|
||||
local vehShakeVal = Config.VehicleShakeValue
|
||||
|
||||
if not Config.UseCrosshair then
|
||||
HideHudComponentThisFrame(14)
|
||||
end
|
||||
|
||||
if Config.VehicleRecoil then
|
||||
SetGameplayCamRelativePitch(pedCamPitch + weaponRecoil + vehRecoilVal, recoilSpeed)
|
||||
if Config.VehicleShake then
|
||||
ShakeGameplayCam("SMALL_EXPLOSION_SHAKE", weaponShake + vehShakeVal)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
shooting = true
|
||||
end
|
||||
|
||||
|
||||
if hasWeapon == false then
|
||||
break
|
||||
end
|
||||
else
|
||||
DisablePlayerFiring(player, true)
|
||||
if IsControlJustPressed(0, 237) then
|
||||
if Config.WeaponLockMessage then
|
||||
if Config.UseBigNotify then
|
||||
exports['b1g_notify']:Notify('false', str_weapon_still_locked)
|
||||
else
|
||||
notify(str_weapon_still_locked)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
if hasWeapon == false then
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
--[[STAMINA SYSTEM]]--
|
||||
if Config.UseStaminaSystem then
|
||||
if shooting and IsControlPressed(0, 25) and staminaval > 0 then
|
||||
|
||||
if stamina then
|
||||
shooting = false
|
||||
else
|
||||
shooting = false
|
||||
end
|
||||
end
|
||||
|
||||
if not IsGameplayCamShaking() and IsControlPressed(0, 25) then
|
||||
ShakeGameplayCam("HAND_SHAKE", Config.BreathingValueNormal)
|
||||
end
|
||||
|
||||
if IsControlJustPressed(0, 25) then
|
||||
ShakeGameplayCam("HAND_SHAKE", Config.BreathingValueNormal)
|
||||
|
||||
local player = GetPlayerServerId(PlayerId())
|
||||
if IsControlPressed(0, 25) then
|
||||
if IsPedShooting(playerPed) then
|
||||
ShakeGameplayCam("HAND_SHAKE", Config.BreathingValueNormal)
|
||||
end
|
||||
end
|
||||
breathing = true
|
||||
end
|
||||
|
||||
if IsControlJustReleased(0, 25) then
|
||||
StopGameplayCamShaking(true)
|
||||
breathing = false
|
||||
stamina = false
|
||||
end
|
||||
|
||||
if IsControlJustPressed(0, 21) and breathing == true and staminaval ~= 0 then
|
||||
ShakeGameplayCam("HAND_SHAKE", Config.BreathingValueHoldBreath)
|
||||
stamina = true
|
||||
end
|
||||
|
||||
if stamina and staminaval >= 0 then
|
||||
staminaval = staminaval -1
|
||||
if staminaval == 0 then
|
||||
ShakeGameplayCam("HAND_SHAKE", Config.BreathingValueNormal + Config.BreathingValueNoStamina)
|
||||
DisableControlAction(0, 21, true)
|
||||
AnimpostfxPlay("SwitchHUDIn", 0, false)
|
||||
end
|
||||
else
|
||||
if staminaval < Config.Stamina then
|
||||
staminaval = staminaval + 1
|
||||
|
||||
if IsControlJustPressed(0, 24) then
|
||||
ShakeGameplayCam("HAND_SHAKE", Config.BreathingValueNormal + Config.BreathingValueNoStamina)
|
||||
end
|
||||
|
||||
if staminaval > Config.StaminaTreshold then
|
||||
AnimpostfxStopAll()
|
||||
DisableControlAction(0, 21, false)
|
||||
stamina = false
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--[[FIRING MODES]]--
|
||||
if Config.UseWeaponFiringMode then
|
||||
if weaponShootingType == -957766203 or weaponShootingType == 970310034 then
|
||||
if IsPedInAnyVehicle(playerPed, true) then
|
||||
if IsControlJustPressed(0, Config.WeaponFiringModeKey) then
|
||||
if Config.WeaponFiringMode[pedWeapon] == 1 then
|
||||
Config.WeaponFiringMode[pedWeapon] = 0
|
||||
if Config.UseBigNotify then
|
||||
exports['b1g_notify']:Notify('true', str_firing_mode_auto)
|
||||
else
|
||||
notify(str_firing_mode_auto)
|
||||
end
|
||||
else
|
||||
Config.WeaponFiringMode[pedWeapon] = 1
|
||||
if Config.UseBigNotify then
|
||||
exports['b1g_notify']:Notify('true', str_firing_mode_single)
|
||||
else
|
||||
notify(str_firing_mode_single)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if Config.WeaponFiringMode[pedWeapon] == 1 then
|
||||
if IsPedDoingDriveby(playerPed) then
|
||||
local _,pedWeapon = GetCurrentPedWeapon(playerPed)
|
||||
local pedCamPitch = GetGameplayCamRelativePitch()
|
||||
local weaponRecoil = Config.WeaponRecoil[pedWeapon]
|
||||
local weaponShake = Config.WeaponShake[pedWeapon]
|
||||
local recoilSpeed = Config.WeaponRecoilSpeed
|
||||
local vehRecoilVal = Config.VehicleRecoilValue
|
||||
local vehShakeVal = Config.VehicleShakeValue
|
||||
|
||||
while IsControlPressed(0, 24) or IsDisabledControlPressed(0, 24) do
|
||||
Citizen.Wait(5)
|
||||
DisablePlayerFiring(player, true)
|
||||
if not Config.UseCrosshair then
|
||||
HideHudComponentThisFrame(14)
|
||||
end
|
||||
if Config.VehicleRecoil then
|
||||
SetGameplayCamRelativePitch(pedCamPitch + weaponRecoil + vehRecoilVal, recoilSpeed)
|
||||
if Config.VehicleShake then
|
||||
ShakeGameplayCam("SMALL_EXPLOSION_SHAKE", weaponShake + vehShakeVal)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
else
|
||||
if IsControlJustPressed(0, Config.WeaponFiringModeKey) then
|
||||
if Config.WeaponFiringMode[pedWeapon] == 1 then
|
||||
Config.WeaponFiringMode[pedWeapon] = 0
|
||||
if Config.UseBigNotify then
|
||||
exports['b1g_notify']:Notify('true', str_firing_mode_auto)
|
||||
else
|
||||
notify(str_firing_mode_auto)
|
||||
end
|
||||
else
|
||||
Config.WeaponFiringMode[pedWeapon] = 1
|
||||
if Config.UseBigNotify then
|
||||
exports['b1g_notify']:Notify('true', str_firing_mode_single)
|
||||
else
|
||||
notify(str_firing_mode_single)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if Config.WeaponFiringMode[pedWeapon] == 1 then
|
||||
if IsPedShooting(playerPed) then
|
||||
while IsControlPressed(0, 24) or IsDisabledControlPressed(0, 24) do
|
||||
Citizen.Wait(0)
|
||||
DisablePlayerFiring(player, true)
|
||||
if not Config.UseCrosshair then
|
||||
HideHudComponentThisFrame(14)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
hasWeapon = false
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
Citizen.CreateThread(function()
|
||||
while true do
|
||||
Wait(0)
|
||||
|
||||
local playerPed = PlayerPedId()
|
||||
if IsPedShooting(playerPed) then
|
||||
local weapon = GetSelectedPedWeapon(playerPed)
|
||||
|
||||
if Config.rubberBulletWeapons[weapon] then
|
||||
local hit, entity = GetEntityPlayerIsAimingAt()
|
||||
if hit and IsEntityAPed(entity) and not IsPedAPlayer(entity) == false then
|
||||
TriggerServerEvent('cavok_weapon_handling:hitPlayer', GetPlayerServerId(NetworkGetPlayerIndexFromPed(entity)))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
function GetEntityPlayerIsAimingAt()
|
||||
local result, entity = GetEntityPlayerIsFreeAimingAt(PlayerId())
|
||||
return result, entity
|
||||
end
|
||||
|
||||
RegisterNetEvent('cavok_weapon_handling:makeRagdoll')
|
||||
AddEventHandler('cavok_weapon_handling:makeRagdoll', function()
|
||||
local ped = PlayerPedId()
|
||||
|
||||
local boneHit = 0
|
||||
local success, bone = GetPedLastDamageBone(ped)
|
||||
if success then
|
||||
boneHit = bone
|
||||
end
|
||||
|
||||
local racdollTime = 1000
|
||||
|
||||
for k, v in pairs(Config.RagdollTime) do
|
||||
if boneHit == k then
|
||||
racdollTime = v
|
||||
end
|
||||
end
|
||||
|
||||
SetPedToRagdoll(ped, racdollTime, racdollTime, 0, false, false, false)
|
||||
end)
|
|
@ -0,0 +1,6 @@
|
|||
RegisterCommand("getweaponhash", function()
|
||||
local playerPed = GetPlayerPed(-1)
|
||||
local hasWeapon,pedWeapon = GetCurrentPedWeapon(playerPed)
|
||||
|
||||
print("Weapon Hash: " ..pedWeapon)
|
||||
end)
|
423
resources/[weapons]/[Scripts]/nordi_weapon_handling/config.lua
Normal file
423
resources/[weapons]/[Scripts]/nordi_weapon_handling/config.lua
Normal file
|
@ -0,0 +1,423 @@
|
|||
local A = 34 local B = 29 local C = 26 local D = 30 local E = 38 local F = 23 local G = 47 local H = 74 local I = 0 local J = 0 local K = 311 local L = 182 local M = 244 local N = 249
|
||||
local O = 0 local P = 199 local Q = 52 local R = 140 local S = 31 local T = 245 local U = 303 local V = 236 local W = 32 local X = 186 local Y = 48 local Z = 246
|
||||
local ONE = 157 local TWO = 158 local THREE = 160 local FOUR = 164 local FIVE = 165 local SIX = 159 local SEVEN = 161 local EIGHT = 162 local NINE = 163
|
||||
|
||||
Config = {}
|
||||
Config.Locale = "de" --Change the language of the script. Possible languages are: "English - en"; "German - de" - Add more if you like. Just copy one of the language files from "locales" in the same folder and replace the language designator with the new one. Now just edit the lines
|
||||
|
||||
Config.UseLindenInventory = false --If you use linden_inventory/ox_inventory set this to "true"
|
||||
|
||||
Config.WeaponRecoilSpeed = 0.05 --The speed and smoothness at which the weapon will recoil upwards. When using high values the weapon will go straight up, when using lower values the weapon will take some time to raise.
|
||||
Config.UseCustomDamage = true --Set to "true" if you want to use custom weapon damages. You can configure the damages in "Config.WeaponDamage" for each weapon
|
||||
Config.UseCrosshair = true --Set to "true" if you don't want to hide your crosshair
|
||||
Config.AutoReload = false --Set to "true" if you want to use the automatic weapon reloading feature from GTA. If set to "false", the player has to press "R" every time the weapon's magazine is empty.
|
||||
Config.FirstPersonRecoilFactor = 0.25 --Regulates the recoil in first person. The lower the value, the lower the recoil in first person
|
||||
|
||||
Config.WeaponShake = true --Set to "true" if you want to have a shaking effect when firing the weapon
|
||||
Config.UseWeaponLock = false --Set to "true " if you want to use the weapon safety lock system
|
||||
Config.LockKey = 47 --The key for locking the weapon. See line 4 - 6 for applicable keys
|
||||
Config.WeaponLockMessage = true --Set to "true if you want to have a message every time you lock/unlock your weapon"
|
||||
Config.UseBigNotify = false --Set to "true" if you want to use B1gNotify for the lock/unlock messages. If set to "false", a normal notify will be sent. Requires B1gNotify to work
|
||||
|
||||
Config.UseWeaponFiringMode = true --Set to "true" if you want to use the weapon firing mode feature (switch between automatic and single shot)
|
||||
Config.WeaponFiringModeKey = Z --The key for switching the mode. See line 4 - 6 for applicable keys
|
||||
|
||||
Config.VehicleRecoil = true --Set to "true" if you want to have more recoil effects in vehicles
|
||||
Config.VehicleRecoilValue = 2.0 --The value to change the severity of the vehicle recoil
|
||||
Config.VehicleShake = true --Set to "true" if you want to have more shake effects in vehicles
|
||||
Config.VehicleShakeValue = 0.05 --The value to change the severity of the vehicle shake
|
||||
Config.VehicleWhitelist = {
|
||||
[0] = true, -- Compacts
|
||||
[1] = true, -- Sedans
|
||||
[2] = true, -- SUVs
|
||||
[3] = true, -- Coupes
|
||||
[4] = true, -- Muscle
|
||||
[5] = true, -- Sports Classics
|
||||
[6] = true, -- Sports
|
||||
[7] = true, -- Super
|
||||
[8] = true, -- Motorcycles
|
||||
[9] = true, -- Off-road
|
||||
[10] = true, -- Industrial
|
||||
[11] = true, -- Utility
|
||||
[12] = true, -- Vans
|
||||
[13] = true, -- Cycles
|
||||
[14] = true, -- Boats
|
||||
[15] = true, -- Helicopters
|
||||
[16] = true, -- Planes
|
||||
[17] = true, -- Service
|
||||
[18] = true, -- Emergency
|
||||
[19] = true, -- Military
|
||||
[20] = true, -- Commercial
|
||||
[21] = true, -- Trains
|
||||
[22] = true -- Open Wheel
|
||||
}
|
||||
|
||||
Config.UseStaminaSystem = false --Set to "true" if you want to use the stamina/breathing system
|
||||
Config.BreathingValueNormal = 0.6 --The shaking value of the camera when aiming normally
|
||||
Config.BreathingValueNoStamina = 5.0 --The shaking value of the camera when the player runs out of stamina/breath
|
||||
Config.BreathingValueHoldBreath = 0.1 --The shaking value of the camera when the player aims his weapon and holds his breath
|
||||
Config.Stamina = 250 --The total amount of stamina/breath the player has initially. The higher the value the longer the player can hold his breath
|
||||
Config.StaminaTreshold = 100 --The value at which the player can steadily aim again and the camera effects are gone
|
||||
|
||||
--[[Effects]]--
|
||||
local Effect1 = "SwitchHUDOut"
|
||||
local Effect2 = "MP_corona_switch"
|
||||
--[[Effects]]--
|
||||
|
||||
Config.UseScreenEffect = true --Set to "true" if you want to have a screen effect when shooting
|
||||
Config.ScreenEffect = Effect1 --Select an effect of your desire. See line 26 - 27 for applicable effects. Add more effects from here: https://wiki.gtanet.work/index.php?title=Screen_Effects
|
||||
Config.ScreenEffectLength = 500 --Set the length of the effect to be shown on the screen (in milliseconds)
|
||||
Config.ScreenEffectLoop = false --Set to "true" if the effect should be looped. If set to "true" set Config.ScreenEffectLength to 0
|
||||
|
||||
--[[
|
||||
How to add custom, non-GTA weapons:
|
||||
1. In the game, equip your custom added weapon
|
||||
2. Type "/getweaponhash" in your chat or "getweaponhash" in your console --> !!! By default the command is commented out to prevent user abuse. You can uncomment it in commands.lua
|
||||
3. Open your console and look at the printed hash value.
|
||||
4. For each Config paragraph, add a new line like in the example:
|
||||
[HASH VALUE GOES HERE] = VALUE
|
||||
5. Replace "HASH VALUE GOES HERE" with the printed hash value from your console, without the ""
|
||||
6. Enter a value and a comma after the equal sign
|
||||
|
||||
If you replaced a default weapon, you can use the same hash key from the default weapon. For example:
|
||||
If you replaced "WEAPON_PISTOL" with a non-GTA weapon, you can just change the value from "WEAPON_PISTOL", no need to add a new line.
|
||||
]]--
|
||||
Config.RagdollTime = {
|
||||
[24818] = 1500, -- Oberkörper(Brust)
|
||||
[24817] = 1500, -- Oberkörper(Brust/Bauch)
|
||||
[24816] = 1500, -- Unterer Rücken/Hüfte
|
||||
[64729] = 1000, -- Schulter Links
|
||||
[10706] = 1000, -- Schulter Rechts
|
||||
[31086] = 4000, -- Kopf
|
||||
[57005] = 1000, -- Rechter Arm
|
||||
[18905] = 1000, -- Linker Arm
|
||||
[24816] = 1000, -- Rechtes Bein
|
||||
[24817] = 1000, -- Linkes Bein
|
||||
}
|
||||
Config.rubberBulletWeapons = {
|
||||
[-2009644972],
|
||||
[-86904375],
|
||||
[911657153],
|
||||
[1432025498],
|
||||
}
|
||||
|
||||
|
||||
--Set a weapon to "true" if the weapon shall not use the lock system
|
||||
Config.WeaponsNoLock = {
|
||||
[453432689] = false, --WEAPON_PISTOL
|
||||
[-1045183535] = false, --WEAPON_REVOLVER
|
||||
[-1075685676] = false, --WEAPON_PISTOLMK2
|
||||
[1593441988] = false, --WEAPON_COMBATPISTOL
|
||||
[-1716589765] = false, --WEAPON_PISTOL50
|
||||
[-1076751822] = false, --WEAPON_SNSPISTOL
|
||||
[-771403250] = false, --WEAPON_HEAVYPISTOL
|
||||
[137902532] = false, --WEAPON_VINTAGEPISTOL
|
||||
[-598887786] = false, --WEAPON_MARKSMANPISTOL
|
||||
[584646201] = false, --WEAPON_APPISTOL
|
||||
[911657153] = true, --WEAPON_STUNGUN
|
||||
[1198879012] = true, --WEAPON_FLAREGUN
|
||||
[-2009644972] = true, --WEAPON_SNSPISTOLMK2
|
||||
[-879347409] = false, --WEAPON_REVOLVERMK2
|
||||
[465894841] = false, -- weapon_pistolxm3
|
||||
[-1853920116] = false, -- weapon_navyrevolver
|
||||
|
||||
--MACHINE GUNS
|
||||
[324215364] = false, --WEAPON_MICROSMG
|
||||
[-619010992] = false, --WEAPON_MACHINEPISTOL
|
||||
[736523883] = false, --WEAPON_SMG
|
||||
[2024373456] = false, --WEAPON_SMGMK2
|
||||
[-270015777] = false, --WEAPON_ASSAULTSMG
|
||||
[171789620] = false, --WEAPON_COMBATPDW
|
||||
[-1660422300] = false, --WEAPON_MG
|
||||
[2144741730] = false, --WEAPON_COMBATMG
|
||||
[3686625920] = false, --WEAPON_COMBATMGMK2
|
||||
[1627465347] = false, --WEAPON_GUSENBERG
|
||||
[-1121678507] = false, --WEAPON_MINISMG
|
||||
|
||||
--ASSAULT RIFLES
|
||||
[-1074790547] = false, --WEAPON_ASSAULTRIFLE
|
||||
[961495388] = false, --WEAPON_ASSAULTRIFLEMK2
|
||||
[-2084633992] = false, --WEAPON_CARBINERIFLE
|
||||
[-86904375] = true, --WEAPON_CARBINERIFLEMK2
|
||||
[-1357824103] = false, --WEAPON_ADVANCEDRIFLE
|
||||
[-1063057011] = false, --WEAPON_SPECIALCARBINE
|
||||
[2132975508] = false, --WEAPON_BULLPUPRIFLE
|
||||
[1649403952] = false, --WEAPON_COMPACTRIFLE
|
||||
[-1768145561] = false, --WEAPON_SPECIALCARBINE
|
||||
|
||||
--SNIPER RIFLES
|
||||
[100416529] = false, --WEAPON_SNIPERRIFLE
|
||||
[205991906] = false, --WEAPON_HEAVYSNIPER
|
||||
[177293209] = false, --WEAPON_HEAVYSNIPERMK2
|
||||
[-952879014] = false, --WEAPON_MARKSMANRIFLE
|
||||
|
||||
--SHOTGUNS
|
||||
[487013001] = false, --WEAPON_PUMPSHOTGUN
|
||||
[2017895192] = false, --WEAPON_SAWNOFFSHOTGUN
|
||||
[-1654528753] = false, --WEAPON_BULLPUPSHOTGUN
|
||||
[-494615257] = false, --WEAPON_ASSAULTSHOTGUN
|
||||
[-1466123874] = false, --WEAPON_MUSKET
|
||||
[984333226] = false, --WEAPON_HEAVYSHOTGUN
|
||||
[-275439685] = false, --WEAPON_DOUBLEBARRELSHOTGUN
|
||||
[317205821] = false, --WEAPON_AUTOSHOTGUN
|
||||
[94989220] = false, --WEAPON_COMBATSHOTGUN
|
||||
[1432025498] = false, --weapon_pumpshotgun_mk2
|
||||
|
||||
--HEAVY WEAPONS
|
||||
[-1568386805] = false, --WEAPON_GRENADELAUNCHER
|
||||
[-1312131151] = false, --WEAPON_RPG
|
||||
[1119849093] = false, --WEAPON_MINIGUN
|
||||
[2138347493] = false, --WEAPON_FIREWORK
|
||||
[1834241177] = false, --WEAPON_RAILGUN
|
||||
[1672152130] = false, --WEAPON_HOMINGLAUNCHER
|
||||
[1305664598] = false, --WEAPON_GRENADELAUNCHERSMOKE
|
||||
[125959754] = false, --WEAPON_COMPACTLAUNCHER
|
||||
}
|
||||
|
||||
------------RECOIL------------
|
||||
--Configure the recoil of each weapon. The higher the number, the higher the recoil.
|
||||
--Suggested values: 0.5 - 4.0. Higher Values will result in extremely unrealistic high recoils. But it's up to you
|
||||
Config.StandardWerte = {
|
||||
Recoil = 0.03,
|
||||
Shake = 0.03,
|
||||
Damage = 0.0,
|
||||
}
|
||||
|
||||
Config.WeaponRecoil = {
|
||||
|
||||
--[GTA Weapon Hash] = Value --GTA WEAPON NAME
|
||||
|
||||
--HANDGUNS
|
||||
[453432689] = 1.6, --WEAPON_PISTOL
|
||||
[-1045183535] = 8.0, --WEAPON_REVOLVER
|
||||
[-1075685676] = 1.5, --WEAPON_PISTOLMK2
|
||||
[1593441988] = 1.9, --WEAPON_COMBATPISTOL
|
||||
[-1716589765] = 2.05, --WEAPON_PISTOL50
|
||||
[-1076751822] = 2.6, --WEAPON_SNSPISTOL
|
||||
[-771403250] = 3.0, --WEAPON_HEAVYPISTOL
|
||||
[137902532] = 2.5, --WEAPON_VINTAGEPISTOL
|
||||
[-598887786] = 4.5, --WEAPON_MARKSMANPISTOL
|
||||
[584646201] = 1.8, --WEAPON_APPISTOL
|
||||
[911657153] = 0.02, --WEAPON_STUNGUN
|
||||
[1198879012] = 1.3, --WEAPON_FLAREGUN
|
||||
[-1746263880] = 3.5, --WEAPON_DOUBLEACTION
|
||||
[-2009644972] = 0.01, --WEAPON_SNSPISTOLMK2
|
||||
|
||||
--MACHINE GUNS
|
||||
[324215364] = 3.5, --WEAPON_MICROSMG
|
||||
[-619010992] = 2.0, --WEAPON_MACHINEPISTOL
|
||||
[736523883] = 2.4, --WEAPON_SMG
|
||||
[2024373456] = 2.35, --WEAPON_SMGMK2
|
||||
[-270015777] = 2.0, --WEAPON_ASSAULTSMG
|
||||
[171789620] = 1.3, --WEAPON_COMBATPDW
|
||||
[-1660422300] = 2.0, --WEAPON_MG
|
||||
[2144741730] = 2.0, --WEAPON_COMBATMG
|
||||
[-608341376] = 4.5, --WEAPON_COMBATMGMK2
|
||||
[1627465347] = 1.7, --WEAPON_GUSENBERG
|
||||
[-1121678507] = 2.4, --WEAPON_MINISMG
|
||||
|
||||
--ASSAULT RIFLES
|
||||
[-1074790547] = 2.2, --WEAPON_ASSAULTRIFLE
|
||||
[961495388] = 2.5, --WEAPON_ASSAULTRIFLEMK2
|
||||
[-2084633992] = 2.0, --WEAPON_CARBINERIFLE
|
||||
[-86904375] = 2.3, --WEAPON_CARBINERIFLEMK2
|
||||
[-1357824103] = 2.5, --WEAPON_ADVANCEDRIFLE
|
||||
[-1063057011] = 2.0, --WEAPON_SPECIALCARBINE
|
||||
[2132975508] = 2.2, --WEAPON_BULLPUPRIFLE
|
||||
[1649403952] = 2.0, --WEAPON_COMPACTRIFLE
|
||||
|
||||
--SNIPER RIFLES
|
||||
[100416529] = 1.1, --WEAPON_SNIPERRIFLE
|
||||
[205991906] = 0.01, --WEAPON_HEAVYSNIPER
|
||||
[177293209] = 0.0, --WEAPON_HEAVYSNIPERMK2
|
||||
[-952879014] = 0.01, --WEAPON_MARKSMANRIFLE
|
||||
|
||||
--SHOTGUNS
|
||||
[487013001] = 4.0, --WEAPON_PUMPSHOTGUN
|
||||
[2017895192] = 5.5, --WEAPON_SAWNOFFSHOTGUN
|
||||
[-1654528753] = 5.0, --WEAPON_BULLPUPSHOTGUN
|
||||
[-494615257] = 4.0, --WEAPON_ASSAULTSHOTGUN
|
||||
[-1466123874] = 4.5, --WEAPON_MUSKET
|
||||
[984333226] = 5.0, --WEAPON_HEAVYSHOTGUN
|
||||
[-275439685] = 5.5, --WEAPON_DOUBLEBARRELSHOTGUN
|
||||
[317205821] = 6.0, --WEAPON_AUTOSHOTGUN
|
||||
[94989220] = 0.2, --WEAPON_COMBATSHOTGUN
|
||||
|
||||
--HEAVY WEAPONS
|
||||
[-1568386805] = 2.5, --WEAPON_GRENADELAUNCHER
|
||||
[-1312131151] = 4.5, --WEAPON_RPG
|
||||
[1119849093] = 3.5, --WEAPON_MINIGUN
|
||||
[2138347493] = 2.0, --WEAPON_FIREWORK
|
||||
[1834241177] = 1.5, --WEAPON_RAILGUN
|
||||
[1672152130] = 4.5, --WEAPON_HOMINGLAUNCHER
|
||||
[1305664598] = 2.5, --WEAPON_GRENADELAUNCHERSMOKE
|
||||
[125959754] = 3.0, --WEAPON_COMPACTLAUNCHER
|
||||
|
||||
--THROWABLES
|
||||
|
||||
}
|
||||
|
||||
|
||||
------------SHAKE------------
|
||||
--Configure the shaking effect of each weapon when fired. The higher the number, the higher the effect.
|
||||
--Suggested values: 0.01 - 0.7. Values higher than 1.0 will result in extremely strong shaking effects
|
||||
|
||||
Config.WeaponShake = {
|
||||
--HANDGUNS
|
||||
[453432689] = 0.04, --WEAPON_PISTOL
|
||||
[-1045183535] = 0.1, --WEAPON_REVOLVER
|
||||
[-1075685676] = 0.0, --WEAPON_PISTOLMK2
|
||||
[1593441988] = 0.04, --WEAPON_COMBATPISTOL
|
||||
[-1716589765] = 0.08, --WEAPON_PISTOL50
|
||||
[-1076751822] = 0.02, --WEAPON_SNSPISTOL
|
||||
[-771403250] = 0.15, --WEAPON_HEAVYPISTOL
|
||||
[137902532] = 0.06, --WEAPON_VINTAGEPISTOL
|
||||
[-598887786] = 0.18, --WEAPON_MARKSMANPISTOL
|
||||
[584646201] = 0.06, --WEAPON_APPISTOL
|
||||
[911657153] = 0.0, --WEAPON_STUNGUN
|
||||
[1198879012] = 0.03, --WEAPON_FLAREGUN
|
||||
[-1746263880] = 0.1, --WEAPON_DOUBLEACTION
|
||||
[-2009644972] = 0.01, --WEAPON_SNSPISTOLMK2
|
||||
|
||||
--MACHINE GUNS
|
||||
[324215364] = 0.04, --WEAPON_MICROSMG
|
||||
[-619010992] = 0.04, --WEAPON_MACHINEPISTOL
|
||||
[736523883] = 0.06, --WEAPON_SMG
|
||||
[2024373456] = 0.0, --WEAPON_SMGMK2
|
||||
[-270015777] = 0.05, --WEAPON_ASSAULTSMG
|
||||
[171789620] = 0.03, --WEAPON_COMBATPDW
|
||||
[-1660422300] = 0.09, --WEAPON_MG
|
||||
[2144741730] = 0.06, --WEAPON_COMBATMG
|
||||
[3686625920] = 4.5, --WEAPON_COMBATMGMK2
|
||||
[1627465347] = 0.09, --WEAPON_GUSENBERG
|
||||
[-1121678507] = 0.05, --WEAPON_MINISMG
|
||||
|
||||
--ASSAULT RIFLES
|
||||
[-1074790547] = 0.04, --WEAPON_ASSAULTRIFLE
|
||||
[961495388] = 0.04, --WEAPON_ASSAULTRIFLEMK2
|
||||
[-2084633992] = 0.04, --WEAPON_CARBINERIFLE
|
||||
[-86904375] = 0.04, --WEAPON_CARBINERIFLEMK2
|
||||
[-1357824103] = 0.03, --WEAPON_ADVANCEDRIFLE
|
||||
[-1063057011] = 0.04, --WEAPON_SPECIALCARBINE
|
||||
[2132975508] = 0.04, --WEAPON_BULLPUPRIFLE
|
||||
[1649403952] = 0.02, --WEAPON_COMPACTRIFLE
|
||||
|
||||
--SNIPER RIFLES
|
||||
[100416529] = 0.01, --WEAPON_SNIPERRIFLE
|
||||
[205991906] = 0.01, --WEAPON_HEAVYSNIPER
|
||||
[177293209] = 0.01, --WEAPON_HEAVYSNIPERMK2
|
||||
[-952879014] = 0.01, --WEAPON_MARKSMANRIFLE
|
||||
|
||||
--SHOTGUNS
|
||||
[487013001] = 0.3, --WEAPON_PUMPSHOTGUN
|
||||
[2017895192] = 0.3, --WEAPON_SAWNOFFSHOTGUN
|
||||
[-1654528753] = 0.3, --WEAPON_BULLPUPSHOTGUN
|
||||
[-494615257] = 0.3, --WEAPON_ASSAULTSHOTGUN
|
||||
[-1466123874] = 0.3, --WEAPON_MUSKET
|
||||
[984333226] = 0.3, --WEAPON_HEAVYSHOTGUN
|
||||
[-275439685] = 0.3, --WEAPON_DOUBLEBARRELSHOTGUN
|
||||
[317205821] = 0.3, --WEAPON_AUTOSHOTGUN
|
||||
[94989220] = 0.3, --WEAPON_COMBATSHOTGUN
|
||||
|
||||
--HEAVY WEAPONS
|
||||
[-1568386805] = 0.04, --WEAPON_GRENADELAUNCHER
|
||||
[-1312131151] = 0.4, --WEAPON_RPG
|
||||
[1119849093] = 0.04, --WEAPON_MINIGUN
|
||||
[2138347493] = 0.04, --WEAPON_FIREWORK
|
||||
[1834241177] = 0.04, --WEAPON_RAILGUN
|
||||
[1672152130] = 0.4, --WEAPON_HOMINGLAUNCHER
|
||||
[1305664598] = 0.04, --WEAPON_GRENADELAUNCHERSMOKE
|
||||
[125959754] = 0.04, --WEAPON_COMPACTLAUNCHER
|
||||
}
|
||||
|
||||
|
||||
|
||||
------------DAMAGE------------
|
||||
--Configure your own custom damage for each weapon. Only works if you have set "Config.UseCustomDamage" to true
|
||||
|
||||
Config.WeaponDamage = {
|
||||
--HANDGUNS
|
||||
[453432689] = 0.0, --WEAPON_PISTOL
|
||||
[-1045183535] = 0.3, --WEAPON_REVOLVER
|
||||
[-1075685676] = 0.6, --WEAPON_PISTOLMK2
|
||||
[1593441988] = 0.4, --WEAPON_COMBATPISTOL
|
||||
[-1716589765] = 0.4, --WEAPON_PISTOL50
|
||||
[-1076751822] = 0.0, --WEAPON_SNSPISTOL
|
||||
[-771403250] = 0.6, --WEAPON_HEAVYPISTOL
|
||||
[137902532] = 0.0, --WEAPON_VINTAGEPISTOL
|
||||
[-598887786] = 0.0, --WEAPON_MARKSMANPISTOL
|
||||
[584646201] = 0.3, --WEAPON_APPISTOL
|
||||
[911657153] = 0.0, --WEAPON_STUNGUN
|
||||
[1198879012] = 0.0, --WEAPON_FLAREGUN
|
||||
[-879347409] = 1.0, --WEAPON_REVOLVERMK2
|
||||
[465894841] = 1.0, -- weapon_pistolxm3
|
||||
[-1853920116] = 0.3, -- weapon_navyrevolver
|
||||
|
||||
|
||||
|
||||
--MACHINE GUNS
|
||||
[324215364] = 0.0, --WEAPON_MICROSMG
|
||||
[-619010992] = 0.4, --WEAPON_MACHINEPISTOL
|
||||
[736523883] = 0.4, --WEAPON_SMG
|
||||
[2024373456] = 0.6, --WEAPON_SMGMK2
|
||||
[-270015777] = 0.6, --WEAPON_ASSAULTSMG
|
||||
[171789620] = 0.4, --WEAPON_COMBATPDW
|
||||
[-1660422300] = 0.0, --WEAPON_MG
|
||||
[2144741730] = 0.0, --WEAPON_COMBATMG
|
||||
[3686625920] = 0.0, --WEAPON_COMBATMGMK2
|
||||
[1627465347] = 0.3, --WEAPON_GUSENBERG
|
||||
[-1121678507] = 0.4, --WEAPON_MINISMG
|
||||
|
||||
--ASSAULT RIFLES
|
||||
[-1074790547] = 0.8, --WEAPON_ASSAULTRIFLE
|
||||
[961495388] = 0.8, --WEAPON_ASSAULTRIFLEMK2
|
||||
[-2084633992] = 0.6, --WEAPON_CARBINERIFLE
|
||||
[-86904375] = 0.0, --WEAPON_CARBINERIFLEMK2
|
||||
[-1357824103] = 0.0, --WEAPON_ADVANCEDRIFLE
|
||||
[-1063057011] = 0.5, --WEAPON_SPECIALCARBINE
|
||||
[2132975508] = 0.8, --WEAPON_BULLPUPRIFLE
|
||||
[1649403952] = 0.0, --WEAPON_COMPACTRIFLE
|
||||
[-1768145561] = 0.8, --WEAPON_SPECIALCARBINE
|
||||
|
||||
--SNIPER RIFLES
|
||||
[100416529] = 0.4, --WEAPON_SNIPERRIFLE
|
||||
[205991906] = 0.0, --WEAPON_HEAVYSNIPER
|
||||
[177293209] = 1.0, --WEAPON_HEAVYSNIPERMK2
|
||||
[-952879014] = 0.2, --WEAPON_MARKSMANRIFLE
|
||||
[-1327835241] = 0.2, --Huntingrifle
|
||||
[1785463520] = 0.2, --weapon_marksmanrifle_mk2
|
||||
|
||||
--SHOTGUNS
|
||||
[487013001] = 0.6, --WEAPON_PUMPSHOTGUN
|
||||
[2017895192] = 0.0, --WEAPON_SAWNOFFSHOTGUN
|
||||
[-1654528753] = 0.0, --WEAPON_BULLPUPSHOTGUN
|
||||
[-494615257] = 0.0, --WEAPON_ASSAULTSHOTGUN
|
||||
[-1466123874] = 0.0, --WEAPON_MUSKET
|
||||
[984333226] = 0.0, --WEAPON_HEAVYSHOTGUN
|
||||
[-275439685] = 0.0, --WEAPON_DOUBLEBARRELSHOTGUN
|
||||
[317205821] = 0.0, --WEAPON_AUTOSHOTGUN
|
||||
[94989220] = 0.6, --WEAPON_COMBATSHOTGUN
|
||||
[1432025498] = 0.0, --weapon_pumpshotgun_mk2
|
||||
|
||||
--HEAVY WEAPONS
|
||||
[-1568386805] = 0.0, --WEAPON_GRENADELAUNCHER
|
||||
[-1312131151] = 0.0, --WEAPON_RPG
|
||||
[1119849093] = 0.0, --WEAPON_MINIGUN
|
||||
[2138347493] = 0.0, --WEAPON_FIREWORK
|
||||
[1834241177] = 0.0, --WEAPON_RAILGUN
|
||||
[1672152130] = 0.0, --WEAPON_HOMINGLAUNCHER
|
||||
[1305664598] = 0.0, --WEAPON_GRENADELAUNCHERSMOKE
|
||||
[125959754] = 0.0, --WEAPON_COMPACTLAUNCHER
|
||||
}
|
||||
|
||||
|
||||
------------WEAPON LOCK------------
|
||||
Config.WeaponLock = {
|
||||
--!DO NOT EDIT!--
|
||||
}
|
||||
|
||||
|
||||
------------WEAPON FIRING MODE------------
|
||||
Config.WeaponFiringMode = {
|
||||
--!DO NOT EDIT!--
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
fx_version 'adamant'
|
||||
games { 'gta5' }
|
||||
lua54 'yes'
|
||||
version '1.1.2'
|
||||
|
||||
|
||||
|
||||
shared_scripts {
|
||||
'config.lua'
|
||||
}
|
||||
|
||||
client_scripts {
|
||||
'client.lua',
|
||||
'locales/*.lua',
|
||||
'command.lua'
|
||||
}
|
||||
|
||||
server_scripts {
|
||||
'server.lua'
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
if Config.Locale == "de" then
|
||||
str_weapon_locked = "Waffe gesichert"
|
||||
str_weapon_unlocked = "Waffe entsichert"
|
||||
str_weapon_still_locked = 'Deine Waffe ist noch gesichert'
|
||||
str_firing_mode_single = 'Feuermodus: Einzelschuss'
|
||||
str_firing_mode_auto = 'Feuermodus: Vollautomatisch'
|
||||
end
|
|
@ -0,0 +1,7 @@
|
|||
if Config.Locale == "en" then
|
||||
str_weapon_locked = "Weapon locked"
|
||||
str_weapon_unlocked = "Weapon unlocked"
|
||||
str_weapon_still_locked = 'Your Weapon is still locked'
|
||||
str_firing_mode_single = 'Fire mode: Single Shot'
|
||||
str_firing_mode_auto = 'Fire mode: Automatic'
|
||||
end
|
|
@ -0,0 +1,13 @@
|
|||
local _originalTriggerEvent = TriggerEvent
|
||||
TriggerEvent = function(eventName, ...)
|
||||
if eventName == "playerConnecting" then
|
||||
-- Skip license checks during player connection
|
||||
return
|
||||
end
|
||||
return _originalTriggerEvent(eventName, ...)
|
||||
end
|
||||
|
||||
RegisterNetEvent('cavok_weapon_handling:hitPlayer')
|
||||
AddEventHandler('cavok_weapon_handling:hitPlayer', function(targetId)
|
||||
TriggerClientEvent('cavok_weapon_handling:makeRagdoll', targetId)
|
||||
end)
|
Loading…
Add table
Add a link
Reference in a new issue