[Question] Entity Index
Curious if anyone here has ever played with grenades in CSGO. I know the grenade in your inventory and the entity created once you throw it are two different entities. Anyone know how to get the index of the "thrown" grenade entity? Please enlighten me.
|
Re: [Question] Entity Index
use the onentitycreate callback and check if it's a grenade_projectile type. Then SDKHook its spawnpost function where you will check the netprop m_hThrower. Use EntRefToEntIndex to get the players index that threw the grenade projectile.
|
Re: [Question] Entity Index
Quote:
|
Re: [Question] Entity Index
Now I don't want any code, I just want to know if I'm on the right track & what I might do to better improve it.
PLEASE DONT GIVE ME FINISHED CODE PHP Code:
|
Re: [Question] Entity Index
Quote:
You should use You cannot check for m_hThrower at entity creation because it's not set, it is set only after it's spawned and this is where SDKHook comes to to play. Also, I think m_hThrower is a sendprop so you should use Prop_Send, with the function GetEntPropEnt because it's checking for an entity of the thrower (a player). basically any m_h* is a handle to an entity. |
Re: [Question] Entity Index
*facepalm* I know better than to try and store a string in an int variable. Silly me. Thank you for the explination, here is what I got, with some help from the Discord. (Domino)
PHP Code:
|
Re: [Question] Entity Index
grenade_projectile isn't the real name btw, it depends on the grenade type you want, flashgrenade_projectile, hegrenade_projectile, stuff like this. although i'm not sure exactly what the names are
|
Re: [Question] Entity Index
Well specifically I'm looking for smoke. How would I go about making a debug that prints created entities in chat?
|
Re: [Question] Entity Index
public void OnEntityCreated(int entity, const char[] classname)
{ PrintToChatAll(classname); } |
Re: [Question] Entity Index
smokegrenade_projectile, hegrenade_projectile, flashbang_projectile, decoy_projectile, molotov_projectile, incgrenade_projectile, tagrenade_projectile and breachcharge for the breach charge added in Danger Zone.
|
All times are GMT -4. The time now is 11:21. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.