Raised This Month: $ Target: $400
 0% 

Finding certain entity in sphere


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Xalus
Veteran Member
Join Date: Dec 2009
Location: Belgium
Old 05-08-2016 , 23:36   Re: Finding certain entity in sphere
Reply With Quote #5

Code:
public DetonateLasermine(id)
{
	new EntityName[32];
	new Float:origin[3]
	pev(id,pev_origin,origin);
	new ent = -1
	ColorChat(id, RED, "^4[SkazzY LaserMine] ^1Plugin is ^3WORKING")
	
	while((ent = find_ent_in_sphere(id,origin,512.0)) != 0) 
	{
		pev(ent, pev_classname, EntityName, 31)
		if(equali(EntityName, ENT_CLASS_NAME))
		{
			if(pev(ent, LASERMINE_OWNER) == id)
			{
				PlaySound(ent, STOP_SOUND)
				CreateExplosion(ent)
				CreateDamage(ent, get_pcvar_float(g_LRDMG), get_pcvar_float(g_LRADIUS))
				RemoveEntity(ent)
				ColorChat(id, RED, "^4[SkazzY LaserMine] ^1You have succesfully ^3DETONATED ^1your lasermine")
				
				ent = -99;
				break
			}
		}
	}
	if(ent != -99)
	{
		ColorChat(id, RED, "^4[SkazzY LaserMine] ^1You don't have any lasermines in ^3RADIUS ^1of ^3512 ^1units")
	}
	return PLUGIN_HANDLED
}
__________________
Retired.
Xalus 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 18:37.


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