Raised This Month: $ Target: $400
 0% 

Solved How to turn off HE Grenade explosion?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
_pHabb
Senior Member
Join Date: Jul 2013
Location: GetCountry(pHabb);
Old 11-17-2016 , 16:08   How to turn off HE Grenade explosion?
Reply With Quote #1

Hi, guys.

Help me pls! How to hook HE grenade detonation?

Tried this. Dont work.
PHP Code:
public OnPluginStart()
{
    
HookEvent("hegrenade_detonate"HEGrenade_DetonateEventHookMode_Pre);
}

public 
Action:HEGrenade_Detonate(Handle:event, const String:name[], bool:dontBroadcast
{
    return 
Plugin_Handled;

Also tried in 'OnEntityCreated' kill entity 'env_explosion'. Also not work.

Thx.

Last edited by _pHabb; 11-18-2016 at 14:01. Reason: Solved.
_pHabb is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 11-17-2016 , 16:20   Re: How to turn off HE Grenade explosion?
Reply With Quote #2

teleport the grenade entity outside the map or something.
env_explosion are completely different entities.
Mitchell is offline
xines
Veteran Member
Join Date: Aug 2013
Location: Denmark
Old 11-17-2016 , 18:36   Re: How to turn off HE Grenade explosion?
Reply With Quote #3

What game is this for?
__________________
xines is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 11-17-2016 , 21:09   Re: How to turn off HE Grenade explosion?
Reply With Quote #4

Event hooks are to late block actions performed by the server.

Think of events as message from the server to it's clients to say "this happened", where "this" has already happened. Blocking events stops the clients receiving the "this happened" message while "this" has happened regardless.

I believe the hegrenade entity has a netprop for when the grenade will explode. Try setting this to -1 or some large number.
__________________
Neuro Toxin is offline
_pHabb
Senior Member
Join Date: Jul 2013
Location: GetCountry(pHabb);
Old 11-18-2016 , 13:29   Re: How to turn off HE Grenade explosion?
Reply With Quote #5

Quote:
Originally Posted by xines View Post
What game is this for?
css
_pHabb is offline
_pHabb
Senior Member
Join Date: Jul 2013
Location: GetCountry(pHabb);
Old 11-18-2016 , 13:35   Re: How to turn off HE Grenade explosion?
Reply With Quote #6

What is entity create when grenade explode? env_explosion, or not? (for smoke grenade - env_smokestackblabla... isset)

Neuro Toxin, m_nLifeTime mby?
_pHabb is offline
_pHabb
Senior Member
Join Date: Jul 2013
Location: GetCountry(pHabb);
Old 11-18-2016 , 14:00   Re: How to turn off HE Grenade explosion?
Reply With Quote #7

PROBLEM SOLVED!

My solution:
1) I hook spawning hegrenade_projectile by SDKHooks.
2) In SpawnPost handler i create "early" timer (~1.3 sec) until grenade didnt exploded.
3) In Timer handler i kill entity: AcceptEntityInput(entity, "Kill");

Last edited by _pHabb; 11-18-2016 at 14:01.
_pHabb is offline
xines
Veteran Member
Join Date: Aug 2013
Location: Denmark
Old 11-18-2016 , 14:07   Re: How to turn off HE Grenade explosion?
Reply With Quote #8

Quote:
Originally Posted by _pHabb View Post
PROBLEM SOLVED!

My solution:
1) I hook spawning hegrenade_projectile by SDKHooks.
2) In SpawnPost handler i create "early" timer (~1.3 sec) until grenade didnt exploded.
3) In Timer handler i kill entity: AcceptEntityInput(entity, "Kill");
Well wouldn't this conflict when multiply nades are being thrown?
__________________
xines is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 11-19-2016 , 00:25   Re: How to turn off HE Grenade explosion?
Reply With Quote #9

You would have a separate timer for each grenade.
__________________
Neuro Toxin is offline
cravenge
Veteran Member
Join Date: Nov 2015
Location: Chocolate Factory
Old 11-19-2016 , 06:04   Re: How to turn off HE Grenade explosion?
Reply With Quote #10

Try making an array for each grenades to prevent conflicts when multiple grenades of the same type are thrown.
cravenge 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 15:37.


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