I tried to use the sethookstate, but I couldn't get it work.
Here is my script:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
items={1,2,3,4,5,6,10,11,20,21,22,23,24,30,31,32,33,34,35,36,37,38,39,91,40,45,46,47,48,49,88,90,69,74,78,85,51,52,53,72,73,75,76,86,89,77,87,41,57,58,61,62,64,65,79,80}	-- 56 addhook("kill","rg_kill") function rg_kill(killer,victim) 	if player(killer,"team")~=player(victim,"team") then 		parse("equip "..killer.." "..items[math.random(1,56)].."") 		parse("equip "..killer.." "..items[math.random(1,56)].."") 		parse("setmoney "..victim.." 1000") 	end end addhook("say","cmds") function cmds(id,txt) 	if txt:sub(1,7)=="!random" then 		if tonumber(txt:sub(8,10))==99 then 			sethookstate("rg_kill",0) 			msg("©000255255Random Rounds ON!@C") 		elseif tonumber(txt:sub(8,10))==98 then 			sethookstate("rg_kill",1) 			msg("©000255255Random Rounds OFF!@C") 		end 	end end
Hook "rg_kill":
Player gets two random items when he kills another player and when player dies his money will decrease to 1k.
By saying "!random 99" hook will be enabled and by saying "!random 98" hook will be disabled.
It doesn't work, but it won't also give any errors.
Can you guys help me with this?
Thanks
1× editiert, zuletzt 25.08.12 11:35:38