Thanks. I have one more question. How to make that the victim was only one player from team "TEAM_UNDEAD" at which I shoot?
[QUOTE=godred2;47423660]Thanks. I have one more question. How to make that the victim was only one player from team "TEAM_UNDEAD" at which I shoot?[/QUOTE]
If by that you mean only dealing increased damage to one player, just add another check:
[lua]
local function HookEntityTakeDamage( victim, dmginfo )
local attacker = dmginfo:GetAttacker()
-- Check entities are valid
if not IsValid( victim ) or not IsValid( attacker ) then return end
-- Check they're both players
if not victim:IsPlayer() or not attacker:IsPlayer() then return end
-- Check the attacker is a human, and the target is undead
if victim:Team() ~= TEAM_UNDEAD or attacker:Team() ~= TEAM_HUMAN then return end
-- Check we're only attacking special player here:
-- As an example, this checks for a SteamID. You'll probably want a different check.
if victim:SteamID() ~= "STEAM_0:0:12345678" then return end
-- Massive Damage!
dmginfo:ScaleDamage( 100.75 )
end
hook.Add( "EntityTakeDamage", "dmg11", HookEntityTakeDamage )
[/lua]
[QUOTE=Lixquid;47423789]If by that you mean only dealing increased damage to one player, just add another check:
[lua]
local function HookEntityTakeDamage( victim, dmginfo )
local attacker = dmginfo:GetAttacker()
-- Check entities are valid
if not IsValid( victim ) or not IsValid( attacker ) then return end
-- Check they're both players
if not victim:IsPlayer() or not attacker:IsPlayer() then return end
-- Check the attacker is a human, and the target is undead
if victim:Team() ~= TEAM_UNDEAD or attacker:Team() ~= TEAM_HUMAN then return end
-- Check we're only attacking special player here:
-- As an example, this checks for a SteamID. You'll probably want a different check.
if victim:SteamID() ~= "STEAM_0:0:12345678" then return end
-- Massive Damage!
dmginfo:ScaleDamage( 100.75 )
end
hook.Add( "EntityTakeDamage", "dmg11", HookEntityTakeDamage )
[/lua][/QUOTE]
And how to make that the player at whom I shoot was the victim?
Thanks to everybody who helped.
I will send you a bear.
Sorry, you need to Log In to post a reply to this thread.