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

[CS:S] Flashbang removal


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
lordoflort
Member
Join Date: Dec 2010
Old 12-28-2010 , 11:48   [CS:S] Flashbang removal
Reply With Quote #1

The title really tells everything.

I'm basically looking for a plugin, that allows me to remove flashbangs, either by command, or in intervals.

I need this, because I have a server running a "trikz" mod. In this mod, there is a feature, that allows people to get unlimited flashbangs (Basically the feature spawns a flashbang on a player, whenever he throws one). However, some people are messing around with this feature, and "dropping" flashbangs on the ground. If this is done in large amounts, the server will crash.

Can it be created?
lordoflort is offline
Peace-Maker
SourceMod Plugin Approver
Join Date: Aug 2008
Location: Germany
Old 12-29-2010 , 12:52   Re: [CS:S] Flashbang removal
Reply With Quote #2

That's a short one. This plugin removes all flashbangs laying around on the floor every 5 seconds.
PHP Code:
#pragma semicolon 1
#include <sourcemod>
#include <sdktools>

public OnPluginStart()
{
    
CreateTimer(5.0Timer_RemoveFlashbangs_TIMER_REPEAT);
}

public 
Action:Timer_RemoveFlashbangs(Handle:timerany:data)
{
    new 
iMaxEnts GetMaxEntities();
    
decl String:sClassName[64];
    for(new 
i=MaxClients;i<iMaxEnts;i++)
    {
        if(
IsValidEntity(i) && 
           
IsValidEdict(i) && 
           
GetEdictClassname(isClassNamesizeof(sClassName)) &&
           
StrEqual(sClassName"weapon_flashbang") &&
           
GetEntPropEnt(iProp_Send"m_hOwnerEntity") == -1)
        {
            
RemoveEdict(i);
        }
    }

__________________
Peace-Maker is offline
lordoflort
Member
Join Date: Dec 2010
Old 01-01-2011 , 11:25   Re: [CS:S] Flashbang removal
Reply With Quote #3

Awesome!

- Well, since I'm a complete noob to scripting, I have no idea how to implement this?
- Should I just open Notepad, and save the file as a .SMX file? or do I need some sort of compiler?
lordoflort is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 01-01-2011 , 14:27   Re: [CS:S] Flashbang removal
Reply With Quote #4

Try copy/paste code and add here
http://www.sourcemod.net/compiler.php
Bacardi is offline
lordoflort
Member
Join Date: Dec 2010
Old 01-01-2011 , 17:41   Re: [CS:S] Flashbang removal
Reply With Quote #5

Nice!
Thank you (:
lordoflort is offline
lordoflort
Member
Join Date: Dec 2010
Old 01-01-2011 , 17:50   Re: [CS:S] Flashbang removal
Reply With Quote #6

And the plugin works like a charm!
lordoflort is offline
Marshmallow
Member
Join Date: Nov 2018
Old 11-14-2018 , 07:11   Re: [CS:S] Flashbang removal
Reply With Quote #7

hi i need a plugin for remove droped guns but not all guns.look like decals limiter>when set it 100 ,101st decale was removing .
i want that for my !wg (weapon giver) plugin.because players drop the very very guns in the server and map is fulling by guns and items so that crashing.
Marshmallow is offline
ae2x
Member
Join Date: Mar 2017
Old 12-28-2018 , 16:57   Re: [CS:S] Flashbang removal
Reply With Quote #8

Hi, thats pretty good script but i have on question!

If i replase weapon_flashbang to weapon_usp so how can i add effect to usp when Player drop it like this dead body remover script has https://forums.alliedmods.net/showthread.php?p=622834

if someone can help i would be so thankful
ae2x 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 07:21.


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