Page 1 of 1

Hostage Noblock

Posted: Mon Apr 05, 2021 11:21 am
by cssbestrpg
Hello, this plugin allows walk through hostages.

Syntax: Select all

from events import Event
from filters.entities import EntityIter
from entities.constants import CollisionGroup

@Event('round_start')
def round_start(args):
for i in EntityIter.iterator():
if i.classname.startswith('hostage_entity'):
i.collision_group = CollisionGroup.DEBRIS_TRIGGER

Re: Hostage Noblock

Posted: Mon Apr 05, 2021 11:33 am
by Kami
You can simplify this a little by using an is_filter for EntityIter like this:

Syntax: Select all

from events import Event
from filters.entities import EntityIter
from entities.constants import CollisionGroup

@Event('round_start')
def round_start(args):
for i in EntityIter('hostage_entity'):
i.collision_group = CollisionGroup.DEBRIS_TRIGGER

Re: Hostage Noblock

Posted: Mon Apr 05, 2021 11:38 am
by cssbestrpg
Thanks for the tip. I am beginner of using EntityIter.