Raised This Month: $7 Target: $400
 1% 

[CS:S] TeamFlash Announcer [1.2] (June 16, 2013)


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Snach
Member
Join Date: Jul 2012
Plugin ID:
3697
Plugin Version:
1.2
Plugin Category:
General Purpose
Plugin Game:
Counter-Strike: Source
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Announces team flash events to the victims and to admins' consoles.
    Old 06-16-2013 , 10:53   [CS:S] TeamFlash Announcer [1.2] (June 16, 2013)
    Reply With Quote #1

    TeamFlash Announcer [1.2]

    Plugin Description
    This is a simple plugin that announces team flash events to the victims and to admins' consoles.

    This plugins was written for Counter-Strike: Source, haven't tested it on CS:GO though.

    Installations
    Download the .smx file and put it in the addons/sourcemod/plugins folder.

    ConVars
    Code:
    sm_tfannounce_version
    // The version number
    
    sm_tfannounce_enabled
    // 1 To enable TeamFlash announcements, 0 to disabled them.
    // Default: "1.0"
    // Minimum: "0.0"
    // Maximum: "1.0"
    
    sm_tfannounce_print_to_admins
    // 1 To enable TeamFlash announcements in console for admins, 0 to disabled them.
    // Default: "1.0"
    // Minimum: "0.0"
    // Maximum: "1.0"
    
    sm_tfannounce_mintime
    // Minimum flash duration for announcements.
    // Default: "1.5"
    // Minimum: "0.0"
    To Do List
    Maybe a translations support in the future, if will be requested.

    Changelog
    Code:
    [1.2] 
    - Initial public release
    Attached Files
    File Type: sp Get Plugin or Get Source (tfannounce.sp - 1484 views - 3.6 KB)

    Last edited by Snach; 06-16-2013 at 12:35.
    Snach is offline
    ilga80
    Senior Member
    Join Date: Nov 2012
    Old 06-16-2013 , 11:50   Re: [CS:S] TeamFlash Announcer [1.2] (June 16, 2013)
    Reply With Quote #2

    #include <cstrike>
    What for ?
    ilga80 is offline
    Snach
    Member
    Join Date: Jul 2012
    Old 06-16-2013 , 12:35   Re: [CS:S] TeamFlash Announcer [1.2] (June 16, 2013)
    Reply With Quote #3

    Good question, it shouldn't be there.
    Fixed.
    Snach is offline
    kills
    AlliedModders Donor
    Join Date: Sep 2008
    Location: ROU
    Old 04-01-2015 , 15:58   Re: [CS:S] TeamFlash Announcer [1.2] (June 16, 2013)
    Reply With Quote #4

    Csgo not work

    L 04/01/2015 - 22:52:19: [SM] Native "GetEntPropFloat" reported: Entity 30 (30) is invalid
    L 04/01/2015 - 22:52:19: [SM] Displaying call stack trace for plugin "tfannounce.smx":
    L 04/01/2015 - 22:52:19: [SM] [0] Line 81, /home/groups/sourcemod/upload_tmp/php5Gr6D4.sp::Event_FlashbangDetonate

    Pls Fix-it !
    kills is offline
    TnTSCS
    AlliedModders Donor
    Join Date: Oct 2010
    Location: Undisclosed...
    Old 04-01-2015 , 16:12   Re: [CS:S] TeamFlash Announcer [1.2] (June 16, 2013)
    Reply With Quote #5

    line 79 from this
    PHP Code:
    if (g_Flashed[i]) 
    to this
    PHP Code:
    if (IsClientInGame(i) && g_Flashed[i]) 
    should fix that error
    __________________
    View my Plugins | Donate
    TnTSCS is offline
    kills
    AlliedModders Donor
    Join Date: Sep 2008
    Location: ROU
    Old 04-05-2015 , 03:43   Re: [CS:S] TeamFlash Announcer [1.2] (June 16, 2013)
    Reply With Quote #6

    Quote:
    Originally Posted by TnTSCS View Post
    line 79 from this
    PHP Code:
    if (g_Flashed[i]) 
    to this
    PHP Code:
    if (IsClientInGame(i) && g_Flashed[i]) 
    should fix that error

    tnx work fine !
    kills is offline
    kills
    AlliedModders Donor
    Join Date: Sep 2008
    Location: ROU
    Old 04-26-2015 , 12:08   Re: [CS:S] TeamFlash Announcer [1.2] (June 16, 2013)
    Reply With Quote #7

    is out of date does not work correctly.
    Please update, it is a very good plugin.
    kills is offline
    kills
    AlliedModders Donor
    Join Date: Sep 2008
    Location: ROU
    Old 07-19-2015 , 08:32   Re: [CS:S] TeamFlash Announcer [1.2] (June 16, 2013)
    Reply With Quote #8

    Please update this plugins ! it is a very good plugin.
    kills is offline
    kills
    AlliedModders Donor
    Join Date: Sep 2008
    Location: ROU
    Old 01-28-2018 , 14:10   Re: [CS:S] TeamFlash Announcer [1.2] (June 16, 2013)
    Reply With Quote #9

    Please update this plugins ! it is a very good plugin.
    kills is offline
    Kammi_
    AlliedModders Donor
    Join Date: Dec 2007
    Old 07-29-2018 , 15:55   Re: [CS:S] TeamFlash Announcer [1.2] (June 16, 2013)
    Reply With Quote #10

    its working fine just use this and compile it

    http://www.sourcemod.net/compiler.php

    Code:
    #pragma semicolon 1
    #include <sourcemod>
    
    #define PLUGIN_VERSION "1.2"
    
    new bool:g_Flashed[MAXPLAYERS+1]={false,...};
    new Handle:g_cDur=INVALID_HANDLE;
    new Handle:g_cEnabled=INVALID_HANDLE;
    new Handle:g_cPrintToAdmins=INVALID_HANDLE;
    new Float:g_Dur;
    new bool:g_Enabled;
    new bool:g_PrintToAdmins;
    public Plugin:myinfo =
    {
     name = "TeamFlash Announce",
     author = "Snach`", 
     description = "TeamFlash Announce",
     version = PLUGIN_VERSION,
     url = "https://forums.alliedmods.net/member.php?u=187211"
    }
    
    public OnPluginStart()
    {
    	HookEvent("player_blind", Event_PlayerBlind);
    	HookEvent("flashbang_detonate", Event_FlashbangDetonate);
    	CreateConVar("sm_tfannounce_version", PLUGIN_VERSION, "tfannounce version", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY|FCVAR_DONTRECORD);
    	g_cDur=CreateConVar("sm_tfannounce_mintime","1.5","Minimum flash duration for announcements",0,true,0.0);
    	g_cEnabled=CreateConVar("sm_tfannounce_enabled","1","1 To enable TeamFlash announcements, 0 to disabled them",0,true,0.0,true,1.0);
    	g_cPrintToAdmins=CreateConVar("sm_tfannounce_print_to_admins","1","1 To enable TeamFlash announcements in console for admins, 0 to disabled them",0,true,0.0,true,1.0);
    	g_Dur=GetConVarFloat(g_cDur);
    	g_Enabled=GetConVarBool(g_cEnabled);
    	HookConVarChange(g_cDur,DurationChange);
    	HookConVarChange(g_cEnabled,StatusChange);
    	HookConVarChange(g_cPrintToAdmins,PrintToAdminsChange);
    	AutoExecConfig();
    	PrintToChatAll("\x04[Snach's] \x03TeamFlash Announce has been \x04Loaded.");
    }
    
    public OnPluginEnd()
    {
    	PrintToChatAll("\x04[Snach's] \x03TeamFlash Announce has been \x04Unloaded.");
    }
    
    public DurationChange(Handle:convar, const String:oldValue[], const String:newValue[])
    {
    	g_Dur=StringToFloat(newValue);
    }
    
    public StatusChange(Handle:convar, const String:oldValue[], const String:newValue[])
    {
    	g_Enabled=(StringToInt(newValue)==1);
    }
    
    public PrintToAdminsChange(Handle:convar, const String:oldValue[], const String:newValue[])
    {
    	g_PrintToAdmins=(StringToInt(newValue)==1);
    }
    
    public Event_PlayerBlind(Handle:event, const String:name[], bool:dontBroadcast)
    {
    	if(!g_Enabled)
    		return;
    	
    	new client = GetClientOfUserId(GetEventInt(event, "userid"));
    	if (GetEntPropFloat(client, Prop_Send, "m_flFlashDuration")>=g_Dur)
    		g_Flashed[client]=true;
    }
    
    public Event_FlashbangDetonate(Handle:event, const String:name[], bool:dontBroadcast)
    {
    	if(!g_Enabled)
    		return;
    	
    	new client = GetClientOfUserId(GetEventInt(event, "userid"));
    	new Float:time;
    	new bool:first=true;
    	for (new i = 1; i <= MaxClients; i++)
    	{
    		if (IsClientInGame(i) && g_Flashed[i])
    		{
    			time = GetEntPropFloat(i, Prop_Send, "m_flFlashDuration");
    			if (i == client)
    			{
    				g_Flashed[i] = false;
    				continue;
    			}
    			else if (GetClientTeam(i) == GetClientTeam(client) && IsPlayerAlive(i))
    			{
    				PrintToChat(i,"\x03[TeamFlash] \x04You were TeamFlashed by: \x03%N \x04for \x03%.2f \x04Seconds",client,time);
    				if(first)
    				{
    					first=false;
    					PrintToAdminsConsole("---------------------------------------------------");
    				}
    				if(g_PrintToAdmins)
    					PrintToAdminsConsole("[TeamFlash] %N was TeamFlashed by: %N for %.2f Seconds",i,client,time);
    			}
    			
    			g_Flashed[i] = false;
    		}
    	}
    	if(!first)
    		PrintToAdminsConsole("---------------------------------------------------");
    }
    
    public PrintToAdminsConsole(String:format[], any:...)
    {
    	decl String:message[256];
    	VFormat(message,sizeof(message),format,2);
    	for(new i=1;i<=MaxClients;i++)
    	{
    		if(IsClientConnected(i)&&GetUserAdmin(i)!=INVALID_ADMIN_ID)
    		{
    			PrintToConsole(i,"%s",message);
    		}
    	}
    }
    __________________



    Kammi_ is offline
    Send a message via ICQ to Kammi_
    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:01.


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