Raised This Month: $32 Target: $400
 8% 

How to check grenade is touch world


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
keygens
Senior Member
Join Date: Mar 2010
Location: Somewhere
Old 01-22-2015 , 18:05   How to check grenade is touch world
Reply With Quote #1

Hello guys. How to check by stock or function, when player is throwing grenade and she touch world? Thanks in advance.
keygens is offline
KissLick
Veteran Member
Join Date: Nov 2012
Location: void
Old 01-22-2015 , 18:17   Re: How to check grenade is touch world
Reply With Quote #2

event grenade_bounce and event weapon_fire (not sure about that) or SDKHook SDKHook_Spawn.

P.S.: I assume the game is CS:S or CS:GO...

Last edited by KissLick; 01-22-2015 at 18:18.
KissLick is offline
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Old 01-22-2015 , 21:11   Re: How to check grenade is touch world
Reply With Quote #3

grenade_bounce only returns the userid, right?

You'd probably have to hook the entity (SDKHooks OnEntityCreated) of the projectile (hegrenade_projectile) and somehow determine when it collides with the world (SDKHooks StartTouch) - have a look at the StickyNades
__________________
View my Plugins | Donate

Last edited by TnTSCS; 01-22-2015 at 21:11.
TnTSCS is offline
Michalplyoutube
Veteran Member
Join Date: Jan 2013
Location: Tank Carrier in Mannhatt
Old 01-23-2015 , 07:50   Re: How to check grenade is touch world
Reply With Quote #4

Get entity flags? if fl_onground?
__________________
The plugin developer of TF2BWR Reborn
And a TF2 Player
Michalplyoutube is offline
KissLick
Veteran Member
Join Date: Nov 2012
Location: void
Old 01-23-2015 , 09:21   Re: How to check grenade is touch world
Reply With Quote #5

Quote:
Originally Posted by Michalplyoutube View Post
Get entity flags? if fl_onground?
That would require some repeating hook like think or game frame.. :-/ maybe sdkhooks collision/touch hook works with world, that would be better.
KissLick is offline
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Old 02-01-2015 , 11:14   Re: How to check grenade is touch world
Reply With Quote #6

StickyNades does what you're describing. It can "stick" to the world, so, in that code you'll see how they set it up to determine when the projectile touches a part of the "world"
__________________
View my Plugins | Donate
TnTSCS 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 18:41.


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