Half-Life Icon HL Script

Weapon Spawn Effects

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

Resistance is futile...

Join GameBanana

Already a Bananite? Login

140 lines | 3 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
#include <amxmodx>
#include <engine>
#include <hamsandwich>

new Trie:g_owners

new items[][] = {
        "ammo_357",
        "ammo_9mmAR",
        "ammo_9mmbox",
        "ammo_9mmclip",
        "ammo_ARgrenades",
        "ammo_buckshot",
        "ammo_crossbow",
        "ammo_gaussclip",
        "ammo_glockclip",
        "ammo_mp5clip",
        "ammo_mp5grenades",
        "ammo_rpgclip",
        "item_battery",
        "item_healthkit",
        "item_longjump"
}

new wps[][] = {
        "weapon_hornetgun",
        "weapon_python",
        "weapon_357",
        "weapon_crossbow",
        "weapon_snark",
        "weapon_tripmine",
        "weapon_satchel",
        "weapon_handgrenade",
        "weapon_9mmAR",
        "weapon_gauss",
        "weapon_mp5",
        "weapon_rpg",
        "weapon_egon",
        "weapon_shotgun"
}

new render_type,render_fx,render_amt,render_color

public plugin_init() {
        register_plugin("Weapon Spawn Effects","0.2.1","serfreeman1337")
       
        for(new i;i<sizeof items;++i){
                RegisterHam(Ham_Respawn,items[i],"fw_Respawn",1)
                RegisterHam(Ham_Think,items[i],"fw_Think",1)
        }
       
        for(new i;i<sizeof wps;++i){
                register_touch(wps[i],"worldspawn","fw_Respawn")
                RegisterHam(Ham_Think,wps[i],"fw_Think",1)
        }
       
        render_type = register_cvar("ws_render","1")
        render_fx = register_cvar("ws_renderfx","19")
        render_amt = register_cvar("ws_renderamt","6.0")
        render_color = register_cvar("ws_rendercolor","random")
       
        g_owners = TrieCreate()
}

public plugin_end()
{
        TrieDestroy(g_owners)
}

public fw_Respawn(ent){
        if(!is_valid_ent(ent))
                return
       
        new classname[32],Float:origin[3],Float:angles[3]
       
        entity_get_string(ent,EV_SZ_classname,classname,charsmax(classname))
        entity_get_vector(ent,EV_VEC_origin,origin)
        entity_get_vector(ent,EV_VEC_angles,angles)
       
        new ghost = create_entity(classname)
       
        if(!is_valid_ent(ghost))
                return
               
        new dnum[5],Float:rnd[3]
        num_to_str(ent,dnum,charsmax(dnum))
        TrieSetCell(g_owners,dnum,ghost)
       
        get_rendercolor(rnd)
               
        entity_set_int(ghost,EV_INT_rendermode,get_pcvar_num(render_type))
        entity_set_int(ghost,EV_INT_renderfx,get_pcvar_num(render_fx))
        entity_set_vector(ghost,EV_VEC_rendercolor,rnd)
        entity_set_float(ghost,EV_FL_renderamt,get_pcvar_float(render_amt))

        DispatchSpawn(ghost)
       
        entity_set_int(ghost,EV_INT_solid,SOLID_NOT)
        entity_set_int(ghost,EV_INT_movetype,MOVETYPE_FLY)
        entity_set_float(ghost,EV_FL_nextthink,0.0)

       
        entity_set_origin(ghost,origin)
        entity_set_vector(ghost,EV_VEC_angles,angles)
}

public fw_Think(ent){
        new dnum[5],ghost
        num_to_str(ent,dnum,charsmax(dnum))
       
        TrieGetCell(g_owners,dnum,ghost)
       
        if(ghost)
        {
                TrieDeleteKey(g_owners,dnum)
               
                if(is_valid_ent(ghost))
                {
                        remove_entity(ghost)
                }
        }
}

get_rendercolor(Float:rnd[3]){
        new temp[36]
        get_pcvar_string(render_color,temp,charsmax(temp))
       
        if(equal(temp,"random")){
                rnd[0] = random_float(10.0,255.0)
                rnd[1] = random_float(10.0,255.0)
                rnd[2] = random_float(10.0,255.0)
        }else{
                new s[3][6]
                parse(temp,s[0],charsmax(s[]),s[1],charsmax(s[]),s[2],charsmax(s[]))
               
                rnd[0] = str_to_float(s[0])
                rnd[1] = str_to_float(s[1])
                rnd[2] = str_to_float(s[2])
        }
}



Weapon Spawn Effects

Description:
Just see head image. Plugin makes glow effect on place of pickuped weapon and remove it when this weapon respawns. This effect you can see in the Half-Life Mod - Scientist Slaughterhouse.
Cvars:
ws_render <0..5> [1] - render type
ws_renderfx <0..20> [19] - render fx
ws_renderamt <0.0..255.0> [20.0] - glow amount
ws_color <0..255> <0..255> <0..255> [random] - glow color ([random]) - random *LOL*

Posts

None found

Share

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

More embeddable images

Bookmark and Share

Credits

Original Authors
GordonFreeman (RU)
Creator

Submitter

Rj. avatar
Rj. avatar Dreamin'
Member Joined 10mo
1,029 points Ranked 4854th
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 (AMXMODX)

Stats

Posts
0
Views
152
Date Added
24d