aboutsummaryrefslogtreecommitdiff
path: root/gamemode/shared/sh_pac.lua
diff options
context:
space:
mode:
Diffstat (limited to 'gamemode/shared/sh_pac.lua')
-rw-r--r--gamemode/shared/sh_pac.lua29
1 files changed, 29 insertions, 0 deletions
diff --git a/gamemode/shared/sh_pac.lua b/gamemode/shared/sh_pac.lua
index 1ab9f88..1d4da41 100644
--- a/gamemode/shared/sh_pac.lua
+++ b/gamemode/shared/sh_pac.lua
@@ -2,6 +2,7 @@
All the functions related to networking pac's
]]
if CLIENT then
+ local what
local function applypac(who,pacname)
local pactxt = file.Read("artery/pacs/"..pacname..".txt","DATA")
print("got pac txt",pactxt)
@@ -26,9 +27,37 @@ if CLIENT then
print("who is",who)
who:AttachPACPart(pactbl)
print("Pac Equiped!")
+
+ what = who:FindPACPart(pactbl, "ball")
+ print("what was", what)
+ if what ~= nil then
+ print("What's position:")
+ for k,v in pairs(what) do
+ print(k,":",v)
+ end
+ print(what:GetDrawPosition(),type(what:GetDrawPosition()))
+ end
end
end
+ local RecordTrace = false
+ local swingtime
+ hook.Add("Tick","weapon_trace",function()
+ if what ~= nil and ART.TraceWeapon and RecordTrace then
+ local pos = what:GetDrawPosition()
+ local ppos = LocalPlayer():GetPos()
+ for k = 1,3 do pos[k] = pos[k] - ppos[k] end -- Now is a local vector, player is the origin
+ print(string.format("{%1.3f,Vector(%d,%d,%d)},",swingtime/1000,pos[1],pos[2],pos[3]-64))
+ swingtime = swingtime + util.TimerCycle()
+ else
+ swingtime = util.TimerCycle()
+ end
+ end)
+
+ concommand.Add("artery_dev_traceweapons",function(ply,cmd,args)
+ RecordTrace = args[1] == "1"
+ end)
+
local function removepac(who,pacname)
local pactxt = file.Read("artery/pacs/"..pacname..".txt","DATA")
assert(pactxt ~= nil, "Attempted to remove a pac that dosn't exist")