Forum

> > CS2D > Scripts > Addhooks
Forums overviewCS2D overview Scripts overviewLog in to reply

English Addhooks

3 replies
To the start Previous 1 Next To the start

old Addhooks

Promaster
User Off Offline

Quote
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)

old Re: Addhooks

Dousea
User Off Offline

Quote
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 cs2d lua cmd addhook page.

old Re: Addhooks

DC
Admin Off Offline

Quote
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.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview