Raised This Month: $ Target: $400
 0% 

Removing guns on death


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
SubStream
Veteran Member
Join Date: Aug 2005
Location: USA
Old 12-14-2006 , 20:16   Removing guns on death
Reply With Quote #1

I'm trying to write a simple plugin for my own server that removes guns on death. I found this in twisted's death match. Does this do that?
Code:
public pfn_touch(ptr, ptd)
{
	if(tdmstate && is_valid_ent(ptr))
	{
		new classname[32]
		if(is_valid_ent(ptr))
			entity_get_string(ptr,EV_SZ_classname,classname,31)
		if(equali(classname,"weaponbox"))
		{		
			for(new inum=0;inum<=get_global_int(GL_maxEntities);inum++)
			{
				if(!is_valid_ent(inum)) continue
				new class[51]
				entity_get_string(inum,EV_SZ_classname,class,50)
				if(containi(class,"weapon_") == -1) continue
				new owner = entity_get_edict(inum,EV_ENT_owner)
				if(ptr == owner)
					remove_entity(inum)
			}
			remove_entity(ptr)
		}
		else if(containi(classname,"weapon_") != -1)
			remove_entity(ptr)
	}
	return PLUGIN_CONTINUE
}
If someone knows of a plugin that just removes guns from the map when someone dies, or a simple code to do that--that's all I want.

Thanx.
SubStream 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:58.


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