Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if SERVER then
- local SHOW_KILLER_ROLE = true
- local FREE_TO_KILL = true
- ServerLog("AWarn: TTT Teamkill Module Loaded!\n")
- function awarn_warn_ttt_teamkill( ply, ent, killer )
- if GetRoundState() != ROUND_POST and killer:IsPlayer() and ply:IsPlayer() then
- local pid = ply:UniqueID()
- if SHOW_KILLER_ROLE then
- player.GetByUniqueID(pid):PrintMessage( HUD_PRINTTALK, "You got killed by a "..killer:GetRoleString().."!" )
- end
- if !ply.vogelfrei then
- local was_teamkill = false
- if killer:GetRole() == ply:GetRole() and killer:GetName() != ply:GetName() then
- args = { killer:EntIndex(), "Autowarn: Teamkill" }
- awarn_con_warn(nil, nil, args)
- was_teamkill = true
- elseif killer:GetRole() == ROLE_INNOCENT and ply:GetRole() == ROLE_DETECTIVE then
- args = { killer:EntIndex(), "Autowarn: Detekill" }
- awarn_con_warn(nil, nil, args)
- was_teamkill = true
- end
- if !killer.vogelfrei and was_teamkill and FREE_TO_KILL then
- killer.vogelfrei = true
- print( "[FTK]", killer:Nick(), " is free to kill because teamkill" )
- end
- end
- end
- end
- function awarn_vogelfrei( ply, atk, hp, dmg )
- if GetRoundState() != ROUND_POST and atk:IsPlayer() and ply:IsPlayer() then
- if atk:GetRole() == ply:GetRole() and atk:GetName() != ply:GetName() then
- atk.teamdmg = atk.teamdmg + dmg
- elseif atk:GetRole() == ROLE_INNOCENT and ply:GetRole() == ROLE_DETECTIVE then
- atk.teamdmg = atk.teamdmg + dmg
- end
- if atk.teamdmg > 40 and !atk.vogelfrei and FREE_TO_KILL then
- atk.vogelfrei = true
- print( "[FTK]", atk:Nick(), " is free to kill because ", atk.teamdmg, " teamdmg" )
- end
- end
- end
- function awarn_reset( ply )
- ply.teamdmg = 0
- ply.vogelfrei = false
- end
- hook.Add( "PlayerDeath", "awarn_warn_ttt_teamkill", awarn_warn_ttt_teamkill )
- hook.Add( "PlayerHurt", "awarn_vogelfrei", awarn_vogelfrei )
- hook.Add( "PlayerSpawn", "arwarn_reset", awarn_reset )
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement