Advertisement
henoireil

Untitled

Aug 21st, 2017
2,300
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.15 KB | None | 0 0
  1. -- Script written by Havanna (http://steamcommunity.com/id/HavannaPC/)
  2. -- CONFIGURE HERE
  3. local FastFoodTexture = "mc_donald" -- tacobell, mc_donald, quick, kfc
  4. local BankTexture = "credit_agricole" -- bank_of_america, credit_agricole, societe_generale, bn_paribas
  5. local PoliceStationTexture = "police_fr" -- police_departementale, police_fr, police_be, police_qc
  6.  
  7. -- DONT EDIT HERE
  8. local FastFoodTextures = {["tacobell"] = {"brush1_taco"}, ["mc_donald"] = {"brush_pub_mcdo", "dyn_pan_mcdo"}, ["quick"] = {"brush_pub_quick", "dyn_pan_quick"}, ["kfc"] = {"brush_kfc", "dyn_kfc"}}
  9. local PoliceStationTextures = {["police_departementale"] = {"brush_police_dp"}, ["police_fr"] = {"brush_police_fr", "dyn_police_fr"}, ["police_be"] = {"brush_police_be", "dyn_police_be"}, ["police_qc"] = {"brush_police_qc"}}
  10. local BankTextures = {["credit_agricole"] = {"brush1_credit"}, ["societe_generale"] = {"brush1_sg"}, ["bn_paribas"] = {"brush1_bnp"}, ["bank_of_america"] = {"brush1_boa"}}
  11. local TexturesIndex = {["tacobell"] = "0", ["mc_donald"] = "1", ["quick"] = "2", ["kfc"] = "3", ["bank_of_america"] = "6", ["credit_agricole"] = "7", ["societe_generale"] = "8", ["bn_paribas"] = "9", ["police_departementale"] = "10", ["police_fr"] = "11", ["police_be"] = "12", ["police_qc"] = "13"}
  12.  
  13. local function EditEntity(ent, value)
  14.     for k, v in pairs (ent) do
  15.         for k, v in pairs(ents.FindByName(v)) do v:Fire(value) end
  16.     end
  17. end
  18.  
  19. local function EditBuilding(current_table, button_ent, current_value)
  20.     for k, v in pairs (current_table) do
  21.         if k == current_value then
  22.             EditEntity(v, "Enable")
  23.         else
  24.             EditEntity(v, "Disable")
  25.         end
  26.     end
  27.     for k, v in pairs(ents.FindByName(button_ent)) do v:Fire("SetTextureIndex", TexturesIndex[current_value]) end
  28. end
  29.  
  30. local function custom_buildings()
  31.     timer.Simple( 5, function()
  32.         EditBuilding(FastFoodTextures, "texturetoggle_fastfood", FastFoodTexture)
  33.         EditBuilding(BankTextures, "texturetoggle_bank", BankTexture)
  34.         EditBuilding(PoliceStationTextures, "texturetoggle_police", PoliceStationTexture)
  35.     end)
  36. end
  37. hook.Add("InitPostEntity", "rp_rockford_open", custom_buildings)
  38. hook.Add("PostCleanupMap", "rp_rockford_open", custom_buildings)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement