First of which is just a simple set of bomb effects which make it easier for players on the server to locate the bomb upon being planted. Many players have requested I put this into my server, so all enjoy. :D
Syntax: Select all
##
## IMPORTS
##
from effects import temp_entities
from engines.precache import Model
from entities.entity import Entity
from events import Event
from filters.entities import EntityIter
from filters.recipients import RecipientFilter
_smokestack = None
_tick_model = Model('sprites/laser.vmt')
##
## FUNCTIONS
##
def get_recipients():
return RecipientFilter()
##
## EVENTS
##
@Event('bomb_planted')
def bomb_planted(event):
for ent in EntityIter('planted_c4', return_types='entity'):
bomb = ent
break
entity = Entity.create('env_smokestack')
entity.origin = bomb.origin
for output in ('basespread 8', 'spreadspeed 55', 'speed 80', 'rate 60', 'startsize 1', 'endsize 5', 'twist 30', 'jetlength 95', 'angles 0 0 0', 'rendercolor 255 10 10', 'SmokeMaterial particle/fire.vmt'):
entity.add_output(output)
entity.call_input('TurnOn')
global _smokestack
_smokestack = entity
@Event('bomb_defused')
def bomb_defused(event):
_smokestack.add_output('rendercolor 10 10 255')
origin = _smokestack.origin
index = _tick_model.index
recipients = get_recipients()
for t in range(0, 5):
temp_entities.beam_ring_point(recipients, t, origin, 20, 200, index, index, 0, 255, 1, 8, 1, 1, 10, 10, 255, 255, 1, 0)