diff options
| author | Alexander Pickering <alexandermpickering@gmail.com> | 2016-08-09 17:53:52 -0400 |
|---|---|---|
| committer | Alexander Pickering <alexandermpickering@gmail.com> | 2016-08-09 17:53:52 -0400 |
| commit | d4f197a35c207c9891d3f4dc5e9708af48c935de (patch) | |
| tree | ee8fd3960c3a3fb4ecaf0f62b50d251f007ebaf3 /gamemode/shared/sh_quests.lua | |
| parent | 2fe3c4551344870e3784733fce2d95027b5c8382 (diff) | |
| download | artery-d4f197a35c207c9891d3f4dc5e9708af48c935de.tar.gz artery-d4f197a35c207c9891d3f4dc5e9708af48c935de.tar.bz2 artery-d4f197a35c207c9891d3f4dc5e9708af48c935de.zip | |
Added some weapons
Diffstat (limited to 'gamemode/shared/sh_quests.lua')
| -rw-r--r-- | gamemode/shared/sh_quests.lua | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/gamemode/shared/sh_quests.lua b/gamemode/shared/sh_quests.lua new file mode 100644 index 0000000..ace050a --- /dev/null +++ b/gamemode/shared/sh_quests.lua @@ -0,0 +1,35 @@ +--[[ + Details how quests are handeled +]] + +local pmeta = FindMetaTable("Player") + +if SERVER then + util.AddNetworkString("synchquest") +end + +function pmeta:SynchronizeQuest(name) + net.Start("synchquest") + net.WriteString(name) + net.WriteUInt(self.Quests[name],16) + net.Send(self) +end + +if CLIENT then + net.Receive("synchquest",function() + LocalPlayer().Quests = LocalPlayer().Quests or {} + print("Got quest status") + local questname,queststatus = net.ReadString(), net.ReadUInt(16) + LocalPlayer().Quests[questname] = queststatus + end) + + ART.Quests = ART.Quests or {} + function ART.RegisterQuest(tbl) + assert(ART.Quests[tbl.Name] == nil,"Tried to register two quests with the same name:" .. tbl.Name) + ART.Quests[tbl.Name] = tbl + end + + function ART.GetQuest(name) + return ART.Quests[name] + end +end |
