Page 1 of 1

[HL2:DM] Cough and Shake

Posted: Sun Jul 26, 2020 9:47 am
by Painkiller
Could someone please write me a script?

It's about a coughing sound with a shake when you are near smoke and dust.

Thanks in Advance

Re: [HL2:DM] Cough and Shake

Posted: Wed Aug 26, 2020 8:31 am
by Painkiller
push

Re: [HL2:DM] Cough and Shake

Posted: Fri Aug 28, 2020 4:27 am
by VinciT
When you say smoke and dust, are you referring to map based entities/effects?

Re: [HL2:DM] Cough and Shake

Posted: Sat Aug 29, 2020 10:37 am
by Painkiller
but also from my plugin the effects when a grenate explodes there is also an overlay.

I show here an SP script which causes these overlay effects.(An example )


Syntax: Select all

from entities import TakeDamageInfo
from entities.entity import Entity
from entities.hooks import EntityCondition, EntityPreHook
from memory import make_object
from players.entity import Player
from weapons.manager import weapon_manager


DAMAGE_TRIGGERS = [
'npc_grenade_frag',
'grenade_ar2',
'rpg_missile',
'npc_tripmine',
]

@EntityPreHook(EntityCondition.is_player, 'on_take_damage')
def _pre_take_damage(stack_data):
victim = make_object(Entity, stack_data[0])
if not victim.is_player():
return

info = make_object(TakeDamageInfo, stack_data[1])

try:
weapon_index = info.weapon
weapon = Entity(weapon_index).classname
except:
return
try:
if weapon in DAMAGE_TRIGGERS:
fragcloud(Player(victim.index))
except AttributeError:
pass


def fragcloud(victim):
entity = make_object(Entity, victim.give_named_item('env_ar2explosion'))
entity.set_key_value_string('material', 'test/SmokeTex_1.vmt')
entity.call_input('Explode')
entity.delay(8, entity.remove)