Search found 129 matches

by D3CEPTION
Sat Feb 04, 2017 5:19 pm
Forum: Whatever
Topic: what is a EntityPostHook
Replies: 3
Views: 5768

Re: what is a EntityPostHook

thanks. that underlines the temporal meaning of pre/post. but where is the technical use of post hooking in tempentites.create()? and shouldnt the method here better be called .send() ? what can be done in or more specific WITH the posthook here, that cant be done in a prehook already or simply by a...
by D3CEPTION
Sat Feb 04, 2017 12:39 pm
Forum: Whatever
Topic: what is a EntityPostHook
Replies: 3
Views: 5768

what is a EntityPostHook

what exactly can be done in a EntityPostHook/TempEntityPostHook?

because shouldnt the memory be locked at that point?
by D3CEPTION
Sat Feb 04, 2017 10:35 am
Forum: Plugin Development Support
Topic: Hide player chat
Replies: 8
Views: 6365

Re: Hide player chat

ah nice you changed your profile pic on all your accounts after i suggested that they represent your criminal activities :D, i think we should wait for what exactly he wants to do anyway, i only wanted to show him the property and not drift off topic too much. you must have overread that i especiall...
by D3CEPTION
Sat Feb 04, 2017 6:07 am
Forum: Plugin Development Support
Topic: Hide player chat
Replies: 8
Views: 6365

Re: Hide player chat

there are even more things that could be said. you forgot to mention all that. but your answer isnt overall that bad. maybe he will be more specific on his next reply.
by D3CEPTION
Sat Feb 04, 2017 5:43 am
Forum: Plugin Development Support
Topic: Hide player chat
Replies: 8
Views: 6365

Re: Hide player chat

