daily pastebin goal
17%
SHARE
TWEET

Untitled

a guest Jun 13th, 2018 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local updateFrequency = 0.5 // In seconds
  2. sgm_getVehicleListCache = {}
  3. function sgm_getVehicleList(mdl)
  4.     if !sgm_getVehicleListCache[mdl] or sgm_getVehicleListCache[mdl].rescanTime >= CurTime() then
  5.         sgm_getVehicleListCache[mdl] = {rescanTime = CurTime()+updateFrequency, data}
  6.         for k,v in pairs(ents.FindByClass("prop_vehicle_jeep*")) do
  7.             if IsValid(v) then
  8.                 local tempmdl = v:GetModel()
  9.                 if tempmdl == mdl then
  10.                     table.insert(sgm_getVehicleListCache[mdl].data, v)
  11.                 end
  12.             end
  13.         end
  14.     end
  15.  
  16.     return sgm_getVehicleListCache[mdl].data
  17. end
  18.  
  19. function handleCVPI_FH3(ent)
  20. end
  21.  
  22. hook.Add("Think", "SGM_CachedVehicleThink", function()
  23.     for k,ent in pairs(sgm_getVehicleList("models/sentry/cvpi_fh3.mdl")) do
  24.         handleCVPI_FH3(ent)
  25.     end
  26. end)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top