Raised This Month: $ Target: $400
 0% 

Removing alle Weapons on the floor


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
zomg-n00b
New Member
Join Date: May 2008
Old 05-16-2008 , 19:00   Removing alle Weapons on the floor
Reply With Quote #1

Hello!
How can i remove all weapons on the floor?
i know it's a stupid question, but i wasn't able to find a plugin
zomg-n00b is offline
Fredd
Veteran Member
Join Date: Jul 2007
Old 05-18-2008 , 02:51   Re: Removing alle Weapons on the floor
Reply With Quote #2

if you mean weapons that are already spawned in the map you could do something like
Code:
public OnMapStart() {     for(new i = GetMaxClients()+1; i <= GetMaxEntities(); i++)     {         if(IsValidEdict(i))         {             decl String:cls[64];             GetEdictClassname(i, cls, sizeof(cls));             if(StrContains(cls, "weapon_"))             {                 RemoveEdict(i);             }         }     }   }
if you mean removing weapons are being dropped by players you could either use my extension Hooker or the Hacks extension to find out when a client drops his weapon and simply remove it.
__________________
Need a private coder? AMXX, SourceMOD, MMS? PM me!
Fredd is offline
d00ml0rd
Member
Join Date: Apr 2007
Location: swe
Old 05-18-2008 , 13:09   Re: Removing alle Weapons on the floor
Reply With Quote #3

where do i putt the code?
d00ml0rd is offline
Send a message via MSN to d00ml0rd
Fredd
Veteran Member
Join Date: Jul 2007
Old 05-18-2008 , 13:11   Re: Removing alle Weapons on the floor
Reply With Quote #4

do you wanna removed dropped weapons or weapons spawned by the map?
__________________
Need a private coder? AMXX, SourceMOD, MMS? PM me!
Fredd is offline
octo-dhd
Member
Join Date: Jan 2008
Location: Southern California
Old 05-18-2008 , 21:03   Re: Removing alle Weapons on the floor
Reply With Quote #5

I'm still really new to this, but I had a problem when I tried

Code:
            if(StrContains(cls, "weapon_"))            
            {
                RemoveEdict(i);
            }


It seemed this matched everything.


I then tried:

Code:
            if(StrContains(cls, "weapon_")!=-1)            {
                RemoveEdict(i);
            }


and it only matched things that started with the prefix. I actually was doing this on something other than weapon_ but I think it should behave the same.
octo-dhd is offline
zomg-n00b
New Member
Join Date: May 2008
Old 05-19-2008 , 16:53   Re: Removing alle Weapons on the floor
Reply With Quote #6

Quote:
Originally Posted by Fredd View Post
do you wanna removed dropped weapons or weapons spawned by the map?
both

Last edited by zomg-n00b; 05-21-2008 at 09:07.
zomg-n00b 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 12:43.


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