Forum

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

Englisch Roundstart hook

10 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Roundstart hook

Alistaire
User Off Offline

Zitieren
Now when I use this script;

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Collectables_image1={}
Col1_Collected=0
parse('hudtxt 1 "0" 40 412')

addhook("break","Collectables_break_hook")
function Collectables_break_hook(x,y)
	if(entity(x,y,"name")=="Col1") then
		Col1_Collected = Col1_Collected + 1
		parse('hudtxt 1 "'..Col1_Collected..'" 40 412')
	end
end

Collectables_image1=image("gfx/CSP_Reborn/Crts-Col.png",17,420,2)
imageblend(Collectables_image1,1)
imagecolor(Collectables_image1,115,115,25)

The "Col1_Collected" value stays the same as before roundrestart. Is there a way to change it?

Like;

1
2
3
4
5
addhook("startround","ColReset")
function ColReset()
	Col1_Collected=0
	parse('hudtxt 1 "0" 40 412')
end

?

alt Re: Roundstart hook

DC
Admin Off Offline

Zitieren
I guess that you just answered your question yourself. why aren't you trying your own solution before asking?

alt Re: Roundstart hook

Kel9290
User Off Offline

Zitieren
umm..
Zitat
startround(mode)                         on start of round
-mode: start/end mode id


endround(mode)                              on end of round
-mode: start/end mode id

alt Re: Roundstart hook

VADemon
User Off Offline

Zitieren
Who doesn't understand german:
on every round end/start mode returns a value about who won and how. There're too much ways to win that's why the information about different values of mode would be a big help for some devs.

alt Re: Roundstart hook

EP
User Off Offline

Zitieren
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
function hudtext2(id,tid,color,txt,x,y)
     local toprint = ("©"..color.." "..txt)
     parse('hudtxt2 '..id..' '..tid..' "'..toprint..'" '..x.." "..y)
end

Collectables_image1={}
Col1_Collected={}
parse('hudtxt 1 "0" 40 412')

function UpdateCol1Hud(id)
hudtext2(id,1,"255255255",Col1_Collected,40,412)
end

addhook("break","Collectables_break_hook")
function Collectables_break_hook(x,y)
     if(entity(x,y,"name")=="Col1") then
          Col1_Collected[id] = Col1_Collected[id] + 1
          UpdateCol1Hud(id)
     end
end

Collectables_image1=image("gfx/CSP_Reborn/Crts-Col.png",17,420,2)
imageblend(Collectables_image1,1)
imagecolor(Collectables_image1,115,115,25)

addhook("join","ColJoin")
function ColJoin(id)
	Col1_Collected[id]=0
	UpdateCol1Hud(id)
end

addhook("startround","ColReset")
function ColReset()
     Col1_Collected[id]=0
     UpdateCol1Hud(id)
end
Try it
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht