AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Removing guns on death (https://forums.alliedmods.net/showthread.php?t=48571)

SubStream 12-14-2006 20:16

Removing guns on death
 
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.

[ --<-@ ] Black Rose 12-14-2006 20:34

Re: Removing guns on death
 
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 , "");

XxAvalanchexX 12-15-2006 00:31

Re: Removing guns on death
 
http://forums.alliedmods.net/showthread.php?t=23558

SubStream 12-16-2006 03:25

Re: Removing guns on death
 
Quote:

Originally Posted by XxAvalanchexX (Post 415589)

Thanx. That's exactly what I was looking for. I appreciate it.

VEN 01-01-2007 20:38

Re: Removing guns on death
 
Note that No Weapon Drop uses a better (safe and "natural") weapon deleting method.


All times are GMT -4. The time now is 06:58.

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