Guest User

Untitled

a guest
Aug 17th, 2021
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.57 KB | None | 0 0
  1. function init()
  2.     unlimitedammo = GetBool("savegame.mod.unlimitedammo")
  3.     unlimitedclip = GetBool("savegame.mod.unlimitedclip")
  4.     input_mode = GetString("savegame.mod.mode_input")
  5.     input_type = GetString("savegame.mod.type_input")
  6.     input_bullet_spread = GetString("savegame.mod.bullet_spread")
  7.     input_scope = GetString("savegame.mod.scope_input")
  8.     smoke_firing = GetFloat("savegame.mod.smoke_firing")
  9.     smoke_impact = GetFloat("savegame.mod.smoke_impact")
  10.     if input_mode == "" then input_mode = "C" end
  11.     if input_type == "" then input_type = "V" end
  12.     if input_scope == "" then input_scope = "T" end
  13.     if input_bullet_spread == "" then input_bullet_spread = "Z" end
  14.     if smoke_firing == 0 then smoke_firing = 5 end
  15.     if smoke_impact == 0 then smoke_impact = 20 end
  16.     changing_mode = 0
  17.     smoke_amount_changed = false
  18. end
  19.  
  20. function draw()
  21.     UiTranslate(UiCenter(), 350)
  22.     UiAlign("center middle")
  23.  
  24.     UiFont("bold.ttf", 48)
  25.     UiText("P90 by gs_115")
  26.     UiFont("regular.ttf", 26)
  27.     UiTranslate(0, 150)
  28.     UiPush()
  29.         UiTranslate(95, -100)
  30.         UiButtonImageBox("ui/common/box-outline-6.png", 6, 6)
  31.         last_input = InputLastPressedKey()
  32.         if last_input ~= "" then
  33.             if changing_mode == 1 then input_mode = last_input
  34.                 elseif changing_mode == 2 then input_type = last_input
  35.                 elseif changing_mode == 3 then input_scope = last_input
  36.                 elseif changing_mode == 4 then input_bullet_spread = last_input
  37.             end
  38.             SetString("savegame.mod.mode_input", input_mode)
  39.             SetString("savegame.mod.type_input", input_type)
  40.             SetString("savegame.mod.scope_input", input_scope)
  41.             SetString("savegame.mod.bullet_spread", input_bullet_spread)
  42.             changing_mode = 0
  43.         end
  44.        
  45.         if UiTextButton(input_mode, 50, 30) and changing_mode == 0 then --Mode Input
  46.             input_mode = "..."
  47.             changing_mode = 1
  48.         end
  49.         UiTranslate(-110, 0)
  50.         UiText("Auto/Semi-Auto:", 110, 30)
  51.         UiTranslate(110, 20)
  52.        
  53.         if UiTextButton(input_type, 50, 30) and changing_mode == 0 then --Type Input
  54.             input_type = "..."
  55.             changing_mode = 2
  56.         end
  57.         UiTranslate(-128, 0)
  58.         UiText("Change Ammo Type:", 150, 30)
  59.         UiTranslate(128, 20)
  60.        
  61.         if UiTextButton(input_scope, 50, 30) and changing_mode == 0 then --Scope Input
  62.             input_scope = "..."
  63.             changing_mode = 3
  64.         end
  65.         UiTranslate(-97, 0)
  66.         UiText("Change Sight:", 150, 30)
  67.         UiTranslate(97, 20)
  68.        
  69.         if UiTextButton(input_bullet_spread, 50, 30) and changing_mode == 0 then --Bullet spread
  70.             input_bullet_spread = "..."
  71.             changing_mode = 4
  72.         end
  73.         UiTranslate(-180, 0)
  74.         UiText("Adjust spread: Mouse Wheel + ", 150, 30)
  75.     UiPop()
  76.     UiTranslate(0, 100)
  77.     UiPush()
  78.         UiTranslate(-50, -10)
  79.         UiText("Shooting: Smoke Amount:" ,150, 30)
  80.         UiTranslate(-22, 15)
  81.         UiText("Bullet Impact: Smoke Amount:" ,150, 30)
  82.         UiTranslate(180, -70)
  83.         UiButtonImageBox("ui/common/box-outline-6.png", 6, 6)
  84.         if UiTextButton("<", 40 ,30) then smoke_amount_changed, smoke_firing = true, math.max(math.floor(smoke_firing-1), 0.1)  end
  85.         UiTranslate(45, 0)
  86.         UiText(math.floor(smoke_firing), 40 ,30)
  87.         UiTranslate(45, -26)
  88.         if UiTextButton(">", 40 ,30) then smoke_amount_changed, smoke_firing = true, math.min(math.floor(smoke_firing+1), 20)  end
  89.        
  90.         UiTranslate(-90, 40)
  91.         if UiTextButton("<", 40 ,30) then smoke_amount_changed, smoke_impact = true, math.max(math.floor(smoke_impact-1), 0.1) end
  92.         UiTranslate(45, 0)
  93.         UiText(math.floor(smoke_impact), 40 ,30)
  94.         UiTranslate(45, -26)
  95.         if UiTextButton(">", 40 ,30) then smoke_amount_changed, smoke_impact = true, math.min(math.floor(smoke_impact+1), 20) end
  96.         if smoke_amount_changed then
  97.             smoke_amount_changed = false
  98.             SetFloat("savegame.mod.smoke_firing", smoke_firing)
  99.             SetFloat("savegame.mod.smoke_impact", smoke_impact)
  100.         end
  101.        
  102.         -- UiTranslate(-90, 40)
  103.         -- if UiTextButton("<", 40 ,30) then bullet_spread_changed, bullet_spread = true, math.max(math.floor(bullet_spread-1), 0) end
  104.         -- UiTranslate(45, 0)
  105.         -- UiText(math.floor(bullet_spread), 40 ,30)
  106.         -- UiTranslate(45, -26)
  107.         -- if UiTextButton(">", 40 ,30) then bullet_spread_changed, bullet_spread = true, math.min(math.floor(bullet_spread+1), 20) end
  108.         -- if bullet_spread_changed then
  109.             -- bullet_spread_changed = false
  110.             -- SetFloat("savegame.mod.bullet_spread", bullet_spread)
  111.         -- end
  112.        
  113.     UiPop()
  114.     UiTranslate(0, 100)
  115.     UiPush()
  116.         UiText("Unlimited Clip")
  117.         UiTranslate(15, 40)
  118.         UiAlign("right")
  119.         UiColor(0.5, 0.8, 1)
  120.         if unlimitedclip then
  121.             if UiTextButton("Yes", 40, 20) then
  122.                 unlimitedclip = false
  123.                 unlimitedammo = false
  124.                 SetBool("savegame.mod.unlimitedclip", unlimitedclip)
  125.                 SetBool("savegame.mod.unlimitedammo", unlimitedammo)
  126.             end
  127.         else
  128.             if UiTextButton("No", 40, 20) then
  129.                 unlimitedclip = true
  130.                 unlimitedammo = false
  131.                 SetBool("savegame.mod.unlimitedclip", unlimitedclip)
  132.                 SetBool("savegame.mod.unlimitedammo", unlimitedammo)
  133.             end
  134.         end
  135.     UiPop()
  136.     if unlimitedclip then
  137.         UiPush()
  138.             UiTranslate(15, 60)
  139.             UiText("Unlimited Ammo")
  140.             UiTranslate(0, 40)
  141.             UiAlign("right")
  142.             UiColor(0.5, 0.8, 1)
  143.             if unlimitedammo then
  144.                 if UiTextButton("Yes", 40, 20) then
  145.                     unlimitedammo = false
  146.                     SetBool("savegame.mod.unlimitedammo", unlimitedammo)
  147.                 end
  148.             else
  149.                 if UiTextButton("No", 40, 20) then
  150.                     unlimitedammo = true
  151.                     SetBool("savegame.mod.unlimitedammo", unlimitedammo)
  152.                 end
  153.         end
  154.          UiPop()
  155.     end
  156.  
  157.     UiButtonImageBox("ui/common/box-outline-6.png", 6, 6)
  158.  
  159.     local pos_y
  160.     if unlimitedclip then pos_y = 140 else pos_y = 80 end
  161.     UiTranslate(0, pos_y)
  162.     if UiTextButton("Close", 80, 40) then
  163.         Menu()
  164.     end
  165. end
Advertisement
Add Comment
Please, Sign In to add comment