AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugin/Gameplay Ideas and Requests (https://forums.alliedmods.net/forumdisplay.php?f=60)
-   -   [CS:S] Flashbang removal (https://forums.alliedmods.net/showthread.php?t=146464)

lordoflort 12-28-2010 11:48

[CS:S] Flashbang removal
 
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?

Peace-Maker 12-29-2010 12:52

Re: [CS:S] Flashbang removal
 
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);
        }
    }



lordoflort 01-01-2011 11:25

Re: [CS:S] Flashbang removal
 
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?

Bacardi 01-01-2011 14:27

Re: [CS:S] Flashbang removal
 
Try copy/paste code and add here
http://www.sourcemod.net/compiler.php

lordoflort 01-01-2011 17:41

Re: [CS:S] Flashbang removal
 
Nice! :D
Thank you (:

lordoflort 01-01-2011 17:50

Re: [CS:S] Flashbang removal
 
And the plugin works like a charm! :D

Marshmallow 11-14-2018 07:11

Re: [CS:S] Flashbang removal
 
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.

ae2x 12-28-2018 16:57

Re: [CS:S] Flashbang removal
 
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 :)


All times are GMT -4. The time now is 05:40.

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