wyozi / wmc-plus

Media center addon for Garry's Mod
MIT License
1 stars 1 forks source link

Corrected hook arguments to use the correct ID #6

Closed yupi2 closed 8 years ago

yupi2 commented 8 years ago

Here's a corrected example of usage

hook.Add("WMCPMedialistRowRightClick", "WMCPAddDebugItem", function(menu, mediaId, line, media)
    menu:AddSpacer()

    menu:AddOption("Print data", function()
        print("Printing debug data from WMCP")
        print("menu: ", menu)
        print("mediaId: ", mediaId)
        print("line:", line)
        print("media:")
        PrintTable(media or {}, 1)
        print("")
    end):SetImage("icon16/lightning.png")
end)