Raised This Month: $ Target: $400
 0% 

pfn_touch need help


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
avril-lavigne
Banned
Join Date: Apr 2009
Old 07-19-2013 , 15:28   pfn_touch need help
Reply With Quote #1

I did a small delay for grenade when it on the ground. it works well. but I want if it touches a player - explosion will be immediately


Code:
public pfn_touch(ptr, ptd)
{		
      
	if(pev_valid(ptr))
		{	
           
                        new classname[32];
			pev(ptr, pev_classname, classname, 31);
		
			if(equal(classname, nail_classname))
			{	
                           new Float:fOrigin[3]
                           new param[1]
		           param[0] = ptr                                  
                         
			
		           if(PointContents(fOrigin) == CONTENTS_SOLID) {
		           fOrigin[2] += 100.0		           
		           set_task(2.5, "task_ExplodeNade", 0, param, 1)  
                           }                           
                  }
        }             
}

public task_ExplodeNade(param[]) if(is_valid_ent(param[0])) 
{
	                        new Float:fOrigin[3];
				new iOrigin[3];
				pev(param[0], pev_origin, fOrigin);
				FVecIVec(fOrigin,iOrigin);			
				nail_radius_damage(param[0]);
				
				message_begin(MSG_BROADCAST,SVC_TEMPENTITY,iOrigin);
				write_byte(TE_EXPLOSION);
				write_coord(iOrigin[0]);
				write_coord(iOrigin[1]);
				write_coord(iOrigin[2]);
				write_short(explode2);
				write_byte(30);
				write_byte(15);
				write_byte(0); //flags
				message_end();                              
			
				engfunc(EngFunc_RemoveEntity, param[0]);	
}
so how to know if grenade hit the player ???
__________________
VDS in Europe 1 gb/s unmetered.Any configurations.
I accept Paypal, Moneybookers,etc
avril-lavigne 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 06:23.


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