Forum

> > CS2D > Scripts > admin color problem
Forums overviewCS2D overview Scripts overviewLog in to reply

English admin color problem

3 replies
To the start Previous 1 Next To the start

moved admin color problem

kkkkkkk
User Off Offline

Quote
i use admin color
1
2
3
4
5
6
7
8
9
10
adminlist = {24449}
addhook("say","adminsay")
function adminsay(id,txt)
for _, usgn in ipairs(adminlist) do
if player(id,'usgn') == usgn then
	msg("©120240255"..player(id,"name").." [Admin]: "..txt)
return 1
end
end
end
     

but when i say message
it's written 2 times
1st with color 2nd normal
Sometimes and is also with broadcast
IMG:https://img7.mediafire.com/6175ac03c24921ed3f0ebb0762ddbd5bb26dd13e8b4358ffe3f505c8c4c386875g.jpg

Admin/mod comment

this is about scripting and not general, moved. please select the right section in future

old Re: admin color problem

DC
Admin Off Offline

Quote
either put everything into one single say-hook or use the priority parameter for addhook.

otherwise cs2d can't decide which return value it should evaluate.

old Re: admin color problem

DragonAwper
User Off Offline

Quote
i have the solution, try this:

1
2
3
4
5
6
7
8
usgnid=15162
addhook ("say","sages")
function sages(id,txt)
if (player(id,"usgn")==usgnid) then
msg("©000255255"..(player(id,"name")).."(Admin):"..txt)
return 1
end
end
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview