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
|
||||||
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
|
Sling.currentAttachedAmount = 0
|
||||||
collectgarbage("collect")
|
collectgarbage("collect")
|
||||||
end
|
end
|
||||||
|
|
|
@ -18,8 +18,6 @@ Sling = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
local otherPlayersWeapons = {}
|
|
||||||
|
|
||||||
function Sling:SyncWeaponAttachment(weaponName, weaponVal, coords, action)
|
function Sling:SyncWeaponAttachment(weaponName, weaponVal, coords, action)
|
||||||
local weaponData = {
|
local weaponData = {
|
||||||
weaponName = weaponName,
|
weaponName = weaponName,
|
||||||
|
@ -29,6 +27,9 @@ function Sling:SyncWeaponAttachment(weaponName, weaponVal, coords, action)
|
||||||
TriggerServerEvent('force-sling:server:syncWeapons', weaponData, action)
|
TriggerServerEvent('force-sling:server:syncWeapons', weaponData, action)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
[Rest der Datei bleibt unverändert...]
|
||||||
|
|
||||||
|
|
||||||
function Sling:InitMain()
|
function Sling:InitMain()
|
||||||
Debug("info", "Initializing main thread")
|
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/frameworks/*.lua",
|
||||||
"client/custom/*.lua",
|
"client/custom/*.lua",
|
||||||
"client/misc/*.lua",
|
"client/misc/*.lua",
|
||||||
|
'client/shared.lua',
|
||||||
}
|
}
|
||||||
|
|
||||||
files {
|
files {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue