Results 1 to 11 of 11
  1. #1
    iligal_odin's Avatar
    Join Date
    Jul 2012
    Gender
    male
    Posts
    14
    Reputation
    12
    Thanks
    0
    My Mood
    Amused

    Wink Payday 2 Mission Selector (better than free crimenet)

    The code below provides a menu for selecting all missions that are implemented and working in-game (such as Big Oil not being a Pro Job or Bank Heist: Cash being a Pro Job)

    As a side note, it also serves as a demonstration for how to use my SimpleMenu class when you need submenus.
    Code:
    if not SimpleMenu then
        SimpleMenu = class()
    
        function SimpleMenu:init(title, message, options)
            self.dialog_data = { title = title, text = message, button_list = {},
                                 id = tostring(math.random(0,0xFFFFFFFF)) }
            self.visible = false
            for _,opt in ipairs(options) do
                local elem = {}
                elem.text = opt.text
                opt.data = opt.data or nil
                opt.callback = opt.callback or nil
                elem.callback_func = callback(self, self, "_do_callback",
                                              { data = opt.data,
                                                callback = opt.callback})
                elem.cancel_button = opt.is_cancel_button or false
                if opt.is_focused_button then
                    self.dialog_data.focus_button = #self.dialog_data.button_list+1
                end
                table.insert(self.dialog_data.button_list, elem)
            end
            return self
        end
    
        function SimpleMenu:_do_callback(info)
            if info.callback then
                if info.data then
                    info.callback(info.data)
                else
                    info.callback()
                end
            end
            self.visible = false
        end
    
        function SimpleMenu:show()
            if self.visible then
                return
            end
            self.visible = true
            managers.system_menu:show(self.dialog_data)
        end
    
        function SimpleMenu:hide()
            if self.visible then
                managers.system_menu:close(self.dialog_data.id)
                self.visible = false
                return
            end
        end
    end
    
    add_job = add_job or function(data)
        local difficulty_id = tweak_data:difficulty_to_index( data.difficulty )
        table.insert( managers.crimenet._presets, { job_id = data.job_id, difficulty_id = difficulty_id, difficulty = data.difficulty, chance = 1 } )
        managers.crimenet._MAX_ACTIVE_JOBS = managers.crimenet._MAX_ACTIVE_JOBS + 1
    end
    
    show_menu = show_menu or function(menu)
        menu:show()
    end
    
    mission = mission or function(job_id)
        local difficulty_opts = {
            { text = "Normal", callback = add_job, data = { difficulty = "normal", job_id = job_id } },
            { text = "Hard", callback = add_job, data = { difficulty = "hard", job_id = job_id } },
            { text = "Very Hard", callback = add_job, data = { difficulty = "overkill", job_id = job_id  } },
            { text = "Overkill", callback = add_job, data = { difficulty = "overkill_145", job_id = job_id } },
            { text = "Cancel", is_cancel_button = true},
        }
        local difficulty_menu = SimpleMenu:new("Mission Selector", "Choose Difficulty", difficulty_opts)
        difficulty_menu:show()
    end
     
    
    --Menu Contractor
    bain = bain or {
    { text = "Jewelry Store", callback = mission, data="jewelry_store" },
    { text = "Bank Heist: Gold*", callback = mission, data="branchbank_gold" },
    { text = "Bank Heist: Cash", callback = mission, data="branchbank_cash" },
    { text = "Bank Heist: Deposit", callback = mission, data="branchbank_deposit" },
    { text = "Bank Heist*", callback = mission, data="branchbank" },
    { text = "Diamond Store", callback = mission, data="family" } ,
    { text = "Bank Heist: Gold (Pro Job)", callback = mission, data="branchbank_gold_prof" },
    { text = "Bank Heist: Cash (Pro Job)*", callback = mission, data="branchbank_cash_prof" },
    { text = "Bank Heist: Deposit (Pro Job)*", callback = mission, data="branchbank_deposit_prof" },
    { text = "Bank Heist (Pro Job)", callback = mission, data="branchbank_prof" },
    { text = "Diamond Store (Pro Job)*", callback = mission, data="family_prof" },
    { text = "Cancel", is_cancel_button = true },
    }
    bainmenu = bainmenu or SimpleMenu:new("Mission Selector", "Choose Map", bain)
    hector = hector or {
    { text = "Watchdogs", callback = mission, data="watchdogs" },
    { text = "Fire Starter", callback = mission, data="firestarter" },
    { text = "Rats", callback = mission, data="alex" },
    { text = "Watchdogs (Pro Job)", callback = mission, data="watchdogs_prof" },
    { text = "Fire Starter (Pro Job)", callback = mission, data="firestarter_prof" },
    { text = "Rats (Pro Job)", callback = mission, data="alex_prof" },
    { text = "Cancel", is_cancel_button = true},
    }
    hectormenu = hectormenu or SimpleMenu:new("Mission Selector", "Choose Map", hector)
    elephant = elephant or {
    { text = "Framing Frame", callback = mission, data = "framing_frame" },
    { text = "Big Oil*", callback = mission, data = "welcome_to_the_jungle" },
    { text = "Framing Frame (Pro Job)", callback = mission, data = "mallcrasher" },
    { text = "Big Oil (Pro Job)", callback = mission, data = "welcome_to_the_jungle_prof" },
    { text = "Cancel", is_cancel_button = true},
    }
    elephantmenu = elephantmenu or SimpleMenu:new("Mission Selector", "Choose Map",elephant)
    vlad = vlad or {
    { text = "Four Stores", callback = mission, data = "four_stores" },
    { text = "Mallcrasher", callback = mission, data = "mallcrasher" },
    { text = "Nightclub", callback = mission, data = "nightclub" },
    { text = "Ukrainian Job*", callback = mission, data= "ukrainian_job" },
    { text = "Four Stores (Pro Job)*", callback = mission, data = "four_stores_prof" },
    { text = "Mallcrasher (Pro Job)*", callback = mission, data = "mallcrasher_prof" },
    { text = "Nightclub (Pro Job)*", callback = mission, data = "nightclub_prof" },
    { text = "Ukrainian Job (Pro Job)", callback = mission, data= "ukrainian_job_prof" },
    { text = "Cancel", is_cancel_button = true},
    }
    vladmenu = vladmenu or SimpleMenu:new("Mission Selector", "Choose Map",vlad)
    
    rootopts = rootopts or {
    { text = "Bain", callback = show_menu, data = bainmenu},
    { text = "Hector", callback = show_menu, data = hectormenu},
    { text = "The Elephant", callback = show_menu, data = elephantmenu},
    { text = "Vlad", callback = show_menu, data = vladmenu},
    { text = "Cancel", is_cancel_button = true},
    }
    if not rootmenu then
        managers.crimenet._NEW_JOB_MIN_TIME = 0
        managers.crimenet._NEW_JOB_MAX_TIME = 0
        managers.crimenet._presets = { }
        managers.crimenet._active_jobs = { }
        managers.crimenet._MAX_ACTIVE_JOBS = 0
        rootmenu = rootmenu or SimpleMenu:new("Mission Selector", "Choose Contractor", rootopts)
    end
    
    rootmenu:show()
    Bind it to a key and use it at the crime.net interface.

    worked on this with a friend known as Harfatus who will be posting it on another forum himself.

    the missions with the "*" cannot be played multiplayer correctly
    Last edited by iligal_odin; 09-29-2013 at 07:03 PM. Reason: extra note

  2. #2
    sandman332's Avatar
    Join Date
    Sep 2013
    Gender
    male
    Posts
    67
    Reputation
    10
    Thanks
    0
    My Mood
    Happy
    Sounds Cool. I'll give it a shot and check back with how it works.

  3. #3
    Khifetz56's Avatar
    Join Date
    Dec 2012
    Gender
    male
    Posts
    5
    Reputation
    10
    Thanks
    0
    where to downlod?

  4. #4
    meinereiner's Avatar
    Join Date
    Sep 2013
    Gender
    male
    Posts
    2
    Reputation
    10
    Thanks
    0
    How can i binded on a key?

  5. #5
    iligal_odin's Avatar
    Join Date
    Jul 2012
    Gender
    male
    Posts
    14
    Reputation
    12
    Thanks
    0
    My Mood
    Amused
    use any other iphlpapi-dll on this forum

  6. #6
    meinereiner's Avatar
    Join Date
    Sep 2013
    Gender
    male
    Posts
    2
    Reputation
    10
    Thanks
    0
    ok. thx

  7. #7
    fapdarklord's Avatar
    Join Date
    Oct 2012
    Gender
    male
    Location
    'Straya
    Posts
    465
    Reputation
    59
    Thanks
    2,333
    My Mood
    Fine
    No credits? You definitely didn't make this by yourself.

  8. #8
    Pirate Captain's Avatar
    Join Date
    Sep 2013
    Gender
    male
    Posts
    71
    Reputation
    120
    Thanks
    688
    My Mood
    Bored
    Quote Originally Posted by fapdarklord View Post
    No credits? You definitely didn't make this by yourself.


    where have you seen stuff like simple menu before? first time i heard of it was from illigal odin and harfastus

    if you have seen other around, please share link i'd like to see more simple menus

  9. #9
    iligal_odin's Avatar
    Join Date
    Jul 2012
    Gender
    male
    Posts
    14
    Reputation
    12
    Thanks
    0
    My Mood
    Amused
    thank you sir but it even said me and halfatus made it so hes just a derp D:

  10. #10
    fapdarklord's Avatar
    Join Date
    Oct 2012
    Gender
    male
    Location
    'Straya
    Posts
    465
    Reputation
    59
    Thanks
    2,333
    My Mood
    Fine
    Quote Originally Posted by iligal_odin View Post
    thank you sir but it even said me and halfatus made it so hes just a derp D:
    Indeed a mega derp, sorry about that :c

    I just looked at the code and at the bottom for credits, xoxo gossip goat from me because I'm a turd <3

    +rep btw

  11. #11
    Yokujin's Avatar
    Join Date
    Jul 2011
    Gender
    male
    Posts
    23
    Reputation
    10
    Thanks
    0
    nice script but could you update it?
    or anybody else?

Similar Threads

  1. Free FPS better than Call of Duty
    By Matroix73 in forum General Gaming
    Replies: 24
    Last Post: 07-20-2013, 04:19 PM
  2. Why my computer is better than yours...
    By arunforce in forum General
    Replies: 22
    Last Post: 04-28-2008, 12:38 PM
  3. Why PC Is Better Than MAC
    By gbitz in forum General
    Replies: 0
    Last Post: 04-08-2008, 08:03 PM
  4. selling account better than dav1e's
    By tarty67 in forum Trade Accounts/Keys/Items
    Replies: 11
    Last Post: 04-24-2007, 07:07 PM
  5. Animals that are better than you...
    By arunforce in forum General
    Replies: 2
    Last Post: 12-01-2006, 04:13 PM