Syntax: Select all
from entities.entity import BaseEntity
from events import Event
from mathlib_c import Vector
from tick.delays import TickDelays
from tools_c import ServerTools
from stringtables_c import StringTables
@Event
def hegrenade_detonate(game_event):
# Create a particle system entity...
particle = BaseEntity(ServerTools.create_entity('info_particle_system'))
# Set its effect to an huge explosion...
particle.effect_name = 'bomb_explosion_huge'
# Set the origin of the particle...
particle.edict.set_key_value_vector('origin', Vector(*map(game_event.get_float, 'xyz')))
# Precache the particle and set its index...
particle.edict.set_prop_int('m_iEffectIndex',
StringTables.ParticleEffectNames.add_string('bomb_explosion_huge'))
# Start the particle effect...
particle.Start()
# Delete it later...
TickDelays.delay(3, particle.Kill)
This code will create a huge explosion where an hegrenade is detonating:
Here is a dump of available particles for Counter-Strike: Source:
Code: Select all
Dumping particle list:
0: mini_firework_flare
1: achieved
2: mini_fireworks
3: blood_impact_red_01_goop
4: blood_impact_red_01_droplets
5: blood_impact_yellow_01
6: blood_impact_red_01_smalldroplets
7: blood_impact_green_01
8: blood_impact_green_01_droplets
9: blood_impact_green_01_chunk
10: blood_impact_red_01
11: blood_impact_red_01_mist
12: blood_impact_red_01_chunk
13: blood_impact_synth_01
14: blood_impact_synth_01_droplets
15: blood_impact_synth_01_armor
16: blood_impact_synth_01_dust
17: blood_impact_synth_01_spurt
18: blood_impact_synth_01_short
19: vomit_barnacle
20: vomit_barnacle_b
21: blood_spurt_synth_01
22: blood_spurt_synth_01b
23: blood_drip_synth_01
24: blood_zombie_split
25: blood_zombie_split_spray
26: blood_zombie_split_spray_tiny
27: blood_zombie_split_spray_tiny2
28: blood_drip_synth_01b
29: blood_drip_synth_01c
30: blood_impact_synth_01_arc_parents
31: blood_impact_synth_01_arc
32: blood_impact_synth_01_arc2
33: blood_impact_synth_01_arc3
34: blood_impact_synth_01_arc4
35: blood_impact_synth_01_arc_parent
36: blood_impact_antlion_01
37: blood_impact_zombie_01
38: blood_antlionguard_injured_light
39: blood_antlionguard_injured_light_tiny
40: blood_antlionguard_injured_heavy_
41: blood_antlionguard_injured_heavy_tiny
42: blood_advisor_shrapnel_impact
43: blood_advisor_shrapnel_spray_1
44: blood_advisor_shrapnel_spray_2
45: blood_advisor_shrapnel_spurt_1
46: blood_advisor_shrapnel_spurt_2
47: blood_advisor_puncture_withdraw
48: blood_advisor_pierce_spray
49: blood_advisor_pierce_spray_b
50: blood_advisor_pierce_spray_c
51: blood_advisor_puncture
52: blood_impact_antlion_worker_01
53: blood_impact_green_02_chunk
54: blood_impact_green_02_droplets
55: blood_impact_green_02_glow
56: blood_antlionguard_injured_heavy
57: smoke_medium_01
58: fire_medium_01
59: embers_medium_01
60: fire_medium_01_glow
61: fire_medium_02
62: Smoke_medium_02b
63: smoke_medium_02
64: fire_small_01
65: smoke_small_01
66: smoke_small_01b
67: fire_small_base
68: embers_small_01
69: embers_medium_03
70: fire_small_02
71: fire_small_flameouts
72: fire_small_03
73: fire_large_01
74: embers_large_01
75: smoke_large_01b
76: smoke_large_01
77: fire_medium_heatwave
78: fire_medium_03
79: fire_medium_base
80: fire_medium_burst
81: Smoke_medium_02b Version #2
82: smoke_medium_02 Version #2
83: fire_large_02
84: fire_large_base
85: fire_large_02_fillerb
86: fire_large_02_filler
87: smoke_large_02b
88: embers_large_02
89: smoke_large_02
90: burning_gib_01_follower1
91: burning_gib_01
92: smoke_gib_01
93: burning_gib_01b
94: burning_gib_01_follower2
95: burning_wood_01
96: burning_wood_01c
97: burning_wood_01b
98: smoke_medium_02c
99: smoke_medium_02d
100: fire_medium_03_brownsmoke
101: fire_jet_01_flame
102: fire_jet_01
103: burning_gib_01_drag
104: fire_verysmall_01
105: burning_engine_01
106: smoke_burning_engine_01
107: burning_engine_fire
108: fire_medium_02_nosmoke
109: explosion_huge
110: explosion_huge_d
111: explosion_huge_e
112: explosion_huge_b
113: explosion_huge_burning_chunks
114: explosion_huge_smoking_chunks
115: explosion_huge_c
116: explosion_huge_k
117: explosion_huge_g
118: explosion_huge_j
119: explosion_huge_h
120: explosion_huge_i
121: burning_vehicle
122: smoke_exhaust_01a
123: explosion_silo
124: explosion_huge_flames
125: explosion_huge_flames_b
126: smoke_exhaust_01
127: smoke_exhaust_01b
128: explosion_huge_f
129: env_fire_small
130: env_fire_small_b
131: env_embers_small
132: env_fire_random_puff
133: env_fire_medium_b
134: env_fire_medium
135: env_embers_medium
136: env_fire_large
137: env_fire_large_b
138: env_embers_large
139: env_fire_small_smoke
140: env_fire_medium_smoke
141: env_fire_large_smoke
142: env_fire_large_smoke_b
143: env_fire_medium_spread
144: env_fire_medium_spread_b
145: env_embers_medium_spread
146: env_embers_small_spread
147: env_fire_small_coverage
148: env_fire_small_coverage_c
149: env_fire_small_coverage_b
150: env_fire_small_coverage_smoke
151: env_fire_small_coverage_base
152: env_fire_small_coverage_base_smoke
153: env_fire_small_base
154: env_fire_tiny
155: env_embers_tiny
156: env_fire_tiny_b
157: env_fire_tiny_smoke
158: bomb_explosion_huge
159: burning_character_c
160: burning_character_d
161: burning_character_e
162: burning_character_b
163: burning_character
164: water_splash_01
165: water_splash_01_surface4
166: water_splash_01_surface3
167: water_splash_01_droplets
168: water_splash_01_refract
169: water_splash_01_surface1
170: water_splash_01_surface2
171: water_trail_medium
172: water_trail_medium_b
173: water_splash_02_vertical
174: water_splash_02_droplets
175: water_splash_02_refract
176: water_splash_02_continuous
177: water_splash_02_froth
178: water_splash_02_froth2
179: water_splash_02_surface2
180: water_splash_02_surface4
181: water_splash_02_animated
182: water_splash_02_droplets Version #2
183: water_impact_bubbles_1
184: water_impact_bubbles_1d
185: water_impact_bubbles_1b
186: water_impact_bubbles_1c
187: water_bubble_trail_1
188: water_bubble_ambient_1
189: water_gunk_1
190: water_splash_leakypipe_silo
191: water_splash_leakypipe_silo_froth2
192: water_splash_leakypipe_vertical
193: slime_splash_01
194: slime_splash_01_reversed
195: slime_splash_01_droplets
196: slime_splash_01_surface
197: slime_splash_02
198: slime_splash_03
199: water_splash_02
200: water_splash_03
201: water_foam_01
202: water_foam_01d
203: water_foam_01b
204: water_foam_01c
205: water_foam_line_long
206: water_foam_line_longd
207: water_foam_line_longb
208: water_foam_line_longc
209: water_foam_line_short
210: water_foam_line_shortd
211: water_foam_line_shortb
212: water_foam_line_shortc
213: muzzle_pistols
214: muzzle_smgs
215: muzzle_machinegun
216: muzzle_rifles
217: muzzle_shotguns
218: muzzle_autorifles
219: error