Forum

> > CS2D > Scripts > Server message
Forums overviewCS2D overview Scripts overviewLog in to reply

English Server message

3 replies
To the start Previous 1 Next To the start

old Server message

kewixasd
User Off Offline

Quote
Hi

how can i make a server message
which to give you tips
while playing

Thank you in advance for your help

old Re: Server message

Bowlinghead
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
msgs = {
"R for Reload",
"B for Buymenu",
"Leftclick to shoot",
-- add/change more with same pattern
}

local counter = 0

addhook("minute","minhook")
function minhook()
	msg(msgs[counter])
	counter = counter + 1
end

Every minute the server will display a predefined message to everyone

old Re: Server message

Cure Pikachu
User Off Offline

Quote
@user Bowlinghead: I can like, see 2 problems with yours. First, it will try to cs2d lua cmd msg
msgs[0]
which doesn't exist. Second, since the counter keeps going up, eventually there will be nothing to show because those entries don't exist either.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
msgs = {
	"R for Reload",
	"B for Buy menu",
	"Left click to shoot",
	-- add/change more with same pattern
}

counter = 0

addhook("minute","minhook")
function minhook()
	counter = counter + 1
	if counter > #msgs then
		counter = 1
	end
	msg(msgs[counter])
end
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview