English Screen after killing

10 replies
Goto Page
To the start Previous 1 Next To the start
15.06.18 10:20:35 pm
Up
tos12345678
User
Offline Off
I need some help.
Script which will reveal blue screen (e.g. block.bmp - blue) for a moment on the player screen when he killed someone player.
after this, blue screen should then slowly disappear untill moment in which block.bmp full vanish/die.
15.06.18 11:51:34 pm
Up
SkullFace
User
Offline Off
To understand a bit better :

When someone kills a player,
that someone gets the blue (fullscreen?) screen.
When he gets that screen, it will slowly fade away like a flashbang ?
IMG:https://i.imgur.com/kZBVkjM.gif
P.S. - I've been extracting recently enviromental sound files from other games, if anyone is interested in them for adding them to their maps, scripts, PM me
16.06.18 12:26:48 am
Up
Rainoth
Moderator
Offline Off
1. use cs2d lua cmd image with mode as HUD image
2. set alpha to 0
3. use cs2d lua hook kill hook and in the function attached to it:
3.1 set alpha to 1
3.2 use cs2d lua cmd tween_alpha to bring it back to 0

I did not use tween_alpha enough to know so I'll just make an assumption that you might run into problems when you kill during the timeframe of tween_alpha and run a new tween_alpha (Say your image disappears in 3 seconds and you kill someone during that time. You'd probably want to have the image at full alpha and then reduce it again from the beginning but the old call to tween_alpha might still be running or not). If this assumption is wrong, the solution above should work, otherwise, you'll need to have a variable for alpha and then use cs2d lua cmd imagealpha with a time hook to reduce alpha "manually".

Good luck.
16.06.18 09:10:11 am
Up
Gaios
Security Supporter
Offline Off
You can use flash command.
IMG:https://i.imgur.com/itOslkM.gif
This community is a meme.
16.06.18 10:25:23 am
Up
Masea
Super User
Offline Off
This would do:
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
parse("mp_hudscale 1")

timeToFade = 1000 --1000 = 1 second.
screenColour = {0, 0, 0}

--To make sure the given ID be a number since timers do give output as string far as I remember
_freeimage = freeimage
function freeimage(id)
    tonumber(id)

    _freeimage(id)
end

addhook("kill", "_kill")
function _kill(killer)
    local blueScreen = image("gfx/block.bmp", 425, 240, 2, id)
    imagecolor(blueScreen, unpack(screenColour))
    imagescale(blueScreen, 27, 15)
    tween_alpha(blueScreen, timeToFade, 0)
    timer(timeToFade, "freeimage", blueScreen)
end
You can either change
timeToFade
or
screenColour
variables for your own taste.
Create and design your GUI easy and fast: file cs2d GUI Framework (12) | Go deep of the darkness and try your intrepidity: file cs2d Outlast 2 Modification (25)
16.06.18 11:18:14 am
Up
Bowlinghead
User
Offline Off
You forgot to declare "id" in kill hook.
A little change in line 15 should do:
Code:
1
function _kill(killer,id)


And did you just overwrite a Cs2D function? You are a bad boy!
Share time limited free games here
16.06.18 02:44:09 pm
Up
tos12345678
User
Offline Off
All right √ , but i mean to blue screen reveal only for player which kill other player.
16.06.18 03:09:18 pm
Up
Bowlinghead
User
Offline Off
Then just do this params: "id" without killer
Code:
1
function _kill(id)
Share time limited free games here
16.06.18 04:03:31 pm
Up
tos12345678
User
Offline Off
okey √
16.06.18 04:41:43 pm
Up
BcY
User
Offline Off
Trying to do something like "Wasted" screen?
IMG:http://banners.gametracker.rs/80.211.180.243:27015/small/red/banner.jpg
16.06.18 07:51:23 pm
Up
Masea
Super User
Offline Off
user Bowlinghead has written:
You forgot to declare "id" in kill hook.
Wow! It was actually supposed to be killer parameter, thanks.
Create and design your GUI easy and fast: file cs2d GUI Framework (12) | Go deep of the darkness and try your intrepidity: file cs2d Outlast 2 Modification (25)
To the start Previous 1 Next To the start