Try this one as is,
function offlight_init(e)
end
function offlight_main(e)
lightNum = GetEntityLightNumber( 2 ) -- here type your light id to fit your needs.
if g_Entity[e]['plrinzone']==1 then
PlaySound(e,0)
local range = GetLightRange ( lightNum )
SetLightRange ( lightNum, 0 )
Destroy(e)
end
end
HideLight(lightNum) looks like does not work atm.
Edit: I must add something important here; You can notice on that chunk of code I'm using 2 as my light id, change by yours to fit your needs.
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz
OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4