AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   General (https://forums.alliedmods.net/forumdisplay.php?f=58)
-   -   EmitSoundToAll (https://forums.alliedmods.net/showthread.php?t=323877)

painlesstgp 04-30-2020 19:49

EmitSoundToAll
 
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.

PC Gamer 05-01-2020 00:10

Re: EmitSoundToAll
 
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;



painlesstgp 05-01-2020 10:34

Re: EmitSoundToAll
 
Quote:

Originally Posted by PC Gamer (Post 2697281)
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.

Bacardi 05-01-2020 10:45

Re: EmitSoundToAll
 
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


All times are GMT -4. The time now is 04:19.

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