Raised This Month: $429 Target: $400
 107% 

Solved [CS:GO] Get projectile parent weapon


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kadet.89
Veteran Member
Join Date: Nov 2012
Old 03-21-2020 , 13:24   [CS:GO] Get projectile parent weapon
Reply With Quote #1

I give a player weapon_breachcharge. He uses it and plants 1 projectile on the ground (breachcharge_projectile). Then he drops the weapon_breachcharge on the ground.
When it's dropped I need to determine that the breachcharge_projectile is created out of the weapon_breachcharge.

When somobody picks the weapon_breachcharge he can see a yellow mark above the breachcharge_projectile and only this projectile and not others. There should be a conenction between the two entities, but I can't find it. Is it some netprop, datamap?

If I give 2 weapon_breachcharge to one player and he plants a breachcharge_projectile from each of them. He can see the yellow mark only abeve the one, which was created out of the weapon_breachcharge which is in the player's hands.

It should also work the same for grenades and bumpmne...
Attached Images
File Type: jpg breachcharge.jpg (96.7 KB, 19 views)

Last edited by kadet.89; 03-22-2020 at 05:33.
kadet.89 is offline
Send a message via Skype™ to kadet.89
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine
Old 03-22-2020 , 03:44   Re: [CS:GO] Get projectile parent weapon
Reply With Quote #2

I think, fast walkaround could be set flag when somebody drops weapon_breachcharge and catch that flag in OnEntityCreated() filtering projectile class.

Also, did you try:
PHP Code:
public void OnEntityCreated(int entity, const char[] classname)
{
    if (
strcmp(classname"breachcharge_projectile") == 0)
    {
        
SDKHook(entitySDKHook_SpawnPostSpawnPost);
    }
}

public 
void SpawnPost(int entity)
{
    
int client GetEntPropEnt(entityProp_Data"m_hThrower");
    if ( 
client != -1)
    {
        
PrintToChatAll("%i plant breachcharge_projectile"client);
    }

Perhaps, can require one more frame.

Try also, dump all props with tEntDev of 2 different projectiles and compare them to see what props changed.
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D1 fun (Bloody Witch)
[My plugins] [My tools] [GitHub] [Articles]
Dragokas is online now
kadet.89
Veteran Member
Join Date: Nov 2012
Old 03-22-2020 , 05:33   Re: [CS:GO] Get projectile parent weapon
Reply With Quote #3

Some projectile types have m_weaponThatThrewMe sendprop. it's initialised after postspaw.

Last edited by kadet.89; 03-22-2020 at 05:34.
kadet.89 is offline
Send a message via Skype™ to kadet.89
Reply


Thread Tools
Display Modes

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 11:54.


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