Raised This Month: $ Target: $400
 0% 

Removing guns on death


Post New Thread Reply   
 
Thread Tools Display Modes
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
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 12-14-2006 , 20:34   Re: Removing guns on death
Reply With Quote #2

I think that code is from when you pick up an ammobox.

I would guess you could remove the guns on this.
Code:
register_forward(FM_SetModel , "");

Last edited by [ --<-@ ] Black Rose; 12-14-2006 at 20:36.
[ --<-@ ] Black Rose is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 12-15-2006 , 00:31   Re: Removing guns on death
Reply With Quote #3

http://forums.alliedmods.net/showthread.php?t=23558
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
SubStream
Veteran Member
Join Date: Aug 2005
Location: USA
Old 12-16-2006 , 03:25   Re: Removing guns on death
Reply With Quote #4

Quote:
Originally Posted by XxAvalanchexX View Post
Thanx. That's exactly what I was looking for. I appreciate it.
SubStream is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 01-01-2007 , 20:38   Re: Removing guns on death
Reply With Quote #5

Note that No Weapon Drop uses a better (safe and "natural") weapon deleting method.
VEN is offline
Reply



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