Advertisement
Slopeh

Untitled

Dec 12th, 2023
15
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. function disposeSecurityDevices() local function alert(msg) PreventionSystem.ShowMessage(msg, 4.0) end local ents = Game.GetEntityList(); local nCam, nTur = 0, 0; for i, v in ipairs(ents) do local name = v:GetClassName().value; if string.find(name, 'SurveillanceCamera') then if v:IsSurveillanceCamera() then nCam = nCam + 1; v:CutPower() v:TurnOffDevice() v:DeactivateDevice() v:Dispose() end elseif string.find(name, 'SecurityTurret') then if v:IsTurret() then nTur = nTur + 1; v:ShootStop() v:TurnOffDevice() v:Dispose() end end end local noCams = 'NO Surveillance Cameras found.'; local noTurs = 'NO Security Turrets found.'; local Cams = 'REMOVED '..nCam..' Surveillance Camera/s.'; local Turs = 'REMOVED '..nTur..' Security Turret/s.'; if nCam == 0 and nTur == 0 then alert(noCams..'\n'..noTurs) print(' \n\t'..noCams..'\n\t'..noTurs..'\n ') elseif nCam > 0 and nTur == 0 then alert(noTurs..'\n'..Cams) print(' \n\t'..Cams..'\n\t'..noTurs..'\n ') elseif nCam == 0 and nTur > 0 then alert(noCams..'\n'..Turs) print(' \n\t'..noCams..'\n\t'..Turs..'\n ') elseif nCam > 0 and nTur > 0 then alert(Cams..'\n'..Turs) print(' \n\t'..Cams..'\n\t'..Turs..'\n ') end end disposeSecurityDevices()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement