Raised This Month: $32 Target: $400
 8% 

[CS:S] Anti Flash v1.2


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Despirator
Senior Member
Join Date: Jun 2011
Location: Kazakhstan ->Shymkent
Plugin ID:
2390
Plugin Version:
1.2
Plugin Category:
Server Management
Plugin Game:
Counter-Strike: Source
Plugin Dependencies:
    Servers with this Plugin:
    6 
    Plugin Description:
    The plugin will prevents players to be blinded and (or) deafened
    Old 06-23-2011 , 04:43   [CS:S] Anti Flash v1.2
    Reply With Quote #1

    Description:
    This plugin will prevents players to be blinded and (or) deafened. Prevents dead players, teammates or an owner to be flashed.

    Console Variables:
    Code:
    // Enables/Disables flashbangs to blind players
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    sm_antiflash_blind "1"
    
    // Prevents dead players to be flashed
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    sm_antiflash_dead "1"
    
    // Enables/Disables flashbangs to deafen players
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    sm_antiflash_deafen "1"
    
    // Enables/Disables the plugin
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    sm_antiflash_enable "1"
    
    // Prevents an owner to be flashed
    // -
    // Default: "0"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    sm_antiflash_owner "0"
    
    // Prevents teammates to be flashed
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    sm_antiflash_team "1"
    Requirements:
    Sourcemod 1.3 or higher

    Credits:
    SAMURAI16 for original plugin which can be found here

    Special thanks to:
    Bacardi for this http://forums.alliedmods.net/showpos...1&postcount=13
    But he thinks that this way which he described there is useless. LOL

    Installation:
    Put anti-flash.sp to the sourcemod/scripting folder
    Put anti-flash.smx to the sourcemod/plugins folder
    Start server to auto-generate config file
    Then configure the plugin in the config file here cstrike/cfg/sourcemod/plugin.anti-flash.cfg
    Change map or restart server or execute on the server console this "exec sourcemod/plugin.anti-flash.cfg"

    Changelog:
    Quote:
    • v1.1
      Day: 24 Month:06 Year: 2011
    • Fixed bug removing blinds and (or) deafen effect even if player didn't flashed by owner.
      Bug: Entire an owner's team will be unflashed at any distance through walls even if they were flashed by another player
    • Script optimize

      v1.2
    • Fixed preventing dead player to be flashed
    Attached Files
    File Type: sp Get Plugin or Get Source (anti-flash.sp - 4623 views - 5.6 KB)

    Last edited by Despirator; 12-16-2012 at 17:52. Reason: Updated
    Despirator is offline
    Bacardi
    Veteran Member
    Join Date: Jan 2010
    Location: mom's basement
    Old 06-23-2011 , 05:02   Re: [CS:S] Anti Flash v1.0
    Reply With Quote #2

    You better use that [CS:S] Flashbang Tools
    Bacardi is offline
    Despirator
    Senior Member
    Join Date: Jun 2011
    Location: Kazakhstan ->Shymkent
    Old 06-23-2011 , 05:12   Re: [CS:S] Anti Flash v1.0
    Reply With Quote #3

    Quote:
    Originally Posted by Bacardi View Post
    You better use that [CS:S] Flashbang Tools
    but this plugin works well without it and there is no OnGameFrame forward because i found another way

    Last edited by Despirator; 06-23-2011 at 05:15.
    Despirator is offline
    Bacardi
    Veteran Member
    Join Date: Jan 2010
    Location: mom's basement
    Old 06-23-2011 , 05:21   Re: [CS:S] Anti Flash v1.0
    Reply With Quote #4

    You not mind if I try make another versio, but this would only affect flashbang deafness... ?
    *edit
    Not blindness.
    Bacardi is offline
    Despirator
    Senior Member
    Join Date: Jun 2011
    Location: Kazakhstan ->Shymkent
    Old 06-23-2011 , 05:24   Re: [CS:S] Anti Flash v1.0
    Reply With Quote #5

    it prevents a player to be both blinded and deafened

    and with it you can remove deafen or blind or both to opposite players

    Of course, I don't. Try another version. But I think it wouldn't be sensible, because of this plugin

    Edit
    What do you mean?
    It would affect both blindness and deafness

    Last edited by Despirator; 06-23-2011 at 05:35.
    Despirator is offline
    Bacardi
    Veteran Member
    Join Date: Jan 2010
    Location: mom's basement
    Old 06-23-2011 , 05:43   Re: [CS:S] Anti Flash v1.0
    Reply With Quote #6

    I want replace that *beep sound to pure mute, using fade what @Greyscale mention
    with settings
    Bacardi is offline
    Despirator
    Senior Member
    Join Date: Jun 2011
    Location: Kazakhstan ->Shymkent
    Old 06-23-2011 , 05:47   Re: [CS:S] Anti Flash v1.0
    Reply With Quote #7

    my plugin just blocks it at all with dsp_player command
    and player can hear everything

    Last edited by Despirator; 06-23-2011 at 06:01.
    Despirator is offline
    Greyscale
    SourceMod Plugin Approver
    Join Date: Dec 2007
    Location: strYoMommasHouse[you];
    Old 06-23-2011 , 11:29   Re: [CS:S] Anti Flash v1.0
    Reply With Quote #8

    Anyone can make whatever they want. Just if you use code from anyone else, make sure you give credit.
    __________________
    Greyscale is offline
    Greyscale
    SourceMod Plugin Approver
    Join Date: Dec 2007
    Location: strYoMommasHouse[you];
    Old 06-23-2011 , 11:37   Re: [CS:S] Anti Flash v1.0
    Reply With Quote #9

    Since it is not a requirement for a plugin to be bug-free for approval, I will approve it. But you might want to double-check this:

    Code:
    if (b_antiteam && GetClientTeam(i) == GetClientTeam(client) && i != client)
    				StopFlash(i);
    			else if (b_antiowner && i == client)
    				StopFlash(i);
    			else if (b_antidead && !IsPlayerAlive(i))
    				StopFlash(i);
    			else
    			{
    				if (!b_blind)
    					RemoveBlind(i);
    				if (!b_deafen)
    					RemoveDeafen(i);
    			}
    Everything below the first true if-statement will be ignored because you used 'else'. I don't know if that's what you intended.
    __________________
    Greyscale is offline
    Despirator
    Senior Member
    Join Date: Jun 2011
    Location: Kazakhstan ->Shymkent
    Old 06-23-2011 , 15:05   Re: [CS:S] Anti Flash v1.0
    Reply With Quote #10

    Quote:
    Originally Posted by Greyscale View Post
    Since it is not a requirement for a plugin to be bug-free for approval, I will approve it. But you might want to double-check this:

    Code:
    if (b_antiteam && GetClientTeam(i) == GetClientTeam(client) && i != client)
    				StopFlash(i);
    			else if (b_antiowner && i == client)
    				StopFlash(i);
    			else if (b_antidead && !IsPlayerAlive(i))
    				StopFlash(i);
    			else
    			{
    				if (!b_blind)
    					RemoveBlind(i);
    				if (!b_deafen)
    					RemoveDeafen(i);
    			}
    Everything below the first true if-statement will be ignored because you used 'else'. I don't know if that's what you intended.
    You forgot that there is cycle of it

    thats what I intended

    but I just noticed that i could call GetClientTeam(client) only once

    PHP Code:
    public Action:OnFlashDetonate_PrePost(Handle:event, const String:name[], bool:dontBroadcast)
    {
        new 
    owner GetClientOfUserId(GetEventInt(event,"userid"));
        new 
    ownerteam GetClientTeam(owner);
        
        for (new 
    1<= MaxClientsi++) // cycle
        
    {
            if (
    IsInGame[i] && IsInGame[owner]) // clients in game
            
    {
                if (
    b_antiteam && GetClientTeam(i) == ownerteam && != owner// if player is in owner team but not owner
                    
    StopFlash(i);
                else if (
    b_antiowner && == owner// if player is owner
                    
    StopFlash(i);
                else if (
    b_antidead && !IsPlayerAlive(i)) // if player is dead
                    
    StopFlash(i);
                else 
    // if player is in opposite team and alive
                
    {
                    if (!
    b_blind// check wherther sm_antiflash_blind is disabled
                        
    RemoveBlind(i); // remove blind effect
                    
    if (!b_deafen// check wherther sm_antiflash_deafen is disabled
                        
    RemoveDeafen(i); // remove deafen effect
                
    }
            }
        }
        return 
    Plugin_Continue;

    Edit:
    Found bug, now fixed
    Plugin optimized

    Last edited by Despirator; 06-23-2011 at 16:49.
    Despirator is offline
    Reply


    Thread Tools
    Display Modes

    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:05.


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