This commit is contained in:
Nordi98 2025-06-12 00:25:14 +02:00
parent 90cf348723
commit 619c6d40f6
4 changed files with 86 additions and 8 deletions

View file

@ -43,6 +43,9 @@ function Utils:CreateAndAttachWeapon(weaponName, weaponVal, coords, playerPed)
Sling.currentAttachedAmount = Sling.currentAttachedAmount + 1
SetModelAsNoLongerNeeded(weaponVal.model)
if NetworkGetEntityOwner(playerPed) == PlayerId() then
Sling:SyncWeaponAttachment(weaponName, weaponVal, coords, 'attach')
end
return true
end
@ -57,4 +60,8 @@ function Utils:DeleteWeapon(weaponName)
end
DeleteObject(attachment.placeholder)
Sling.currentAttachedAmount = Sling.currentAttachedAmount - 1
if NetworkGetEntityOwner(cache.ped) == PlayerId() then
Sling:SyncWeaponAttachment(weaponName, nil, nil, 'detach')
end
end