Hook.Call Args

How do I put this into practice, when I have 2 variables to give to the function behind the hook?

Lets say I have variable(s)

a & b. They both must be sent through the hook.

varargs are a variable amount of arguments, meaning that you can give as many arguments you want after that argument, like so:
[lua]hook.Call( “MyHook”, “GAMEMODE”, a, b, c, d )[/lua]
Then your hooked function will be passed a, b, c and d, like so:
[lua]hook.Add( “MyHook”, “MyHookID”, function( a, b, c, d )

print( a, b, c, d )

end )[/lua]
It’s a bit confusing to get the hang of using them in your own code, but here’s a little more information

Vararg means any number of arguments.

So,


hook.Call( _, _, var1, var2, var3 )