Forum

> > CS2D > Scripts > startround hook
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch startround hook

4 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt startround hook

DarkLight66
User Off Offline

Zitieren
hi all, i have a problem with the startround hook, if i use it, i´ll need to use "restart" every time i start a server for the hook to work, tought it works well after that. So i want to know, is this a bug or intended?

alt Re: startround hook

DC
Admin Off Offline

Zitieren
startround is only triggered when a new round starts (as the name implies). this is not necessarily when you start the server. a round only starts if there are players. also in some game modes there are no rounds at all (which means that startround will not be triggered).

I'm not sure what your problem is, but you can put Lua code that you want to execute right after starting the server directly in your Lua script. you don't have to use a hook in that case.

alt Re: startround hook

DarkLight66
User Off Offline

Zitieren
my problem was that i wanted to create an image just when the round starts, but thanks for the info, now i know how to solve it

alt Re: startround hook

Apache uwu
User Off Offline

Zitieren
So potentially your lua script would call it once it has been loaded.

1
2
3
4
5
6
7
8
9
10
11
addhook("startround","_sr")

function _sr()
	callImages()
end

function callImages()
	image("---bleh")
end

callImages()
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht