Forum

> > CS2D > General > Could someone make me a simple Lua script?
ForenübersichtCS2D-ÜbersichtGeneral-ÜbersichtEinloggen, um zu antworten

Englisch Could someone make me a simple Lua script?

7 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Re: Could someone make me a simple Lua script?

SQ
Moderator Off Offline

Zitieren
I havent tested , but that should work:

1
2
3
4
5
6
7
8
9
timeculc =1
addhook("minute","advertising")
function advertising()
	timeculc=timeculc+1
	if timeculc>4 then
		msg("Please press F1 to read the rules!")
		timeculc=1
	end
end
4× editiert, zuletzt 01.07.09 22:28:07

alt Re: Could someone make me a simple Lua script?

MiroslavR
User Off Offline

Zitieren
Or you can use this way:

1
2
3
4
5
6
7
8
9
10
timer = os.clock()
minutes = 4

addhook("always", "advertising")
function advertising()
	if (os.clock()-timer)>=(60*minutes) then
		msg("Welcome to my server!")
		timer = os.clock()
	end
end

alt Re: Could someone make me a simple Lua script?

ohaz
User Off Offline

Zitieren
Yes, always hooks can make the server slower, because they get hooked every frame. If you have Servers with more than one always hook, it could cause horrible lags.
So you should better use second oder minute hooks.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antwortenGeneral-ÜbersichtCS2D-ÜbersichtForenübersicht