And i don't get the hook part for some reason..
I watched at DC's samples as well, but i think i owe this misunderstanding to my bad english..
and i really want to teach myself..
Well, in this case , i guess i am a newbie, not a noob... SQ Moderator Offline
In cs2d hook means when to apply function.
Example:
addhook("Period when to apply function","function name")
Periods like :
Join - every player join
minute - each minute
spawn - every time player spawn edited 1×, last 03.07.09 05:11:24 pm
you need to add hooks, which are called when something in game happens and then call their function.
addhook(1, 2)
function 2(param1, param2,....)
1 is a special text, you need to either know it, or watch into the info.txt in your /sys/lua folder.
it's always something like say, kill, die, spawn, ....
2 is a name you can give this hook. When the hook is called, it will call the function which has the same name.
(in this case function 2) how to create lua where if player id 1 be killed=server restart 1
2
3
4
5
6
addhook("kill", "restartonkill")
function restartonkill(killer, victim)
if (victim == 1) then
	parse("sv_restart 0")
end
end
round restart if enemy killz me but if i going in team gate he dont restart Then try that:
1
2
3
4
5
6
addhook("die", "restartonkill")
function restartonkill(victim,killer,weapon,x,y)
	if (victim == 1) then
		parse("sv_restart 0")
	end
end
Should work for team gate ,too... edited 1×, last 03.07.09 07:39:10 pm
1
2
3
4
5
6
addhook("die", "restartondie")
function restartondie(victim)
if (victim == 1) then
	parse("sv_restart 0")
end
end
@ heavy: you mixed the parameters! what
i didn't
edit://
u are right.. fixed oh, Blazing, i thank you, you really got it well described how to create reloading after 2 shots? Admin/mod comment
Don't spam around with your question! Everybody here has read it at least a thousand times already. /TheKilledDeath