Raised This Month: $51 Target: $400
 12% 

Remove weapons, bombs on the ground


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
alphaearth
Senior Member
Join Date: Feb 2018
Location: Turkey
Old 11-05-2018 , 06:09   Remove weapons, bombs on the ground
Reply With Quote #1

https://forums.alliedmods.net/showthread.php?p=2279381 Like this plugin. I want to remove the weapons and bombs on the ground with the command. Someone can help me?
__________________
alphaearth is offline
iskenderkebab33
Senior Member
Join Date: Jun 2018
Old 11-05-2018 , 07:06   Re: Remove weapons, bombs on the ground
Reply With Quote #2

https://forums.alliedmods.net/showpo...50&postcount=3
iskenderkebab33 is offline
alphaearth
Senior Member
Join Date: Feb 2018
Location: Turkey
Old 11-05-2018 , 07:15   Re: Remove weapons, bombs on the ground
Reply With Quote #3

edit: I found

PHP Code:
#include <sourcemod>
#include <sdktools>

#define PLUGIN_VERSION "1.2"

public Plugin:myinfo 
{
    
name "SM Weapon Cleanup",
    
author "TechKnow",
    
description "Removes loose weapons droped",
    
version PLUGIN_VERSION,
    
url "http://www.sourcemod.net/"
};

new 
Handle:Cvar_Removeweapons;
new 
g_WeaponParent;

public 
OnPluginStart()
{
    
CreateConVar("sm_Weaponcleanup_version"PLUGIN_VERSION"WeaponCleanup version",     FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);

    
Cvar_Removeweapons CreateConVar("Removeweapons_on""1""1 Removeweapons on 0 is off"FCVAR_PLUGIN|FCVAR_REPLICATED|FCVAR_NOTIFY);

    
g_WeaponParent FindSendPropOffs("CBaseCombatWeapon""m_hOwnerEntity");

    
RegAdminCmd("sm_cleanup"Command_ManualADMFLAG_SLAY);
    
RegAdminCmd("sm_temizle"Command_ManualADMFLAG_SLAY);
}

public 
Action:Command_Manual(clientargs)
{
    new 
maxent GetMaxEntities(), String:weapon[64];
    for (new 
i=GetMaxClients();i<maxent;i++)
    {
        if ( 
IsValidEdict(i) && IsValidEntity(i) )
        {
            
GetEdictClassname(iweaponsizeof(weapon));
            if ( ( 
StrContains(weapon"weapon_") != -|| StrContains(weapon"item_") != -) && GetEntDataEnt2(ig_WeaponParent) == -)
                    
RemoveEdict(i);
        }
    }    
    return 
Plugin_Continue;

__________________

Last edited by alphaearth; 11-05-2018 at 07:19.
alphaearth is offline
Franc1sco
Veteran Member
Join Date: Oct 2010
Location: Spain (Madrid)
Old 11-05-2018 , 08:15   Re: Remove weapons, bombs on the ground
Reply With Quote #4

My plugin do it too with more features -> https://forums.alliedmods.net/showthread.php?p=1424937
__________________
Veteran Coder -> Activity channel
Coding on CS2 and taking paid and free jobs.

Contact: Steam, Telegram or discord ( franug ).

You like my work? +Rep in my steam profile comments or donate.

Franc1sco is offline
Send a message via MSN to Franc1sco
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:34.


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