Forum

> > CS2D > Scripts > How to disable hook for 1round in 60 min
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch How to disable hook for 1round in 60 min

2 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt How to disable hook for 1round in 60 min

maninja
User Off Offline

Zitieren
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

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

Cebra
User Off Offline

Zitieren
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
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht