Forum

> > CS2D > Scripts > Image in center of screen
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Image in center of screen

8 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Image in center of screen

Jedediastwo
User Off Offline

Zitieren
If a terrorist dies, appears images gfx / testing / image1.bmp in center of the screen // play sound sfx/sound1.wav

If a counter-terrorist die, appears images gfx / testing / image2.bmp in center of the screen // play sound sfx/sound2.wav

The image disappears in 3 seconds


Can someone do that?
1× editiert, zuletzt 02.02.16 03:33:34

alt Re: Image in center of screen

Cure Pikachu
User Off Offline

Zitieren
1
2
3
4
5
6
addhook("die","_die")
function _die(victim)
	local i = image("gfx/testing/image"..math.min(player(victim,"team"),2)..".bmp",320,240,2)
	timer(3000,"freeimage",i)
	parse("sv_sound sound"..math.min(player(victim,"team"),2)..".wav")
end
Something like this?

alt Re: Image in center of screen

omg
User Off Offline

Zitieren
oh
replace
1
parse("sv_sound sound"..math.min(player(victim,"team"),2)..".wav")
with
1
parse("sv_sound sfx/sound"..math.min(player(victim,"team"),2)..".wav")
√

alt Re: Image in center of screen

THEMUD
User Off Offline

Zitieren
@user Jedediastwo: Are you sure that you have both of the image and the sfx in the right place?
If not, then you can modify the code or change the path of them so the game will recognize them.

alt Re: Image in center of screen

GeoB99
Moderator Off Offline

Zitieren
Well, you can do straight with this code.
1
2
3
4
5
6
7
8
9
10
11
12
13
function die_(victim)
	if player(victim, "team") == 1 then
		local i = image("gfx/testing/image.bmp", 320 , 240, 2)
		timer(3000,"freeimage", i)
		parse("sv_sound \"sound/test.wav\"")
	elseif player(victim, "team") == 2 then
		local i2 = image("gfx/testing/image2.bmp", 320 , 240, 2)
		timer(3000,"freeimage", i2)
		parse("sv_sound \"sound/test2.wav\"")
	end
end

addhook("die","die_")
Just change both the image path and sound path as well.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht