AddEventHandler.... not needed <3

This commit is contained in:
WLVF
2022-09-01 04:11:48 -04:00
parent 803727e4e0
commit 7f153e72b2
14 changed files with 33 additions and 66 deletions

View File

@@ -5,14 +5,12 @@ NDCore.Functions.VersionChecker("ND_Doorlocks", GetCurrentResourceName(), "https
local updatedDoors = {}
RegisterNetEvent("ND_Doorlocks:syncDoor")
AddEventHandler("ND_Doorlocks:syncDoor", function(doorID, state)
RegisterNetEvent("ND_Doorlocks:syncDoor", function(doorID, state)
updatedDoors[doorID] = state
TriggerClientEvent("ND_Doorlocks:syncDoor", -1, doorID, state)
end)
RegisterNetEvent("ND_Doorlocks:getDoors")
AddEventHandler("ND_Doorlocks:getDoors", function()
RegisterNetEvent("ND_Doorlocks:getDoors", function()
local player = source
TriggerClientEvent("ND_Doorlocks:returnDoors", player, updatedDoors)
end)