Raised This Month: $ Target: $400
 0% 

Smoke grenade explosion delay + finding players in radius [SOLVED]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 12-27-2014 , 05:47   Re: Hallelujah nade - base questions about nade entities
Reply With Quote #1

http://amxmodx.org/api/engine/find_sphere_class
Better to use the new documentation, more convenient

1. Oprheu it's not hard, the hard part is searching for functions in windows dll( they don't have names so you need to search by used strings ), finding what function do what you want, but you get used with it after some time.

This is the signature:
Code:
{
    "name"        : "SG_Detonate",
    "class"       : "CGrenade",
    "library"     : "mod",
    "identifiers" :
    [
        {
            "os"    : "windows",
            "mod"   : "cstrike",
            "value" : "?SG_Detonate@CGrenade@@QAEXXZ"
        },
        {
            "os"    : "linux",
            "mod"   : "cstrike",
            "value" : "SG_Detonate__8CGrenade"
        },
        {
            "os"    : "linux",
            "mod"   : "cstrike",
            "value" : "_ZN8CGrenade11SG_DetonateEv"
        }
    ]
}
Taken from one of Arkshine's posts, I think he won't have a problem with that.

The code:
PHP Code:
#include <amxmodx>
#include <orpheu>

public plugin_init()
{
      new 
OrpheuFunction:HandleSGDetonateFunc
      HandleSGDetonateFunc 
OrpheuGetFunction("SG_Detonate""CGrenade")
      
OrpheuRegisterHook(HandleSGDetonateFunc"OnSGDetonate"OrpheuHookPre)
}

public 
OnSGDetonate(const GrenadeEntity)
{
    

I think you can go on your own further.

3. You choose your radius as you want.
PHP Code:
new ArrayPlayers32 ], PlayersNumid
    
const DMG_GRENADE 1<<24
    PlayersNum
find_sphere_class(here_you_put_your_new_nade_entity_index"player"radiusArrayPlayerssizeof ArrayPlayers)
    for(new 
iiPlayersNumi++)
    {
        
id ArrayPlayers[i]
        if(
is_user_alive(id))
        {
            
ExecuteHam(Ham_TakeDamageid0here_you_put_your_new_nade_entity_indexhere_you_put_the_damageDMG_GRENADE)
        }
    } 
__________________

Last edited by HamletEagle; 12-27-2014 at 09:48. Reason: Fixed a typo.
HamletEagle 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:21.


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