Skip to content

Commit

Permalink
Update assault.lua (#466)
Browse files Browse the repository at this point in the history
- Change source to client, as source can be manipulated
- Fully remove the data from the client script queue when the player quits.
  • Loading branch information
jvstns authored Mar 3, 2024
1 parent 53050dd commit 8777f78
Showing 1 changed file with 7 additions and 7 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

0 comments on commit 8777f78

Please sign in to comment.