-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclient.lua
More file actions
53 lines (39 loc) · 1.22 KB
/
client.lua
File metadata and controls
53 lines (39 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
local weaponData = {}
for key, value in pairs(Weapons) do
weaponData[GetHashKey(key)] = value
end
if Config.AllowCriticalHits then
SetPedSuffersCriticalHits(GetPlayerPed(-1), false)
end
CreateThread(function()
while true do
Wait(0)
local playerPed = GetPlayerPed(-1)
local weapon = GetSelectedPedWeapon(playerPed)
local weaponsMultiplier = weaponData[weapon]
if weaponsMultiplier ~= nil and weaponsMultiplier ~= 1.0 then
SetWeaponDamageModifierThisFrame(weapon, weaponsMultiplier)
else
Wait(500)
end
end
end)
Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
local ped = PlayerPedId()
if IsPedArmed(ped, 6) then
DisableControlAction(1, 140, true)
DisableControlAction(1, 141, true)
DisableControlAction(1, 142, true)
end
end
end)
AddEventHandler('onResourceStop', function(resourceName)
if (GetCurrentResourceName() ~= resourceName) then
--print("not "..tostring(resourceName))
return
end
SetPedSuffersCriticalHits(GetPlayerPed(-1), true)
print('The resource ' .. resourceName .. ' was stopped.')
end)