Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function init()
- unlimitedammo = GetBool("savegame.mod.unlimitedammo")
- unlimitedclip = GetBool("savegame.mod.unlimitedclip")
- input_mode = GetString("savegame.mod.mode_input")
- input_type = GetString("savegame.mod.type_input")
- input_bullet_spread = GetString("savegame.mod.bullet_spread")
- input_scope = GetString("savegame.mod.scope_input")
- smoke_firing = GetFloat("savegame.mod.smoke_firing")
- smoke_impact = GetFloat("savegame.mod.smoke_impact")
- if input_mode == "" then input_mode = "C" end
- if input_type == "" then input_type = "V" end
- if input_scope == "" then input_scope = "T" end
- if input_bullet_spread == "" then input_bullet_spread = "Z" end
- if smoke_firing == 0 then smoke_firing = 5 end
- if smoke_impact == 0 then smoke_impact = 20 end
- changing_mode = 0
- smoke_amount_changed = false
- end
- function draw()
- UiTranslate(UiCenter(), 350)
- UiAlign("center middle")
- UiFont("bold.ttf", 48)
- UiText("P90 by gs_115")
- UiFont("regular.ttf", 26)
- UiTranslate(0, 150)
- UiPush()
- UiTranslate(95, -100)
- UiButtonImageBox("ui/common/box-outline-6.png", 6, 6)
- last_input = InputLastPressedKey()
- if last_input ~= "" then
- if changing_mode == 1 then input_mode = last_input
- elseif changing_mode == 2 then input_type = last_input
- elseif changing_mode == 3 then input_scope = last_input
- elseif changing_mode == 4 then input_bullet_spread = last_input
- end
- SetString("savegame.mod.mode_input", input_mode)
- SetString("savegame.mod.type_input", input_type)
- SetString("savegame.mod.scope_input", input_scope)
- SetString("savegame.mod.bullet_spread", input_bullet_spread)
- changing_mode = 0
- end
- if UiTextButton(input_mode, 50, 30) and changing_mode == 0 then --Mode Input
- input_mode = "..."
- changing_mode = 1
- end
- UiTranslate(-110, 0)
- UiText("Auto/Semi-Auto:", 110, 30)
- UiTranslate(110, 20)
- if UiTextButton(input_type, 50, 30) and changing_mode == 0 then --Type Input
- input_type = "..."
- changing_mode = 2
- end
- UiTranslate(-128, 0)
- UiText("Change Ammo Type:", 150, 30)
- UiTranslate(128, 20)
- if UiTextButton(input_scope, 50, 30) and changing_mode == 0 then --Scope Input
- input_scope = "..."
- changing_mode = 3
- end
- UiTranslate(-97, 0)
- UiText("Change Sight:", 150, 30)
- UiTranslate(97, 20)
- if UiTextButton(input_bullet_spread, 50, 30) and changing_mode == 0 then --Bullet spread
- input_bullet_spread = "..."
- changing_mode = 4
- end
- UiTranslate(-180, 0)
- UiText("Adjust spread: Mouse Wheel + ", 150, 30)
- UiPop()
- UiTranslate(0, 100)
- UiPush()
- UiTranslate(-50, -10)
- UiText("Shooting: Smoke Amount:" ,150, 30)
- UiTranslate(-22, 15)
- UiText("Bullet Impact: Smoke Amount:" ,150, 30)
- UiTranslate(180, -70)
- UiButtonImageBox("ui/common/box-outline-6.png", 6, 6)
- if UiTextButton("<", 40 ,30) then smoke_amount_changed, smoke_firing = true, math.max(math.floor(smoke_firing-1), 0.1) end
- UiTranslate(45, 0)
- UiText(math.floor(smoke_firing), 40 ,30)
- UiTranslate(45, -26)
- if UiTextButton(">", 40 ,30) then smoke_amount_changed, smoke_firing = true, math.min(math.floor(smoke_firing+1), 20) end
- UiTranslate(-90, 40)
- if UiTextButton("<", 40 ,30) then smoke_amount_changed, smoke_impact = true, math.max(math.floor(smoke_impact-1), 0.1) end
- UiTranslate(45, 0)
- UiText(math.floor(smoke_impact), 40 ,30)
- UiTranslate(45, -26)
- if UiTextButton(">", 40 ,30) then smoke_amount_changed, smoke_impact = true, math.min(math.floor(smoke_impact+1), 20) end
- if smoke_amount_changed then
- smoke_amount_changed = false
- SetFloat("savegame.mod.smoke_firing", smoke_firing)
- SetFloat("savegame.mod.smoke_impact", smoke_impact)
- end
- -- UiTranslate(-90, 40)
- -- if UiTextButton("<", 40 ,30) then bullet_spread_changed, bullet_spread = true, math.max(math.floor(bullet_spread-1), 0) end
- -- UiTranslate(45, 0)
- -- UiText(math.floor(bullet_spread), 40 ,30)
- -- UiTranslate(45, -26)
- -- if UiTextButton(">", 40 ,30) then bullet_spread_changed, bullet_spread = true, math.min(math.floor(bullet_spread+1), 20) end
- -- if bullet_spread_changed then
- -- bullet_spread_changed = false
- -- SetFloat("savegame.mod.bullet_spread", bullet_spread)
- -- end
- UiPop()
- UiTranslate(0, 100)
- UiPush()
- UiText("Unlimited Clip")
- UiTranslate(15, 40)
- UiAlign("right")
- UiColor(0.5, 0.8, 1)
- if unlimitedclip then
- if UiTextButton("Yes", 40, 20) then
- unlimitedclip = false
- unlimitedammo = false
- SetBool("savegame.mod.unlimitedclip", unlimitedclip)
- SetBool("savegame.mod.unlimitedammo", unlimitedammo)
- end
- else
- if UiTextButton("No", 40, 20) then
- unlimitedclip = true
- unlimitedammo = false
- SetBool("savegame.mod.unlimitedclip", unlimitedclip)
- SetBool("savegame.mod.unlimitedammo", unlimitedammo)
- end
- end
- UiPop()
- if unlimitedclip then
- UiPush()
- UiTranslate(15, 60)
- UiText("Unlimited Ammo")
- UiTranslate(0, 40)
- UiAlign("right")
- UiColor(0.5, 0.8, 1)
- if unlimitedammo then
- if UiTextButton("Yes", 40, 20) then
- unlimitedammo = false
- SetBool("savegame.mod.unlimitedammo", unlimitedammo)
- end
- else
- if UiTextButton("No", 40, 20) then
- unlimitedammo = true
- SetBool("savegame.mod.unlimitedammo", unlimitedammo)
- end
- end
- UiPop()
- end
- UiButtonImageBox("ui/common/box-outline-6.png", 6, 6)
- local pos_y
- if unlimitedclip then pos_y = 140 else pos_y = 80 end
- UiTranslate(0, pos_y)
- if UiTextButton("Close", 80, 40) then
- Menu()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment