Raised This Month: $ Target: $400
 0% 

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


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 12-27-2014 , 08:23   Re: Hallelujah nade - base questions about nade entities
Reply With Quote #7

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <orpheu>
#include <fakemeta>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"


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

public 
OnSGDetonate(ent)
{
    
client_print(pev(ent,pev_owner), print_chat"It works"

A simple test plugin which is tested and working.
Code:
It works
To block the explosion and to remove the nade just do as below:
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <orpheu>
#include <fakemeta>
#include <engine>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"


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

public 
OrpheuHookReturn:OnSGDetonate(ent)
{
    
client_print(pev(ent,pev_owner), print_chat"It works"
    
remove_entity(ent)
    return 
OrpheuSupercede

Your plugin will crash the server because you must supercede the function after removing the nade. But the message should work. Also no reason to use static.

Run orpheu config command into your server console and look into addons/amxmodx/logs. You should see something like
Code:
Parsing folder "CGrenade" started
			Parsing file "SG_Detonate" started
				Searching for name "?SG_Detonate@CGrenade@@QAEXXZ"... FOUND
			Parsing file "SG_Detonate" ended
You need to go to addons/amxmodx/configs/orpheu/functions, create a folder called CGrenade, inside it a file without any extension called SG_Detonate and after that copy the content from the post above( the one with the signature ).
__________________

Last edited by HamletEagle; 12-27-2014 at 08:29.
HamletEagle is offline
 



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