Forum

> > CS2D > Scripts > startround hook
Forums overviewCS2D overview Scripts overviewLog in to reply

English startround hook

4 replies
To the start Previous 1 Next To the start

old startround hook

DarkLight66
User Off Offline

Quote
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?

old Re: startround hook

DC
Admin Off Offline

Quote
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.

old Re: startround hook

DarkLight66
User Off Offline

Quote
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

old Re: startround hook

Apache uwu
User Off Offline

Quote
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()
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview