mirror of
https://github.com/lifestorm/wnsrc.git
synced 2025-12-17 21:53:46 +03:00
Upload
This commit is contained in:
19
gamemodes/ixhl2rp/plugins/combattimer/sh_plugin.lua
Normal file
19
gamemodes/ixhl2rp/plugins/combattimer/sh_plugin.lua
Normal file
@@ -0,0 +1,19 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
|
||||
local PLUGIN = PLUGIN
|
||||
local ix = ix
|
||||
|
||||
PLUGIN.name = "Combat Timer"
|
||||
PLUGIN.description = "Adds a combat timer the moment a player takes damage."
|
||||
PLUGIN.author = "Asimo"
|
||||
|
||||
ix.util.Include("sv_hooks.lua")
|
||||
24
gamemodes/ixhl2rp/plugins/combattimer/sv_hooks.lua
Normal file
24
gamemodes/ixhl2rp/plugins/combattimer/sv_hooks.lua
Normal file
@@ -0,0 +1,24 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
local PLUGIN = PLUGIN
|
||||
|
||||
function PLUGIN:EntityTakeDamage(entity, damage)
|
||||
if !entity:IsPlayer() then
|
||||
return
|
||||
end
|
||||
|
||||
if timer.Exists("combattimer" .. entity:SteamID64()) then
|
||||
timer.Adjust("combattimer" .. entity:SteamID64(), 30, nil, nil)
|
||||
else
|
||||
entity:Notify("You have taken damage and are now considered to be in combat.")
|
||||
timer.Create("combattimer" .. entity:SteamID64(), 30, 1, function() if !IsValid(entity) then return end entity:Notify("You are no longer considered to be in combat.") end )
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user