Forum

> > CS2D > Scripts > old text still displayed
Forums overviewCS2D overview Scripts overviewLog in to reply

English old text still displayed

5 replies
To the start Previous 1 Next To the start

old old text still displayed

EnderCrypt
User Off Offline

Quote
why is the orginal text still being displayed?

code 1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
i = 0
text_type = 0 --normal
while (i <= #admin) do
i = i + 1
if (player(id, "usgn") == admin[i]) then
text_type = 1 --administrator
end
end
if (player(id, "usgn") == 5783) then
text_type = 2 -- high admin
end
if text_type == 0 then
msg("©255255255 ["..id.."]{"..player(id,"usgn").."}"..player(id,"name")..": "..text.."")
end
if text_type == 1 then
msg("©000000255 ["..id.."]{"..player(id,"usgn").."}"..player(id,"name")..": "..text.."")
end
if text_type == 2 then
msg("©255000000 ["..id.."]{"..player(id,"usgn").."}"..player(id,"name")..": "..text.."")
end
return 1

code 2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
i = 0
text_type = 0 --normal
while (i <= #admin) do
i = i + 1
if (player(id, "usgn") == admin[i]) then
text_type = 1 --administrator
end
end
if (player(id, "usgn") == 5783) then
text_type = 2 -- high admin
end
if text_type == 0 then
msg("©255255255 ["..id.."]{"..player(id,"usgn").."}"..player(id,"name")..": "..text.."")
return 1
end
if text_type == 1 then
msg("©000000255 ["..id.."]{"..player(id,"usgn").."}"..player(id,"name")..": "..text.."")
return 1
end
if text_type == 2 then
msg("©255000000 ["..id.."]{"..player(id,"usgn").."}"..player(id,"name")..": "..text.."")
return 1
end

noone of these works
the msg are displayed correctly, however reall text is still displayed, no error
i dont se problem

also, this is only a part of the code

old Re: old text still displayed

archmage
User Off Offline

Quote
I have noticed the same problem. It occurs when multiple say hooks exist. To fix it just set the priority of you say hook to 100 or something else above 0.

1
addhook("hook", "function" [,priority])

Info.txt has written
Priority is only important if there is more than one function attachted to the same hook!
Default is 0, higher numbers = higher priority, lower numbers (also negative) = lower priority.
The attached function with the HIGHEST priority is the LAST function which will be executed.
Moreover CS2D will take the return value of this function (if there is any)!
In most cases you will just omit the priority parameter (yes, it is [optional])!

old Re: old text still displayed

DannyDeth
User Off Offline

Quote
Usually what I would recommend doing is to make sure that you are running only that script, and then making sure that you have your priorities lined up nicely, like Dark Byte said.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview