forked from Simnation/Main
sling
This commit is contained in:
parent
f10ca59400
commit
26083791e2
4 changed files with 16 additions and 2 deletions
|
@ -25,6 +25,17 @@ local function cleanupEntities()
|
|||
end
|
||||
end
|
||||
|
||||
-- Cleanup other players weapons
|
||||
for playerId, weapons in pairs(otherPlayersWeapons) do
|
||||
for weaponName, _ in pairs(weapons) do
|
||||
if Sling.cachedAttachments[weaponName] then
|
||||
safeDelete(Sling.cachedAttachments[weaponName].obj)
|
||||
safeDelete(Sling.cachedAttachments[weaponName].placeholder)
|
||||
end
|
||||
end
|
||||
otherPlayersWeapons[playerId] = nil
|
||||
end
|
||||
|
||||
Sling.currentAttachedAmount = 0
|
||||
collectgarbage("collect")
|
||||
end
|
||||
|
|
|
@ -18,8 +18,6 @@ Sling = {
|
|||
}
|
||||
}
|
||||
|
||||
local otherPlayersWeapons = {}
|
||||
|
||||
function Sling:SyncWeaponAttachment(weaponName, weaponVal, coords, action)
|
||||
local weaponData = {
|
||||
weaponName = weaponName,
|
||||
|
@ -29,6 +27,9 @@ function Sling:SyncWeaponAttachment(weaponName, weaponVal, coords, action)
|
|||
TriggerServerEvent('force-sling:server:syncWeapons', weaponData, action)
|
||||
end
|
||||
|
||||
[Rest der Datei bleibt unverändert...]
|
||||
|
||||
|
||||
function Sling:InitMain()
|
||||
Debug("info", "Initializing main thread")
|
||||
|
||||
|
|
1
resources/[jobs]/[weapons]/force-sling/client/shared.lua
Normal file
1
resources/[jobs]/[weapons]/force-sling/client/shared.lua
Normal file
|
@ -0,0 +1 @@
|
|||
otherPlayersWeapons = {}
|
|
@ -37,6 +37,7 @@ client_scripts {
|
|||
"client/custom/frameworks/*.lua",
|
||||
"client/custom/*.lua",
|
||||
"client/misc/*.lua",
|
||||
'client/shared.lua',
|
||||
}
|
||||
|
||||
files {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue