This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

[CS:GO & CS:S] Proper moment to set m_CollisionGroup


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ejik03
AlliedModders Donor
Join Date: Feb 2009
Location: Moscow, Russia
Old 06-02-2016 , 16:05   [CS:GO & CS:S] Proper moment to set m_CollisionGroup
Reply With Quote #1

I would like to change m_CollisionGroup of all grenades. Is it ok to change m_CollisionGroup property at OnEntityCreated, or I should wait till the entity will be spawned (using SDKHook_Spawn)?

Also, is it ok change m_CollisionGroup for player inside a Pre-hook of player_spawn or I should use a normal event hook?

CS:GO and CS:S

Last edited by ejik03; 06-02-2016 at 16:08.
ejik03 is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 06-02-2016 , 19:24   Re: [CS:GO & CS:S] Proper moment to set m_CollisionGroup
Reply With Quote #2

Say I

Code:
int entity = CreateEntity("weapon_tagrenade");
Before this line of code exits OnEntityCreated is called for all plugins listening for it.

If you change props at this stage. You run the risk of me overriding your prop edits.

When I think do this.

Code:
DispatchSpawn(entity);
Your OnEntitySpawned hook is called. This is a safe place to edit props as my plugin should only be editing props between create and dispatch.
__________________
Neuro Toxin is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:00.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode