I already asked something about the achievement addon I recently bought and wanted to add an achievement which you get if you kill 2 traitors as an innocent with a H.U.G.E in one round. This thread was closed because I should ask the creater of the addon. The problem is: He doesn't respond to my messages. I tried to figure out myself how I can write this achievement and after a few tries I got this:
[CODE]
/* ──────────────────────────────────────────────────────────────────
Kill 2TraitorInRound with Huge - 1
────────────────────────────────────────────────────────────────── */
local ACVMT = ACV_CreateACVStruct()
ACVMT.LuaName = "ACV_TTT_MasterInnocent_Kill2TraitorHUGE"
ACVMT.PrintName = "Dat Killabstauber"
ACVMT.Description = "Töte 2 Traitor als Innocent mit einer H.U.G.E in einer Runde"
ACVMT.Category = "Spezial"
ACVMT.Order = 5
ACVMT.Min = 0
ACVMT.Max = 1
function ACVMT:OnClear(ply)
ply:PS_GivePoints(500)
end
RegisterACVMT(ACVMT)
if SERVER then
hook.Add("PlayerDeath","ACV " .. "PlayerDeath" .. ACVMT.LuaName,function( victim, infl, attacker, dmginfo )
if victim:IsPlayer() and attacker:IsPlayer() then
if victim:GetRole() == ROLE_TRAITOR and attacker:GetRole() == ROLE_INNOCENT then
local wepName = getWepName(dmginfo)
if wepName == weapon_zm_sledge then
attacker.ACV_TraitorKillCountHUGE = attacker.ACV_TraitorKillCountHUGE or 0
attacker.ACV_TraitorKillCountHUGE = attacker.ACV_TraitorKillCountHUGE + 1
if attacker.ACV_TraitorKillCountHUGE == 2 then
attacker:ACV_Increase(ACVMT.LuaName,1)
end
end
end
end
end)
hook.Add("TTTEndRound","ACV " .. "TTTEndRound" .. ACVMT.LuaName,function(type)
for k,v in pairs(player.GetAll()) do
v.ACV_TraitorKillCountHUGE = 0
end
end)
end[/CODE]
If I set this achievement and restart the server the achievement shows up in the achievement menu, but it doesn't work properly at all. The achievement ensures that if a traitor (only a traitor) dies, he is red marked (even without identification) on TAB and he can still speak with the living people even as a dead person. (without recognizeable error in the console)
I really want to get this kind of achievement, could someone help me fix that even without posting this to the autor himself?
Sorry, you need to Log In to post a reply to this thread.