mirror of
https://github.com/HaodongMo/ARC-9.git
synced 2025-03-04 03:02:58 -05:00
kill counter track nextbots
This commit is contained in:
parent
657760b201
commit
5f69e1ac06
@ -15,4 +15,13 @@ end)
|
||||
|
||||
net.Receive("arc9_stoppickup", function(len)
|
||||
LocalPlayer().ARC9_HoldingProp = nil
|
||||
end)
|
||||
|
||||
net.Receive("arc9_sendnpckill", function(len)
|
||||
local ent = net.ReadEntity()
|
||||
|
||||
local wpn = LocalPlayer():GetActiveWeapon()
|
||||
if IsValid(wpn) and wpn.ARC9 then
|
||||
wpn:RunHook("Hook_OnKill", ent)
|
||||
end
|
||||
end)
|
@ -63,7 +63,7 @@ ATT.Hook_OnKill = function(self, ent)
|
||||
sql.Query("INSERT INTO arc9_killcounter (weapon, npckills, playerkills) VALUES ('" .. weapon .. "', 0, 0)")
|
||||
end
|
||||
|
||||
if ent:IsNPC() then
|
||||
if ent:IsNPC() or ent:IsNextBot() then
|
||||
npckills = npckills + 1
|
||||
sql.Query("UPDATE arc9_killcounter SET npckills = " .. npckills .. " WHERE weapon = '" .. weapon .. "'")
|
||||
else
|
||||
|
@ -12,6 +12,7 @@ util.AddNetworkString("arc9_randomizeatts")
|
||||
util.AddNetworkString("arc9_sendblacklist")
|
||||
util.AddNetworkString("arc9_proppickup")
|
||||
util.AddNetworkString("arc9_stoppickup")
|
||||
util.AddNetworkString("arc9_sendnpckill")
|
||||
|
||||
if game.SinglePlayer() then
|
||||
|
||||
|
@ -26,6 +26,17 @@ hook.Add( "entity_killed", "entity_killed_example", function( data )
|
||||
end
|
||||
end )
|
||||
|
||||
hook.Add("OnNPCKilled", "ARC9_OnNPCKilled", function(npc, attacker, inflictor)
|
||||
local wpn = attacker:GetActiveWeapon()
|
||||
if IsValid(wpn) and wpn.ARC9 then
|
||||
wpn:RunHook("Hook_OnKill", npc)
|
||||
|
||||
net.Start("arc9_sendnpckill")
|
||||
net.WriteEntity(npc)
|
||||
net.Send(attacker)
|
||||
end
|
||||
end)
|
||||
|
||||
timer.Simple(10, function() -- tfa does same thing, no need to copy (timer here cuz tfa loads after arc9)
|
||||
if !TFA then
|
||||
-- code stolen from wiki
|
||||
|
@ -12,4 +12,5 @@
|
||||
"animatedtextureframenumvar" "$frame"
|
||||
"animatedtextureframerate" 25.00
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user