About SetStateOfCloestDoorOfType Function

Greetings All,

I’ve been trying to lock the gates at prison location using “SetStateOfCloestDoorOfType()” Function, but still can’t seem to get it done, could someone please tell me what am I doing wrong? Thank you! Here is my code below:

RegisterNetEvent('es_admin:prisgateswitch')
AddEventHandler('es_admin:prisgateswitch', function(v)
           
	local doorid = GetHashKey("prop_gate_prison_01")
                SetStateOfClosestDoorOfType(doorid, 1845.0, 2605.0, 45.0, 1, 0.0, 0)
end)

Thank you for your time!

Hi,
Sorry I can’t help you but can you tell me where you found the name of the door please?

search “prop id prop_gate_prison_01” in google :wink:

if you are one solution about this share please. One element of answer, i think SetStateOfClosestDoorOfType it’s not the good function because it’s for door with collision. Prison Gate it’s work with automatic trigger. I search too but i found nothing lol