Forum

> > CS2D > Scripts > Image in center of screen
Forums overviewCS2D overview Scripts overviewLog in to reply

English Image in center of screen

8 replies
To the start Previous 1 Next To the start

old Image in center of screen

Jedediastwo
User Off Offline

Quote
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?
edited 1×, last 02.02.16 03:33:34 am

old Re: Image in center of screen

Cure Pikachu
User Off Offline

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

old Re: Image in center of screen

omg
User Off Offline

Quote
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")
√

old Re: Image in center of screen

THEMUD
User Off Offline

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

old Re: Image in center of screen

GeoB99
Moderator Off Offline

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