Raised This Month: $ Target: $400
 0% 

Grenade Thrown [CSS]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Twelve-60
Senior Member
Join Date: Aug 2007
Old 05-28-2012 , 07:09   Grenade Thrown [CSS]
Reply With Quote #1

Just wondering if it is possible to hook when a grenade is thrown, like in goldsrc.

In CSS it only has grenade_detonate which is less useful for my purposes

Preferably without extensions...
__________________
Twelve-60 is offline
Razmo51
Senior Member
Join Date: Aug 2011
Location: Event "player_death
Old 05-28-2012 , 09:35   Re: Grenade Thrown [CSS]
Reply With Quote #2

PHP Code:
public OnEntityCreated(iEntity, const String:classname[])
{
    if(
IsValidEntity(iEntity))
    {
        if(
StrEqual(classname,"hegrenade_projectile"))    
        {
            
// do Anything
            // Warning: if you want to modify propertie of the entity, I recommend you to 
            // create a timer (0.01) and then set properties
        
}
    }

__________________
Sorry for my bad English, I'm Belgian
Razmo51 is offline
Twelve-60
Senior Member
Join Date: Aug 2007
Old 05-28-2012 , 10:02   Re: Grenade Thrown [CSS]
Reply With Quote #3

so... requires the SDKHooks extension.
__________________
Twelve-60 is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 05-28-2012 , 10:02   Re: Grenade Thrown [CSS]
Reply With Quote #4

Quote:
Originally Posted by Twelve-60 View Post
Preferably without extensions...
Well hooking usermessage RadioText("#Cstrike_TitlesTXT_Fire_in_the_hol e") and compare all players name who got message with chat output txt.
And "Fire in the hole" message should not be disabled from server.
And this works with all type grenades.
Code:
"sv_ignoregrenaderadio" = "0"
 game
 - Turn off Fire in the hole messages
In the end will be very complex...


Extensions are for helping development plugins more easily, SDKHooks begin to be regular extension on servers.
Hell, MetaMod:Source & SourceMod is big EXTENSION on server

Use @Razmo51 code, if you need get grenade "m_hThrower", create small timer to get data in next frame(s).
Maybe also block checking created entities classnames during map change to prevent errors.
Server create bunch of entities and remove before map start.
Bacardi is offline
blodia
Veteran Member
Join Date: Sep 2009
Location: UK
Old 05-28-2012 , 14:52   Re: Grenade Thrown [CSS]
Reply With Quote #5

use the weapon_fire event and check if the players grenade has been removed from their inventory, you have to do the second part as weapon_fire will be called when they hold attack not actually throw the grenade so they can switch to another weapon while keeping the grenade.
blodia is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 05-28-2012 , 19:53   Re: Grenade Thrown [CSS]
Reply With Quote #6

Explain why you cant use the extension and save a bunch of useless coding?
Mitchell is offline
Twelve-60
Senior Member
Join Date: Aug 2007
Old 05-30-2012 , 12:10   Re: Grenade Thrown [CSS]
Reply With Quote #7

Fair enough.

The reason is my plugin autoupdates and that will potentially break if the server does not have the extension already.

The less extension-dependent, the more portable a plugin is
__________________
Twelve-60 is offline
Mathias.
Veteran Member
Join Date: Aug 2010
Location: Canada is my city
Old 06-02-2012 , 19:20   Re: Grenade Thrown [CSS]
Reply With Quote #8

I am agree with you twelve-60 but SDKHOOKs rent the cost. Seriously it obviously a need in your plugins and I am pretty sure you can do amazing things with it.

SDKhooks broke rarely on update, give it a try.
Mathias. 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 13:32.


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