Skip to content

Commit

Permalink
Merge branch 'master' into admin2/glitches_gridlist
Browse files Browse the repository at this point in the history
  • Loading branch information
FileEX authored Mar 6, 2024
2 parents 93b269b + 567d10c commit c953619
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
14 changes: 7 additions & 7 deletions [gamemodes]/[assault]/assault/assault.lua
Original file line number Diff line number Diff line change
Expand Up @@ -698,18 +698,18 @@ end
addEvent("assaultClientScriptLoaded",true)
addEventHandler('assaultClientScriptLoaded', root,
function()
setElementDataLocal( source, "assaultClientScriptLoaded", true )
if (assaultClientScriptQueue[source] == nil) then return end
for k,v in ipairs(assaultClientScriptQueue[source]) do
--outputConsole("Triggering queued event '"..v.eventName.."'",source)
triggerClientEvent( source, v.eventName, source, v.parameter )
setElementDataLocal( client, "assaultClientScriptLoaded", true )
if (assaultClientScriptQueue[client] == nil) then return end
for k,v in ipairs(assaultClientScriptQueue[client]) do
--outputConsole("Triggering queued event '"..v.eventName.."'",client)
triggerClientEvent( client, v.eventName, client, v.parameter )
end
assaultClientScriptQueue[source] = {}
assaultClientScriptQueue[client] = {}
end
)
addEventHandler("onPlayerQuit", root,
function()
assaultClientScriptQueue[source] = {}
assaultClientScriptQueue[source] = nil
end
)

Expand Down
10 changes: 8 additions & 2 deletions [gameplay]/defaultstats/defaultstats.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,18 @@ local function applyStatsForSource()
end
addEventHandler("onPlayerJoin", root, applyStatsForSource)

local function applyStatsForEveryone()
local function applyStatsForEveryone(loadedResource)
local resourceType = getResourceInfo(loadedResource, "type")
local isGamemodeResource = resourceType == "gamemode"
local isMapResource = resourceType == "map"

if not (loadedResource == resource or isGamemodeResource or isMapResource) then return end

local playersTable = getElementsByType("player")

for playerID = 1, #playersTable do
applyStatsForPlayer(playersTable[playerID])
end
end
addEventHandler("onResourceStart", resourceRoot, applyStatsForEveryone)
addEventHandler("onResourceStart", root, applyStatsForEveryone)
addEventHandler("onGamemodeMapStart", root, applyStatsForEveryone)

0 comments on commit c953619

Please sign in to comment.