English How to disable hook for 1round in 60 min

2 replies
Goto Page
To the start Previous 1 Next To the start
Up
maninja
User
Offline Off
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
08.02.21 09:32:52 am
Up
Mami Tomoe
User
Offline Off
Either use cs2d lua cmd freehook or a boolean variable that overlaps the original hit hook.

Though it would be smarter to just combine them but whatever.
08.02.21 09:38:24 am
Up
Cebra
User
Offline Off
with cs2d lua cmd freehook you could remove a "hooked" function

but i would suggest something like:

Code:
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
loading...
To the start Previous 1 Next To the start