Raised This Month: $ Target: $400
 0% 

Grenade stuff + Kill money


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
purple_pixie
Veteran Member
Join Date: Jun 2007
Location: Winchester, England
Old 10-08-2007 , 06:59   Re: Grenade stuff + Kill money
Reply With Quote #2

A little bit of register_touch() would make you happy, I assume.

Just gotta find the thrown hegren classname, and you're sorted.

(To make a nade explode, I think you set its next think time to now+0.1 )

EDIT: It's called "grenade"

Here is how to do it with FakeMeta :
PHP Code:
#include <amxmodx>
#include <fakemeta>
public plugin_init() 
{
    
register_forward(FM_Touch,"on_touch"// call the function "on_touch" when two ent's collide
}
public 
on_touch(ent1,ent2)
{
    static 
class1[32],class2[32],temp,Float:thetime// use static variables, since this could be called a lot ...
    
pev(ent1,pev_classname,class1,sizeof class1 1// get the classname of ent 1
    
pev(ent2,pev_classname,class2,sizeof class2 1// and ent 2
    
    
if ( equal(class1,"player") && equal(class2,"grenade") ) // if it's a player and a 'nade
    
{
        
global_get(glb_time,thetime// get the current time
        
set_pev(ent2,pev_nextthink,thetime+0.1//  tell it to "think" (explode) in 0.1 seconds
        
return ; // and quit
    
}
    if ( 
equal(class2,"player") && equal(class1,"grenade") ) // same as above, but this time the other ent is the nade. (this might not ever happen, I don't know whether, say, ent1 will always be the one with the lower ent-id )
    
{
        
global_get(glb_time,thetime)
        
set_pev(ent1,pev_nextthink,thetime+0.1)
        return ;        
    }

If you really want it in engine I can probably show you how it's done with engine.

Last edited by purple_pixie; 10-08-2007 at 07:17.
purple_pixie 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 16:09.


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