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

|CSGO| Custom Join-Message-Sound by Steamid


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ateszhun95
Senior Member
Join Date: Apr 2014
Location: Hungary
Old 06-23-2018 , 13:20   |CSGO| Custom Join-Message-Sound by Steamid
Reply With Quote #1

Hi,

Is there any plugin, with i can set custom join sound and messages idenitfied by the palyers steamid? In one plugin, unlimited players.

Thanks in advance!

Best regards and have a good evening/day )
__________________
ateszhun95 is offline
LenHard
Senior Member
Join Date: Jan 2016
Old 06-23-2018 , 17:32   Re: |CSGO| Custom Join-Message-Sound by Steamid
Reply With Quote #2

PHP Code:
#include <sourcemod>
#include <sdktools>
#pragma semicolon 1
#pragma newdecls required

KeyValues gK_JoinInfo;

public 
void OnMapStart()
{
    
gK_JoinInfo = new KeyValues("joininfo");

    
char[] sFile = new char[PLATFORM_MAX_PATH];
    
BuildPath(Path_SMsFilePLATFORM_MAX_PATH"configs/joininfo.cfg");
    
gK_JoinInfo.ImportFromFile(sFile);
}

public 
void OnMapEnd() {
    
delete gK_JoinInfo;
}

public 
void OnClientPostAdminCheck(int client)
{
    if (!
IsFakeClient(client))
    {
        
char[] sSteamId = new char[MAX_NAME_LENGTH];
        
GetClientAuthId(clientAuthId_Steam2sSteamIdMAX_NAME_LENGTH);
     
        if (
gK_JoinInfo.JumpToKey(sSteamIdfalse))
        {
            
char[] sFormat = new char[PLATFORM_MAX_PATH];
            
gK_JoinInfo.GetString("sound"sFormatPLATFORM_MAX_PATH);
            
            if (
sFormat[0] != '\0'
            {
                if (
sFormat[0] != '*')
                    
Format(sFormatPLATFORM_MAX_PATH"*%s"sFormat);    
                
EmitSoundToAll(sFormat);
            }
            
            
gK_JoinInfo.GetString("message"sFormatPLATFORM_MAX_PATH);
            
            if (
sFormat[0] != '\0'
            {
                
FilterColors(sFormat);
                
PrintToChatAll(" %s"sFormat);
            }
        }
        
gK_JoinInfo.Rewind();
    }
}

void FilterColors(char[] sString)
{    
    
ReplaceString(sStringPLATFORM_MAX_PATH"{red}""\x02"false);
    
ReplaceString(sStringPLATFORM_MAX_PATH"{green}""\x04"false);
    
ReplaceString(sStringPLATFORM_MAX_PATH"{olive}""\x06"false);
    
ReplaceString(sStringPLATFORM_MAX_PATH"{purple}""\x03"false);
    
ReplaceString(sStringPLATFORM_MAX_PATH"{yellow}""\x09"false);
    
ReplaceString(sStringPLATFORM_MAX_PATH"{blue}""\x0B"false);
    
ReplaceString(sStringPLATFORM_MAX_PATH"{pink}""\x0E"false);
    
ReplaceString(sStringPLATFORM_MAX_PATH"{grey}""\x08"false);
    
ReplaceString(sStringPLATFORM_MAX_PATH"{lightred}""\x07"false);
    
ReplaceString(sStringPLATFORM_MAX_PATH"{white}""\x01"false);
    
ReplaceString(sStringPLATFORM_MAX_PATH"{orange}""\x10"false);

Create a file in configs folder called "joininfo.cfg" and in it add
Code:
"joininfo"
{
	"STEAM_ID"
	{
		"sound" 		"*blah/file.mp3"
		"message"		"Testing"
	}
}
Try it out (Untested)

Note: Precache + add the sounds to downloads table before adding them into the file.
Attached Files
File Type: sp Get Plugin or Get Source (Join-Info.sp - 597 views - 2.1 KB)
__________________

Last edited by LenHard; 06-25-2018 at 05:54.
LenHard is offline
ateszhun95
Senior Member
Join Date: Apr 2014
Location: Hungary
Old 06-24-2018 , 08:31   Re: |CSGO| Custom Join-Message-Sound by Steamid
Reply With Quote #3

Thank you so much for your time
Unfortunately not working. No sound, no chat msg. Tested with different steamids. Sound file is good,
44 hz and 320 kbps.
__________________

Last edited by ateszhun95; 06-24-2018 at 08:32.
ateszhun95 is offline
LenHard
Senior Member
Join Date: Jan 2016
Old 06-25-2018 , 04:51   Re: |CSGO| Custom Join-Message-Sound by Steamid
Reply With Quote #4

Quote:
Originally Posted by ateszhun95 View Post
Thank you so much for your time
Unfortunately not working. No sound, no chat msg. Tested with different steamids. Sound file is good,
44 hz and 320 kbps.
I tested it and It works. Just make sure the steam id you put is correct and for the sound make sure you don't add "sound/" in the path and be sure to precache the sound prior to adding it.
__________________
LenHard is offline
Azet
Member
Join Date: Oct 2013
Old 10-24-2018 , 17:15   Re: |CSGO| Custom Join-Message-Sound by Steamid
Reply With Quote #5

How do I precache sound? With sm_downloader plugin?
Azet is offline
HvG Community
AlliedModders Donor
Join Date: Sep 2012
Old 10-25-2018 , 22:12   Re: |CSGO| Custom Join-Message-Sound by Steamid
Reply With Quote #6

Quote:
Originally Posted by Azet View Post
How do I precache sound? With sm_downloader plugin?
If you know you are going to use just this file then you can also add it right away to downloadtable when compiling plugin.
Code:
public OnMapStart()
{
	AddFileToDownloadsTable("sound/hello.wav");
        AddFileToDownloadsTable("sound/hello2.wav");
}
If not then use
https://forums.alliedmods.net/showthread.php?p=2482443

Last edited by HvG Community; 10-25-2018 at 22:13.
HvG Community 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 06:10.


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