Forum

> > CS2D > Scripts > "return 1" dont working
Forums overviewCS2D overview Scripts overviewLog in to reply

English "return 1" dont working

4 replies
To the start Previous 1 Next To the start

old "return 1" dont working

udejo
User Off Offline

Quote
For all commands i make other hook (like command "!kill" = new hook). And this is "say" hook, i return 1 (make this message invisible). If i type "!kill" - message dont send to server, if i type "!give" - message SEND to server. I dont know how to fix it, but, if i swap places (first was "!give", second was "!kill"), then if i type "!kill" - message send to server, if i type "!give" - message dont send to server.

old Re: "return 1" dont working

Bowlinghead
User Off Offline

Quote
If you got multiple say-hooks then you have to work with priority, probably. Only the last executed hook will make use of return 1;

Quote
The attached function with the HIGHEST priority is the function which will be executed LAST. CS2D will take the return value of this last function (if there is any) only. All other return values will be ignored. This is because CS2D can only react in ONE way at a time and therefore it can only process ONE return value even though there are multiple hooked functions.
In most cases you will just omit the priority parameter (it is [optional]).


cs2d lua cmd addhook
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview