Forum

> > CS2D > Scripts > How to disable hook for 1round in 60 min
Forums overviewCS2D overview Scripts overviewLog in to reply

English How to disable hook for 1round in 60 min

2 replies
To the start Previous 1 Next To the start

old How to disable hook for 1round in 60 min

maninja
User Off Offline

Quote
Hey, when I mix my both script the hooks hit not working as well (becuase i use 2 hooks for hit (on original script also in ghost script!), so I wanted to disable the original script when the ghost script enable

That why I come to here to ask if someone able to help me and thanks btw

old Re: How to disable hook for 1round in 60 min

Cebra
User Off Offline

Quote
with cs2d lua cmd freehook you could remove a "hooked" function

but i would suggest something like:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
addhook("<your hook>","switchfunc")

function original_one(params)
	//do something
end

function original_two(params)
	//do something else
end

function switchfunc(params)
	if condition then
		original_one(params)
	else
		original_two(params)
	end
end

edit: user Mami Tomoe was faster
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview