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

EmitSoundToAll


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
painlesstgp
Senior Member
Join Date: May 2019
Location: Sweden
Old 04-30-2020 , 19:49   EmitSoundToAll
Reply With Quote #1

Hello, so this plugin is supposed to emit sound to all players on map.

But when i use it I hear it, and when my friend executes the command I hear it, but my friend don't and the mp3 is in his sound folder, but still not working? Any idea why?

Code:
#pragma semicolon 1
#pragma newdecls required

#include <sourcemod>
#include <sdktools>
#include <multicolors>
#include <colors>
#include <emitsoundany>

#define PATH "curlytoenails.mp3"

public Plugin myinfo =
{
    name = "SOUNDS",
    author = "cool",
    description = "Plugin that does stuff",
    version = "1.0",
    url = ""
};

char g_ColorNames[13][10] = {"White", "Red", "Green", "Blue", "Yellow", "Purple", "Cyan", "Orange", "Pink", "Olive", "Lime", "Violet", "Lightblue"};
int g_Colors[13][3] = {{255,255,255},{255,0,0},{0,255,0},{0,0,255},{255,255,0},{255,0,255},{0,255,255},{255,128,0},{255,0,128},{128,255,0},{0,255,128},{128,0,255},{0,128,255}};

public void OnPluginStart()
{
	RegAdminCmd("sm_curlytoenails", Command_CurlyToeNails, ADMFLAG_GENERIC);
}

public void OnMapStart()
{
    char buffer[PLATFORM_MAX_PATH];
    PrecacheSound(PATH);
    Format(buffer, sizeof(buffer), "sound/%s", PATH);
    AddFileToDownloadsTable(buffer);
}

public Action Command_CurlyToeNails(int client, int args)
{
    new String:name[32];
	GetClientName(client, name, 32);
    if(IsPlayerAlive(client))
    {
        EmitSoundToAll(PATH);
		CPrintToChatAll("{green}My nigga kenny do eat curly toe nails tho");
    }
    else
    {
        EmitSoundToAll(PATH);
    }
}
Any help is appriciated, thx.

Last edited by painlesstgp; 04-30-2020 at 20:05.
painlesstgp is offline
PC Gamer
Veteran Member
Join Date: Mar 2014
Old 05-01-2020 , 00:10   Re: EmitSoundToAll
Reply With Quote #2

Maybe try this? Not tested.

PHP Code:
#pragma semicolon 1
#pragma newdecls required

#include <sourcemod>

#define SONG1 "curlytoenails.mp3"

public Plugin myinfo =
{
    
name "SOUNDS",
    
author "cool",
    
description "Plugin that does stuff",
    
version "1.0",
    
url ""
};

public 
void OnPluginStart()
{
    
RegAdminCmd("sm_curlytoenails"Command_CurlyToeNailsADMFLAG_GENERIC);
}

public 
void OnMapStart()
{
    
PrecacheSound(SONG1);
    
AddFileToDownloadsTable("sound/curlytoenails.mp3");
}

public 
Action Command_CurlyToeNails(int clientint args)
{
     
EmitSoundToAll(PATH);
     
PrintToChatAll("My kenny do eat curly toe nails tho");

     return 
Plugin_Handled;

PC Gamer is offline
painlesstgp
Senior Member
Join Date: May 2019
Location: Sweden
Old 05-01-2020 , 10:34   Re: EmitSoundToAll
Reply With Quote #3

Quote:
Originally Posted by PC Gamer View Post
Maybe try this? Not tested.

PHP Code:
#pragma semicolon 1
#pragma newdecls required

#include <sourcemod>

#define SONG1 "curlytoenails.mp3"

public Plugin myinfo =
{
    
name "SOUNDS",
    
author "cool",
    
description "Plugin that does stuff",
    
version "1.0",
    
url ""
};

public 
void OnPluginStart()
{
    
RegAdminCmd("sm_curlytoenails"Command_CurlyToeNailsADMFLAG_GENERIC);
}

public 
void OnMapStart()
{
    
PrecacheSound(SONG1);
    
AddFileToDownloadsTable("sound/curlytoenails.mp3");
}

public 
Action Command_CurlyToeNails(int clientint args)
{
     
EmitSoundToAll(PATH);
     
PrintToChatAll("My kenny do eat curly toe nails tho");

     return 
Plugin_Handled;

The problem is not that it doesn't download, it does download.

I deleted the files rejoined server and the files got re-downloaded, same with my friend but he still cant hear it even when he executes it i hear it, when i execute he doesnt hear but i do.

It is strange.
painlesstgp is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 05-01-2020 , 10:45   Re: EmitSoundToAll
Reply With Quote #4

Tell us a game.
There are some difference between HL2 mods.

*edit
Are you sure, your audio file is valid in game ? Can you manually play it from console in-game ? Game not support all frequenzy Hz
__________________
Do not Private Message @me

Last edited by Bacardi; 05-01-2020 at 10:46.
Bacardi 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 08:47.


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