forked from Simnation/Main
23 lines
575 B
Lua
23 lines
575 B
Lua
![]() |
if not Config.HelpText then
|
||
|
return
|
||
|
end
|
||
|
|
||
|
local GetSelectedPedWeapon = GetSelectedPedWeapon
|
||
|
local equippedWeapon = `weapon_unarmed`
|
||
|
|
||
|
local function onWeaponEquipped(weaponHash)
|
||
|
equippedWeapon = weaponHash
|
||
|
TriggerEvent('slashtires:slashWeaponEquipped', Config.AllowedWeapons[weaponHash] ~= nil)
|
||
|
end
|
||
|
|
||
|
CreateThread(function()
|
||
|
while true do
|
||
|
Wait(500)
|
||
|
|
||
|
local currentWeapon = GetSelectedPedWeapon(PlayerPedId())
|
||
|
if currentWeapon ~= equippedWeapon then
|
||
|
onWeaponEquipped(currentWeapon)
|
||
|
end
|
||
|
end
|
||
|
end)
|