Half-Life Icon HL Script

WeaponBox FadeOut

Hey, you! We are one of the oldest mod sites on the Interwebs. Sign up and maximize your browsing experience.

  • Subscribe: Get notified of new submissions like this.
  • Say Thanks: Show your appreciation by sending Rj. points.
  • Post: Give Rj. your thoughts on this Script.
  • Vote: Help Rj. win the Monthly Awards.
  • Rate: Give this Script a rating out of 10.
  • Flag: Alert moderators and warn members of a problem with this Script.
  • Watch: Get notified when this Script is updated.
Mascot

Sound fun?

Join GameBanana

Already a Bananite? Login

91 lines | 2 kb | Raw Code
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
/*
*       WeaponBox FadeOut Effect
*                      
*                                             by serfreeman1337
*                                               http://1337.uz/
*/


#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

new lifetime,rgb

public plugin_init() {
        register_plugin("WeaponBox FadeOut Effect","0.2","serfreeman1337")
       
        lifetime = register_cvar("wpnbox_fadeout_lifetime","30.0")
        rgb = register_cvar("wpnbox_fadeout_rgb","255 255 000")
       
        RegisterHam(Ham_Touch,"weaponbox","fw_WeaponBoxTouch",true)
        RegisterHam(Ham_Think,"weaponbox","fw_WeaponBoxThink")
       
}

public fw_WeaponBoxTouch(ent)
{
        if(!pev_valid(ent) || pev(ent,pev_iuser2) != 0)
        {
                return HAM_IGNORED
        }
       
        set_pev(ent,pev_nextthink,get_gametime()+get_pcvar_float(lifetime))
        set_pev(ent,pev_iuser2,1)
       
        return HAM_IGNORED
}
public fw_WeaponBoxThink(ent){
        if(!pev_valid(ent))
                return HAM_IGNORED
               
        switch(pev(ent,pev_iuser2))
        {
                case 1:
                {
                        new Float:clor[3],sdata[3][5]
                        new string[64]
       
                        get_pcvar_string(rgb,string,charsmax(string))
                        parse(string,sdata[0],charsmax(sdata[]),sdata[1],charsmax(sdata[]),sdata[2],charsmax(sdata[]))
                       
                        clor[0] = str_to_float(sdata[0])
                        clor[1] = str_to_float(sdata[1])
                        clor[2] = str_to_float(sdata[2])
                               
                        set_pev(ent,pev_movetype,MOVETYPE_FLY)
                        set_pev(ent,pev_solid,SOLID_NOT)
                        set_pev(ent,pev_rendermode,kRenderTransAlpha)
                        set_pev(ent,pev_renderfx,kRenderFxGlowShell)
                        set_pev(ent,pev_renderamt,255.0)
                        set_pev(ent,pev_rendercolor,clor)
                        set_pev(ent,pev_velocity,Float:{0.0,0.0,20.0})
                       
                        set_pev(ent,pev_iuser2,2)
                        set_pev(ent,pev_nextthink,get_gametime() + 0.1)
                }
                case 2:
                {
                        new Float:amt
                        pev(ent,pev_renderamt,amt)
                       
                        amt -= 25.0
                       
                        if(amt > 0.0)
                        {
                                set_pev(ent,pev_renderamt,amt) 
                        }
                        else
                        {
                                set_pev(ent,pev_iuser2,3)
                        }
                       
                        set_pev(ent,pev_nextthink,get_gametime() + 0.1)
                }
                case 3:
                {
                        return HAM_IGNORED
                }
        }
       
        return HAM_SUPERCEDE
}



WeaponBox FadeOut Effects
Version: 0.2

Description:
The beautiful effect for weaponbox disappearance. Now they are slowly taking off and dissolved in the air. So as you can configure the time of disappearance and the glow of weaponbox.
Cvars:
  • wpnbox_fadeout_lifetime - 30.0 - weaponbox life time
  • wpnbox_fadeout_rgb - 255 255 000 - weaponbox glow color [RGB]

Posts

None found

Share

Shareable Image:
Share banner
HTML embed code:
BB embed code:
Markdown embed code:

More embeddable images

Bookmark and Share

Credits

Key Authors
GordonFreeman (RU)
Creator

Submitter

Rj. avatar
Rj. avatar Dreamin'
Member Joined 10mo
923 points Ranked 5654th
35 medals 4 legendary 9 rare
  • Submitted 15 Tools Medal icon
  • Submitted 50 Gamefiles Medal icon
  • 15+ Entries! GameBanana’s Christmas Giveaway 2016 Medal icon
  • Thanked 500 submitters Medal icon
  • 2nd Place - Game Poetry Contest Medal icon
  • Submitted 5 Tools Medal icon

Rj. avatar
Rj.

Redistributor
Are you the owner? Request Ownership
Send a Private Message to the submitter

Category

Attributes

Language
Pawn (AMXX)

Stats

Posts
0
Views
137
Date Added
23d