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

[CS:GO] Mention player in chat


Post New Thread Reply   
 
Thread Tools Display Modes
Author
ladaladik
BANNED
Join Date: Nov 2019
Plugin ID:
7889
Plugin Version:
Plugin Category:
All
Plugin Game:
Counter-Strike: GO
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    [CS:GO] Mention player in chat
    Old 12-20-2021 , 13:50   [CS:GO] Mention player in chat
    Reply With Quote #1

    This plugin allows you to mention someone using "&their_name" example "Hello &laff , how are you"

    [+] When you mention someone, you will see that you mentioned someone in chat, and they will see that they got mentioned by you.
    [+] The player who got mentioned will hear iphone notification sound



    iNSTRUCTIONS :
    1. Put Notifications.smx into addons/sourcemod/plugins
    2. Put message.mp3 into csgo/sound
    - DOWNLOAD
    3. Put message.mp3 on your fastdownload
    4. Restart the server

    If you want different notif. sound just change it and name it message.mp3
    Attached Files
    File Type: sp Get Plugin or Get Source (Notifications.sp - 325 views - 1.6 KB)
    ladaladik is offline
    Catscz
    New Member
    Join Date: Nov 2021
    Old 12-20-2021 , 13:59   Re: [CS:GO] Mention player in chat
    Reply With Quote #2

    Cool plugin!
    It is small detail, but players love it <3
    Catscz is offline
    iDini
    Junior Member
    Join Date: Jul 2020
    Old 01-11-2022 , 06:37   Re: [CS:GO] Mention player in chat
    Reply With Quote #3

    I keep getting this error
    Dini: &dini
    L 01/11/2022 - 113:19: [SM] Exception reported: Language phrase "More than one client matched" not found (arg 4)
    L 01/11/2022 - 113:19: [SM] Blaming: Notifications.smx
    L 01/11/2022 - 113:19: [SM] Call stack trace:
    L 01/11/2022 - 113:19: [SM] [0] ReplyToCommand
    L 01/11/2022 - 113:19: [SM] [1] Line 130, /groups/sourcemod/compiler-1.10/include/commandfilters.inc::ReplyToTargetError
    L 01/11/2022 - 113:19: [SM] [2] Line 189, /groups/sourcemod/compiler-1.10/include/helpers.inc::FindTarget
    L 01/11/2022 - 113:19: [SM] [3] Line 64, /home/forums/content/files/2/9/5/4/6/6/192725.attach::Command_Say
    Also what is 67 & 68 supposed to be in english?
    I tried translating but get "Marked you" and "you marked"

    Last edited by iDini; 01-11-2022 at 07:43.
    iDini is offline
    CodeDreamer
    New Member
    Join Date: Jan 2022
    Old 01-14-2022 , 11:32   Re: [CS:GO] Mention player in chat
    Reply With Quote #4

    Hello,
    here is the fixed version:

    Code:
    #include <sourcemod>
    #include <sdktools>
    
    #pragma semicolon 1
    #pragma newdecls required
    
    #define PLUGIN_VERSION "0.00"
    
    public Plugin myinfo = 
    {
    	name = "Name of plugin here!", 
    	author = "Your name here!", 
    	description = "Brief description of plugin functionality here!", 
    	version = PLUGIN_VERSION, 
    	url = "Your website URL/AlliedModders profile URL"
    };
    
    public void OnPluginStart()
    {
    	LoadTranslations("common.phrases");
    	AddCommandListener(Command_Say, "say");
    	AddCommandListener(Command_Say, "say_team");
    }
    public void OnMapStart()
    {
    	AddFileToDownloadsTable("sound/message.mp3");
    	PrecacheSound("sound/message.mp3", true);
    }
    
    public Action Command_Say(int client, const char[] command, int args)
    {
    	char szName[32];
    	char symbol[5];
    	bool started = false;
    	char buffer[128];
    	char szText[128];
    	GetCmdArgString(buffer, sizeof(buffer));
    	GetCmdArgString(szText, sizeof(szText));
    	StripQuotes(szText);
    	int itemp;
    	Format(szText, sizeof(szText), "%s .", szText);
    	for (int i = sizeof(szText) - 1; i >= 0; i--)
    	{
    		itemp = sizeof(szText) - i - 1;
    		Format(symbol, sizeof(symbol), "%c", szText[itemp]);
    		if (StrEqual(symbol, "&"))
    		{
    			started = true;
    			continue;
    		}
    		if (started)
    		{
    			if (!StrEqual(symbol, " "))
    			{
    				Format(szName, sizeof(szName), "%s%s", szName, symbol);
    			} else {
    				break;
    			}
    		}
    	}
    	
    	if (szName[0])
    	{
    		
    		int target = target = FindTarget(client, szName, false, false);
    		if (target != -1)
    		{
    			PrintToChat(client, " \x04You tagged: \x0B%N", target);
    			PrintToChat(target, " \x04This player tagged you: \x0B%N", client);
    			ClientCommand(target, "play message.mp3");
    		} else if (IsClientConnected(client) && IsClientInGame(client)) {
    			PrintToChat(client, " \x04Tagged player \x0B%s not found.", szName);
    		}
    	}
    }
    Also, I changed the message to be in english and I added one more condition which display a message when the tagged player can't be found on server.

    Last edited by CodeDreamer; 01-14-2022 at 11:32.
    CodeDreamer is offline
    iDini
    Junior Member
    Join Date: Jul 2020
    Old 01-16-2022 , 01:14   Re: [CS:GO] Mention player in chat
    Reply With Quote #5

    Quote:
    Originally Posted by CodeDreamer View Post
    Hello,
    here is the fixed version:

    Code:
    #include <sourcemod>
    #include <sdktools>
    
    #pragma semicolon 1
    #pragma newdecls required
    
    #define PLUGIN_VERSION "0.00"
    
    public Plugin myinfo = 
    {
    	name = "Name of plugin here!", 
    	author = "Your name here!", 
    	description = "Brief description of plugin functionality here!", 
    	version = PLUGIN_VERSION, 
    	url = "Your website URL/AlliedModders profile URL"
    };
    
    public void OnPluginStart()
    {
    	LoadTranslations("common.phrases");
    	AddCommandListener(Command_Say, "say");
    	AddCommandListener(Command_Say, "say_team");
    }
    public void OnMapStart()
    {
    	AddFileToDownloadsTable("sound/message.mp3");
    	PrecacheSound("sound/message.mp3", true);
    }
    
    public Action Command_Say(int client, const char[] command, int args)
    {
    	char szName[32];
    	char symbol[5];
    	bool started = false;
    	char buffer[128];
    	char szText[128];
    	GetCmdArgString(buffer, sizeof(buffer));
    	GetCmdArgString(szText, sizeof(szText));
    	StripQuotes(szText);
    	int itemp;
    	Format(szText, sizeof(szText), "%s .", szText);
    	for (int i = sizeof(szText) - 1; i >= 0; i--)
    	{
    		itemp = sizeof(szText) - i - 1;
    		Format(symbol, sizeof(symbol), "%c", szText[itemp]);
    		if (StrEqual(symbol, "&"))
    		{
    			started = true;
    			continue;
    		}
    		if (started)
    		{
    			if (!StrEqual(symbol, " "))
    			{
    				Format(szName, sizeof(szName), "%s%s", szName, symbol);
    			} else {
    				break;
    			}
    		}
    	}
    	
    	if (szName[0])
    	{
    		
    		int target = target = FindTarget(client, szName, false, false);
    		if (target != -1)
    		{
    			PrintToChat(client, " \x04You tagged: \x0B%N", target);
    			PrintToChat(target, " \x04This player tagged you: \x0B%N", client);
    			ClientCommand(target, "play message.mp3");
    		} else if (IsClientConnected(client) && IsClientInGame(client)) {
    			PrintToChat(client, " \x04Tagged player \x0B%s not found.", szName);
    		}
    	}
    }
    Also, I changed the message to be in english and I added one more condition which display a message when the tagged player can't be found on server.
    Thank you! I have tried this and it works fine there is just still no message sound when it plays. I placed it directly where it states in the .sp but tried the default location also
    iDini is offline
    CodeDreamer
    New Member
    Join Date: Jan 2022
    Old 01-16-2022 , 09:07   Re: [CS:GO] Mention player in chat
    Reply With Quote #6

    Quote:
    Originally Posted by iDini View Post
    Thank you! I have tried this and it works fine there is just still no message sound when it plays. I placed it directly where it states in the .sp but tried the default location also
    When you are on server, type in console "play message.mp3" and after 1/2 seconds you should hear the sound. If you don't hear it, open csgo game directory/csgo/sound and check if it's there.
    Also, the sound is played only for the person who receive the message.
    CodeDreamer is offline
    ownage13
    AlliedModders Donor
    Join Date: Apr 2015
    Old 02-09-2022 , 19:58   Re: [CS:GO] Mention player in chat
    Reply With Quote #7

    Would be pretty cool if we were able to tie this to a specific flag. My thoughts are only having admins be able to use this function that way it doesn't get abused by the community! Anyways dope plugin (:
    ownage13 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 15:40.


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