Raised This Month: $51 Target: $400
 12% 

[CS:GO] Block projectile explode


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
fl0werD
Senior Member
Join Date: May 2011
Old 09-30-2017 , 19:31   [CS:GO] Block projectile explode
Reply With Quote #1

Hellou. How to block explode on projectile grenade?
None of the offsets gives time before the explosion.
fl0werD is offline
Send a message via ICQ to fl0werD
Franc1sco
Veteran Member
Join Date: Oct 2010
Location: Spain (Madrid)
Old 09-30-2017 , 22:13   Re: [CS:GO] Block projectile explode
Reply With Quote #2

PHP Code:
#include <sourcemod>
#include <sdktools>
#include <sdkhooks>

public OnEntityCreated(entity, const String:classname[])
{
    if(
StrContains(classname"_projectile") != -1SDKHook(entitySDKHook_SpawnPostGrenade_SpawnPost);
    
}

public 
Grenade_SpawnPost(entity)
{
    new 
client GetEntPropEnt(entityProp_Send"m_hOwnerEntity");
    if (
client == -1)return;
    new 
iReference EntIndexToEntRef(entity);
    
CreateTimer(0.1Timer_OnGrenadeCreatediReference);
}

public 
Action:Timer_OnGrenadeCreated(Handle:timerany:ref)
{
    new 
entity EntRefToEntIndex(ref);
    if(
entity != INVALID_ENT_REFERENCE)
    {
            
SetEntProp(entityProp_Data"m_nNextThinkTick", -1); // block grenade explosion
    
}

https://forums.alliedmods.net/showthread.php?p=2362310
__________________
Veteran Coder -> Activity channel
Coding on CS2 and taking paid and free jobs.

Contact: Steam, Telegram or discord ( franug ).

You like my work? +Rep in my steam profile comments or donate.

Franc1sco is offline
Send a message via MSN to Franc1sco
fl0werD
Senior Member
Join Date: May 2011
Old 10-01-2017 , 09:59   Re: [CS:GO] Block projectile explode
Reply With Quote #3

Thanks, but code like a crutch. Maybe hook "pre-detonate" or time for explode (like var_dmgtime on cs 1.6)?

think part from zp50_grenade_frost.sma

Last edited by fl0werD; 10-01-2017 at 10:00.
fl0werD is offline
Send a message via ICQ to fl0werD
fl0werD
Senior Member
Join Date: May 2011
Old 10-03-2017 , 10:02   Re: [CS:GO] Block projectile explode
Reply With Quote #4

This code is server crash. How to specify the arguments for void CBaseGrenade::Explode(trace_t * pTrace, int bitsDamageType) for DHooks?

PHP Code:
hCBaseGrenade_Explode_Post DHookCreateGameConfGetOffsethGameData"CBaseGrenade::Explode" ), HookType_EntityReturnType_VoidThisPointer_CBaseEntityCBaseGrenade__Explode_Post );
DHookAddParamhCBaseGrenade_Explode_PostHookParamType_ObjectPtr, -1DHookPass_ByRef);
DHookAddParamhCBaseGrenade_Explode_PostHookParamType_Int ); 

Last edited by fl0werD; 10-03-2017 at 10:03.
fl0werD is offline
Send a message via ICQ to fl0werD
Mitchell
~lick~
Join Date: Mar 2010
Old 10-03-2017 , 10:40   Re: [CS:GO] Block projectile explode
Reply With Quote #5

DHooks are for catching it the "Explode" offset.
I think you're looking for SDKCall
Unless you want to catch the explode function then maybe the offset stored in your gamedata is wrong and is causing the crash.
Mitchell is offline
fl0werD
Senior Member
Join Date: May 2011
Old 10-03-2017 , 13:18   Re: [CS:GO] Block projectile explode
Reply With Quote #6

DHookAddParam is wrong. Help me to set right arguments.
I want to block explode.
fl0werD is offline
Send a message via ICQ to fl0werD
ESK0
BANNED
Join Date: May 2014
Location: Czech Republic
Old 10-04-2017 , 01:32   Re: [CS:GO] Block projectile explode
Reply With Quote #7

https://github.com/ESK0/FurienCSGO/b...furien.sp#L280
ESK0 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 00:10.


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