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

Join sound


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hoycieto
Senior Member
Join Date: Feb 2018
Old 02-16-2019 , 13:52   Join sound
Reply With Quote #1

Hello, I'm looking for join sound works properly after panorama update. I mean it should be not stopping played music when player join team. All already exists plugins weren't working :/
hoycieto is offline
Di3Z1E
Member
Join Date: May 2018
Old 02-19-2019 , 16:41   Re: Join sound
Reply With Quote #2

PHP Code:
#pragma semicolon 1

#define PLUGIN_AUTHOR "z4cH3r"
#define PLUGIN_VERSION "1.00"

#include <sourcemod>
#include <emitsoundany>

#pragma newdecls required
#define SoundOnJoin "JOINSOUND/FILENAME.mp3"
ConVar g_cvJoinSoundVolume null;

public 
Plugin myinfo 
{
    
name "Joinsound",
    
author PLUGIN_AUTHOR,
    
description "Play sound to players when they connect",
    
version PLUGIN_VERSION,
    
url ""
}

public 
void OnPluginStart()
{
    
g_cvJoinSoundVolume CreateConVar("sm_joinsound_volume""1.0""Volume of joinsound (1 = default)");
}

public 
void OnMapStart()
{
    
char szFormat[MAX_NAME_LENGTH];
    
FormatEx(szFormatsizeof(szFormat), "sound/%s"SoundOnJoin);
    
AddFileToDownloadsTable(szFormat);

    
PrecacheSoundAny(SoundOnJoin);
}

public 
void OnClientPostAdminCheck(int client)
{
    
CreateTimer(8.0Play_JoinSoundGetClientUserId(client));


public 
Action Play_JoinSound(Handle timerany userid)
{
    
int client GetClientOfUserId(client);

    if(
IsClientValid(client))
        
EmitSoundToClientAny(clientSoundOnJoin____g_cvJoinSoundVolume.FloatValue);
}

stock bool IsClientValid(int client)
{
    if(
client && client <= MaxClients && IsClientInGame(client))
        return 
true;
    return 
false;


notes
*you will need EmitSoundAny for compile
https://forums.alliedmods.net/showthread.php?t=237045

*the volume thing is taken from some other join sound plugin
Di3Z1E is offline
hoycieto
Senior Member
Join Date: Feb 2018
Old 02-26-2019 , 07:23   Re: Join sound
Reply With Quote #3

Quote:
Originally Posted by Di3Z1E View Post
PHP Code:
#pragma semicolon 1

#define PLUGIN_AUTHOR "z4cH3r"
#define PLUGIN_VERSION "1.00"

#include <sourcemod>
#include <emitsoundany>

#pragma newdecls required
#define SoundOnJoin "JOINSOUND/FILENAME.mp3"
ConVar g_cvJoinSoundVolume null;

public 
Plugin myinfo 
{
    
name "Joinsound",
    
author PLUGIN_AUTHOR,
    
description "Play sound to players when they connect",
    
version PLUGIN_VERSION,
    
url ""
}

public 
void OnPluginStart()
{
    
g_cvJoinSoundVolume CreateConVar("sm_joinsound_volume""1.0""Volume of joinsound (1 = default)");
}

public 
void OnMapStart()
{
    
char szFormat[MAX_NAME_LENGTH];
    
FormatEx(szFormatsizeof(szFormat), "sound/%s"SoundOnJoin);
    
AddFileToDownloadsTable(szFormat);

    
PrecacheSoundAny(SoundOnJoin);
}

public 
void OnClientPostAdminCheck(int client)
{
    
CreateTimer(8.0Play_JoinSoundGetClientUserId(client));


public 
Action Play_JoinSound(Handle timerany userid)
{
    
int client GetClientOfUserId(client);

    if(
IsClientValid(client))
        
EmitSoundToClientAny(clientSoundOnJoin____g_cvJoinSoundVolume.FloatValue);
}

stock bool IsClientValid(int client)
{
    if(
client && client <= MaxClients && IsClientInGame(client))
        return 
true;
    return 
false;


notes
*you will need EmitSoundAny for compile
https://forums.alliedmods.net/showthread.php?t=237045

*the volume thing is taken from some other join sound plugin
After join to team, sound stops
hoycieto is offline
Cruze
Veteran Member
Join Date: May 2017
Old 02-26-2019 , 08:00   Re: Join sound
Reply With Quote #4

Quote:
Originally Posted by hoycieto View Post
After join to team, sound stops
Can you record video of that happening? This is most probably happening in join team because you are testing this in an empty server and player connect is triggering "round_start". In round start, every previously played sound gets muted!
__________________
Taking paid private requests! Contact me
Cruze is offline
hoycieto
Senior Member
Join Date: Feb 2018
Old 03-01-2019 , 12:45   Re: Join sound
Reply With Quote #5

Quote:
Originally Posted by Cruze View Post
Can you record video of that happening? This is most probably happening in join team because you are testing this in an empty server and player connect is triggering "round_start". In round start, every previously played sound gets muted!
I'll try do this tomorrow bro. When I'm joining on empty server, there's no problem, I noticed this bug just if I'm joining when some players are already on server.

Quote:
In round start, every previously played sound gets muted!
Is there maybe any workaround for this? O.o
hoycieto is offline
Cruze
Veteran Member
Join Date: May 2017
Old 03-01-2019 , 12:52   Re: Join sound
Reply With Quote #6

Quote:
Originally Posted by hoycieto View Post
is there maybe any workaround for this? O.o
afaik, nope!
__________________
Taking paid private requests! Contact me
Cruze is offline
hoycieto
Senior Member
Join Date: Feb 2018
Old 03-06-2019 , 03:24   Re: Join sound
Reply With Quote #7

Quote:
Originally Posted by Cruze View Post
afaik, nope!
And what with https://forums.alliedmods.net/showthread.php?t=105816 this? AbNeR used this in RES and it works like needed here I think
hoycieto 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 16:55.


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