CS2D
Scripts Addhooks Addhooks
3 replies There is some addhook i need an explaination for!
addhook('ms100','Xfunction',100)
addhook("say","say",100) or addhook("say","say",-10) or addhook("say","say",-1) It's the priority of the hook. Higher priority means it's the last function be called, while lower priority means it's the first function be called. If I'm wrong then you can check addhook page. DC Admin Offline
That's right. The priority is mainly required when you want to work with the return values of hooks but have multiple functions attached to the same hook. The thing is that CS2D can only use one of the return values because it needs to know what to do and if one function returns 1 and the other one 0 it wouldn't know which value to take. Therefore it just takes the one of the function with the highest priority.
You won't need to care about the priority in most cases and you can also just omit it. Thanks for the explaination you both!