From d4f197a35c207c9891d3f4dc5e9708af48c935de Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Tue, 9 Aug 2016 17:53:52 -0400 Subject: Added some weapons --- gamemode/shared/sh_npcmap.lua | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 gamemode/shared/sh_npcmap.lua (limited to 'gamemode/shared/sh_npcmap.lua') diff --git a/gamemode/shared/sh_npcmap.lua b/gamemode/shared/sh_npcmap.lua new file mode 100644 index 0000000..5c6d93c --- /dev/null +++ b/gamemode/shared/sh_npcmap.lua @@ -0,0 +1,27 @@ + +local pmeta = FindMetaTable("Player") + +if SERVER then + util.AddNetworkString("addmapicon") +end + +function pmeta:AddMapIcon(icon,position) + print("adding map icon") + net.Start("addmapicon") + net.WriteString(icon) + net.WriteVector(position) + net.Send(self) +end + +if CLIENT then + net.Receive("addmapicon",function() + print("got recieve for map icon") + LocalPlayer().MapIcons = LocalPlayer().MapIcons or {} + local matstr = net.ReadString() + local matpos = net.ReadVector() + table.insert(LocalPlayer().MapIcons,{ + ["material"] = Material(matstr), + ["pos"] = matpos, + }) + end) +end -- cgit v1.2.3-70-g09d2