yes you can, but usermsgs are useful when you create customized block filters. in your case, if you merely try to toggle there is a m_iHideHUD property on the player. cant test it right now but should go sthn like this: from players.constants import HideHudFlags player.set_property_int("m_L...
by D3CEPTION
Wed Jan 25, 2017 2:25 am
Forum: Plugin Development Support
Topic: set/unset parent
Replies: 7
Views: 5721

Re: set/unset parent

yeah, im looking through some old code too where i used ent.get_property_int("m_pParent"). its btw returning the inthandle/-1.

might be worth adding .parent as playerentity imo
by D3CEPTION
Wed Jan 25, 2017 2:10 am
Forum: Plugin Development Support
Topic: set/unset parent
Replies: 7
Views: 5721

Re: set/unset parent

is it also possible to check for a parents entity existance?

like this:

Syntax: Select all

if ent.parent:
print("ent has parent")


Syntax: Select all

if ent.get_parent():
print("ent has parent")
by D3CEPTION
Wed Jan 25, 2017 1:39 am
Forum: Plugin Development Support
Topic: spawn entity with index only
Replies: 6
Views: 5117

Re: spawn entity with index only

i dont really get what you are trying to say... my question is if/why sp cant handle setting ent.model_index only.. i only explained it to hlep you understand my question better. sp could easily retrieve the modelpath from the preache table by index only and then send a working sendtable at ent.spaw...
by D3CEPTION
Wed Jan 25, 2017 1:25 am
Forum: Plugin Development Support
Topic: spawn entity with index only
Replies: 6
Views: 5117

Re: spawn entity with index only

but it might just be that the server always uses sendtables to handle edict traffic...which would leave no option for sp to make it more efficient... but maybe sp could make it easier on the script-end by letting users set the model_index only and then internally create the sendtable from looking up...
by D3CEPTION
Wed Jan 25, 2017 1:21 am
Forum: Plugin Development Support
Topic: spawn entity with index only
Replies: 6
Views: 5117

Re: spawn entity with index only

i am wondering why it isnt possible to set a model by ent.modelindex only in my posted situation. while ent.modelpath works. but my fear is that setting the path makes sp send the client the whole string via network? shouldnt setting .modelindex suffice in my case? its actually a question if sp is a...
by D3CEPTION
Tue Jan 24, 2017 8:22 pm
Forum: Plugin Development Support
Topic: set/unset parent
Replies: 7
Views: 5721

Re: set/unset parent

okay clear_parent() actually does remove the parent correctly. the error i had was due to not setting the .model_name
by D3CEPTION
Tue Jan 24, 2017 8:17 pm
Forum: Plugin Development Support
Topic: set/unset parent
Replies: 7
Views: 5721

Re: set/unset parent

will ent.clear_parent() remove the parent?
by D3CEPTION
Tue Jan 24, 2017 8:12 pm
Forum: Plugin Development Support
Topic: set/unset parent
Replies: 7
Views: 5721

set/unset parent

im trying to unset a parent to an entity after setting it this way: ent.set_parent(parententity.pointer) this is how i would think to remove it, but doesnt work: ent.set_parent(Entity(0).pointer) error is: Exception ignored in: <bound method __del__ of <entities.helpers.Entit...
by D3CEPTION
Tue Jan 24, 2017 5:53 pm
Forum: Plugin Development Support
Topic: spawn entity with index only
Replies: 6
Views: 5117

spawn entity with index only

is it possible to tell a client to render a model on a networked entity after precaching the path by the index only?

"ent.model_index" -> doesnt work
"ent.model_path" -> does work
by D3CEPTION
Tue Jan 24, 2017 5:43 am
Forum: Plugin Development Support
Topic: weapon_fire event on leftclick
Replies: 12
Views: 8980

Re: weapon_fire event on leftclick

oh yeah, i just found that too. but how come http://wiki.sourcepython.com/developing ... ity.Weapon doesnt show all directory methods of an object, while dir() in python does?
by D3CEPTION
Tue Jan 24, 2017 5:41 am
Forum: Plugin Development Support
Topic: weapon_fire event on leftclick
Replies: 12
Views: 8980

Re: weapon_fire event on leftclick

well i cant really update my thread so ill repost a solution

Syntax: Select all

@EntityPreHook(is_knife, 'secondary_attack')
def _secondary_knife_attack(stack_data):
weapon = Weapon(index_from_pointer(stack_data[0]))
print(weapon.owner.index,weapon.weapon_name)
by D3CEPTION
Tue Jan 24, 2017 5:34 am
Forum: Plugin Development Support
Topic: weapon_fire event on leftclick
Replies: 12
Views: 8980

Re: weapon_fire event on leftclick

is_knife = EntityCondition.equals_entity_classname('weapon_knife') @EntityPreHook(is_knife, 'secondary_attack') def _secondary_knife_attack(stack_data): entity = Weapon(index_from_pointer(stack_data[0])) print(entity.weapon_name) i hav...
by D3CEPTION
Tue Jan 24, 2017 5:22 am
Forum: Plugin Development Support
Topic: weapon_fire event on leftclick
Replies: 12
Views: 8980

Re: weapon_fire event on leftclick

well i tried to use this: EntityCondition.equals_datamap_classname('CWeaponCSBase') but im also getting no secondary attack. does the stackdata contain the players index? cant really find any info on it anywhere..
by D3CEPTION
Tue Jan 24, 2017 5:08 am
Forum: Plugin Development Support
Topic: weapon_fire event on leftclick
Replies: 12
Views: 8980

Re: weapon_fire event on leftclick

actually i think i will just use the weapon_fire event that i mentioned and then use your method for those weapons that are not getting fired in the event. i dont think there will be many exceptions..
by D3CEPTION
Tue Jan 24, 2017 5:04 am
Forum: Plugin Development Support
Topic: weapon_fire event on leftclick
Replies: 12
Views: 8980

Re: weapon_fire event on leftclick

mhh thanks so far. my goal really is to do this for all players, and all weapons they carrry. basically a replica of weapon_fire event, only for primary AND secondary. so if i did this with your method, are there any disadvantages in creating multiple prehooks?

Go to advanced search