English addhook: meaning of 3rd parameter (priority)

9 replies
Goto Page
To the start Previous 1 Next To the start
Up
Good day
User
Offline Off
hi all! I don't understand what is it addhook("say","tags",200) this number 200, what is it??? Thank you

Admin/mod comment:

Title changed
28.07.14 03:49:26 pm
Up
ohaz
User
Offline Off
Priority
https://ohaz.engineer - Software Engineering
28.07.14 04:00:11 pm
Up
Good day
User
Offline Off
user ohaz has written:
Priority

???
28.07.14 04:02:35 pm
Up
TopNotch
User
Offline Off
Priority like ohaz said.
The higher the number, the higher priority that hook has.
28.07.14 04:07:13 pm
Up
ohaz
User
Offline Off
if you have the following:
Code:
1
2
addhook("say", "say1", 20)
addhook("say", "say2", 200)

then say2 will run before say1 runs
https://ohaz.engineer - Software Engineering
28.07.14 04:09:51 pm
Up
Good day
User
Offline Off
Ok, but why when i write, example addhook("say","tags", 200), lua can't change txt color:
msg(""..crtag.."[Admin] "..player(id,"name").." :"..crsay.." "..t)

Console:
LUA ERROR: attempt to call a number value
The same result if ("say","tags"). Pls help me
edited 1×, last 28.07.14 04:15:41 pm
28.07.14 04:13:15 pm
Up
Rainoth
Moderator
Offline Off
cs2d has written:
The attached function with the HIGHEST priority is the LAST function which will be executed.

So, say1 will run before say2 runs.
Just relaying TopNotch's message @user ohaz

@user Good day: Next time choose a more suitable title. Something like "Number at end of "addhook" meaning?" or something.
In case you don't understand something. Try going to cs2d.com/help
MAL • DeviantArt • For Wallpaper Engine users • Check YT for playlists... •
28.07.14 04:20:50 pm
Up
Good day
User
Offline Off
user Rainoth has written:
@user Good day: Next time choose a more suitable title. Something like "Number at end of "addhook" meaning?" or something.




So, can you help me, or no?
edited 2×, last 28.07.14 04:49:47 pm
28.07.14 04:23:14 pm
Up
Rainoth
Moderator
Offline Off
Post your code and we'll fix it up.
Basically what you've said so far was
"here, I have a fork I can show you. How do I fix my car?"
MAL • DeviantArt • For Wallpaper Engine users • Check YT for playlists... •
28.07.14 04:24:53 pm
Up
Good day
User
Offline Off
user Rainoth has written:
Post your code and we'll fix it up.
Basically what you've said so far was
"here, I have a fork I can show you. How do I fix my car?"
Can you edit my lua? Please... I'll send my script to your mail, ok?
To the start Previous 1 Next To the start