Forum

> > CS2D > Scripts > Server message
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Server message

3 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Server message

kewixasd
User Off Offline

Zitieren
Hi

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

Thank you in advance for your help

alt Re: Server message

Bowlinghead
User Off Offline

Zitieren
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

alt Re: Server message

Cure Pikachu
User Off Offline

Zitieren
@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
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht