Hi, I’m trying to create an area where npc vehicles don’t have to spawn. I tried to create a plugin that uses RemoveVehiclesFromGeneratorsInArea native function.
resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937' client_script 'client.lua'
RemoveVehiclesFromGeneratorsInArea(-71.3, -1123.0, 20.0, 0.0, -1081.5, 40.0)
But it seems not working. So out of curiosity I tried to put the command in a loop and it seems to work. Code like:
Citizen.CreateThread(function() while true do Wait(0) RemoveVehiclesFromGeneratorsInArea(-71.3, -1123.0, 20.0, 0.0, -1081.5, 40.0) end end)
But I don’t think it’s correct. I think there is a waste of resources. Does anyone have ideas?
I would like to know how to use native functions
Thank you in advance