1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
local weaponTypes = {
	[1] = { kill = 400, assist = 300 }, -- Bonus for assists, will reward them too.
	[2] = { assist = 30 }, -- No kill will default to $300 (default)!
	[45] = { kill = 100 } -- No assist will default to no reward!
}
function kill_hook(killer, victim, weapon, x, y, obj, assistant)
	local weaponType = weaponTypes[weapon]
	
	if not weaponType or type(weaponType) ~= 'table' then
		-- No need for extra calculations.
		
		return
	end
	
	local player = _G.player -- Can be removed, will probably make no difference.
	
	if not player(killer, 'exists') then
		-- I don't trust CS2D, enough said.
		
		return
	end
	
	if player(killer, 'team') == player(victim, 'team') and game('sv_gamemode') ~= '1' then
		-- Checking if team kill, can be removed if not needed.
		
		return
	end
	
	
	-- Kill calculations:
	local amountKill = weaponType.kill
	
	if amountKill then
		parse('setmoney ' .. killer .. ' ' .. player(killer, 'money') + amountKill - 300) -- Removing $300 because it's automated by CS2D.
	end
	
	-- Assist calculations:
	local amountAssist = weaponType.assist
	
	if amountAssist and player(assistant, 'exists') then
		parse('setmoney ' .. assistant .. ' ' .. player(assistant, 'money') + amountAssist)
	end
end
addhook('kill', 'kill_hook')