Skip to content

Instantly share code, notes, and snippets.

@ValentinFunk
Last active February 12, 2018 15:48
Show Gist options
  • Select an option

  • Save ValentinFunk/4eb1737d23bfe0d79f84e8ed575386d7 to your computer and use it in GitHub Desktop.

Select an option

Save ValentinFunk/4eb1737d23bfe0d79f84e8ed575386d7 to your computer and use it in GitHub Desktop.
Give extra points on knife kill (Pointshop 2). Create the file below in garrysmod/lua/autorun
local ptsMap = {
["csgo_bayonet"] = 10,
others = 5
}
hook.Add( "PlayerDeath", "ExtraPointsForKnifeKill", function( victim, inflictor, attacker )
if not IsValid( inflictor ) or not IsValid( attacker ) or not attacker:IsPlayer( ) then
return
end
if inflictor.Category and inflictor.Category == "CS:GO Knives" then
local pts = ptsMap[inflictor:GetClass()] or ptsMap["others"]
attacker:PS2_AddStandardPoints( pts, "Knife Kill", true )
end
end )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment