Recently I got an addon which allows me to create custome achievements in GMod and I have the question if I could add achievements which are weapon related. Like you have to overall kill 3 Innocents with a H.U.G.E or something. I don't want to add the creater of the script in Steam because I want them to have some privace too. ^^ The achievements look like so: (these are just a few examples, I hope noone minds if I post them, they don't have code which is extremely important for the addon)
[CODE]/* ──────────────────────────────────────────────────────────────────
Kill Innocent - 50
────────────────────────────────────────────────────────────────── */
local ACVMT = ACV_CreateACVStruct()
ACVMT.LuaName = "ACV_TTT_MasterTraitor_KillInnocent50"
ACVMT.PrintName = "Anti Innocent"
ACVMT.Description = "Kill 50 Traitors as an Innocent"
ACVMT.Category = "Master Traitor"
ACVMT.Order = 3
ACVMT.Min = 0
ACVMT.Max = 50
function ACVMT:OnClear(ply)
ply:PS_GivePoints(150)
end
RegisterACVMT(ACVMT)
if SERVER then
hook.Add("PlayerDeath","ACV " .. "PlayerDeath" .. ACVMT.LuaName,function( victim, infl, attacker)
if victim:IsPlayer() and attacker:IsPlayer() then
if victim:GetRole() == ROLE_INNOCENT and attacker:GetRole() == ROLE_TRAITOR then
attacker:ACV_Increase(ACVMT.LuaName,1)
end
end
end)
end[/CODE]
or
[CODE]/* ──────────────────────────────────────────────────────────────────
Become - 500
────────────────────────────────────────────────────────────────── */
local ACVMT = ACV_CreateACVStruct()
ACVMT.LuaName = "ACV_TTT_MasterTraitor_Become500"
ACVMT.PrintName = "Traitor Addicted"
ACVMT.Description = "Become Traitor 500 times"
ACVMT.Category = "Master Traitor"
ACVMT.Order = 1
ACVMT.Min = 0
ACVMT.Max = 500
function ACVMT:OnClear(ply)
ply:PS_GivePoints(800)
end
RegisterACVMT(ACVMT)
if SERVER then
local Timer = CurTime()
hook.Add("TTTBeginRound","ACV " .. "TTTBeginRound" .. ACVMT.LuaName,function()
for k,v in pairs(player.GetAll()) do
if v:GetRole() == ROLE_TRAITOR then
v:ACV_Increase(ACVMT.LuaName,1)
end
end
end)
end[/CODE]
If you know what I have to change, feel free to let me know. :D
I dont understand your reasons for not talking to the creator...
Hook to PlayerDeath, if the Inflictor's class equals the HUGE (weapon_zm_sledge) then increase the count by 1
Please see Developer Discussion for help threads, thanks!
Sorry, you need to Log In to post a reply to this thread.