aboutsummaryrefslogtreecommitdiff
path: root/gamemode/client/cl_npcmap.lua
blob: 784ca453169efc19ba2b9e9bab540446fe52e44c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
local drawmap = false
hook.Add( "ScoreboardShow", "ShowNPCMap", function()
    print("Showing npc map")
    drawmap = true
    return true
end )
hook.Add( "ScoreboardHide", "ShowNPCMap", function()
    print("Hiding npc map")
    drawmap = false
end )
local white = Color( 255, 255, 255, 255 )

hook.Add( "HUDPaint", "paintsprites", function()
    if drawmap then
        LocalPlayer().MapIcons = LocalPlayer().MapIcons or {}
        cam.Start3D()
        for k,v in pairs(LocalPlayer().MapIcons) do
            render.SetMaterial( v.material )
            render.DrawSprite( v.pos, 64, 64, white )
        end
        cam.End3D()
    end
end )