send sound to all players

Статус
В этой теме нельзя размещать новые ответы.
Сообщения
271
Реакции
43
Помог
5 раз(а)
helo how to make send sound to all players ?:)

1 case no one hears
Код:
VTC_PlaySound(0, "../valve/sound/barney/youtalkmuch.wav");
2 case only player which make gag
Код:
VTC_PlaySound(id, "../valve/sound/barney/youtalkmuch.wav");
3 case only player which get gag
Код:
VTC_PlaySound(player, "../valve/sound/barney/youtalkmuch.wav");
4 case compile error plugin.sma(615) : error 035: argument type mismatch (argument 2)
Код:
VTC_PlaySound(0, player, "../valve/sound/barney/youtalkmuch.wav");
Код:
public GagMenuHandler(id, iKey)
{
    switch(iKey)
    {
        case 5:
        {
            if(++g_MenuData[id][SELECTED_TIME] > ArraySize(g_arrGagTimes)-1)
                g_MenuData[id][SELECTED_TIME] = 0;
                       
            Show_GagMenu(id, g_MenuData[id][CURRENT_POS]);
        }
        case 6:
        {
            if(++g_MenuData[id][SELECTED_TYPE] > ArraySize(g_arrBlockTypes)-1)
                g_MenuData[id][SELECTED_TYPE] = 0;
                   
            Show_GagMenu(id, g_MenuData[id][CURRENT_POS]);
        }
        case 7:
        {
            if(++g_MenuData[id][SELECTED_REASON] > ArraySize(g_arrReasons)-1)
                g_MenuData[id][SELECTED_REASON] = 0;
                   
            Show_GagMenu(id, g_MenuData[id][CURRENT_POS]);
        }
        case 8: Show_GagMenu(id, ++g_MenuData[id][CURRENT_POS]);
        case 9:
        {
            if(g_MenuData[id][CURRENT_POS])
                Show_GagMenu(id, --g_MenuData[id][CURRENT_POS]);
        }
        default:
        {
            new player = g_arrPlayers[id][g_MenuData[id][CURRENT_POS] * GAG_MENU_ITEMS + iKey];
           
            if(!is_user_connected(player))
            {
                Show_GagMenu(id, g_MenuData[id][CURRENT_POS]);
                return PLUGIN_HANDLED;
            }

            new szAdminName[MAX_NAME_LENGTH], szPlayerName[MAX_NAME_LENGTH];
            get_user_name(id, szAdminName, charsmax(szAdminName));
            get_user_name(player, szPlayerName, charsmax(szPlayerName));
       
            if(g_PlayerData[player][GAG_BLOCK_TYPE] > STATS)
            {
                user_unblock(player);
       
                custom_color_chat(0, player, "%l %l", "MSG_PREFIX", "MSG_CHAT_UNBLOCK_ALL", szPlayerName, szAdminName);
                custom_color_chat(player, 0, "%l %l", "MSG_PREFIX", "MSG_CHAT_UNBLOCK_PL", szPlayerName, szAdminName);
            }
            else
            {
                new blocktime = ArrayGetCell(g_arrGagTimes, g_MenuData[id][SELECTED_TIME]),
                    block_types:block_type = any:g_MenuData[id][SELECTED_TYPE],
                    blockreason[REASON_LENGTH];
               
                ArrayGetString(g_arrReasons, g_MenuData[id][SELECTED_REASON], blockreason, charsmax(blockreason));
           
                user_block(player, id, blocktime, blockreason, block_type);
       
                new blocktimeinfo[32];
               
                if(!blocktime)
                    formatex(blocktimeinfo, charsmax(blocktimeinfo), "навсегда");
                else    formatex(blocktimeinfo, charsmax(blocktimeinfo), "на %d минут", blocktime);
               
                switch(block_type)
                {
                    case TEXT_CHAT:
                    {
                        custom_color_chat(0, player, "%l %l", "MSG_PREFIX", "MSG_TEXTCHAT_BLOCK_ALL", szAdminName, szPlayerName, blocktimeinfo, blockreason);
                        VTC_PlaySound(0, "../valve/sound/barney/youtalkmuch.wav");
                        custom_color_chat(player, 0, "%l %l", "MSG_PREFIX", "MSG_TEXTCHAT_BLOCK_PL", szPlayerName, szAdminName, blocktimeinfo, blockreason);
                    }
                    case VOICE_CHAT:
                    {
                        custom_color_chat(0, player, "%l %l", "MSG_PREFIX", "MSG_VOICECHAT_BLOCK_ALL", szAdminName, szPlayerName, blocktimeinfo, blockreason);
                        VTC_PlaySound(0, "../valve/sound/barney/youtalkmuch.wav");
                        custom_color_chat(player, 0, "%l %l", "MSG_PREFIX", "MSG_VOICECHAT_BLOCK_PL", szPlayerName, szAdminName, blocktimeinfo, blockreason);
                    }
                    case ALL_CHATS:
                    {
                        custom_color_chat(0, player, "%l %l", "MSG_PREFIX", "MSG_ALLCHATS_BLOCK_ALL", szAdminName, szPlayerName, blocktimeinfo, blockreason);
                        VTC_PlaySound(0, "../valve/sound/barney/youtalkmuch.wav");
                        custom_color_chat(player, 0, "%l %l", "MSG_PREFIX", "MSG_ALLCHATS_BLOCK_PL", szPlayerName, szAdminName, blocktimeinfo, blockreason);
                    }
                }
            }
 
Последнее редактирование:
Сообщения
491
Реакции
89
Помог
5 раз(а)
Murz, why u use VTC_PlaySound? Maybe:
Код:
VTC_PlaySound(0, "../valve/sound/barney/youtalkmuch.wav");
->
Код:
client_cmd(id, "spk barney/youtalkmuch");
:blush2:
 
Сообщения
491
Реакции
89
Помог
5 раз(а)
Murz, Oh, for all players? But, anyway i'm don't understand u, why do you need VTC_PlaySound
20 Фев 2020
Код:
client_cmd(id, "spk barney/youtalkmuch");
->
Код:
client_cmd(0, "spk barney/youtalkmuch");
 
  • Нравится
Реакции: Murz
Сообщения
1,420
Реакции
2,511
Помог
58 раз(а)
You can try:

Код:
for(new i = 1; i <= MaxClients; i++)
{
    if(is_user_connected(i))
        VTC_PlaySound(i, "sound/test.wav");
}
Or just rg_send_audio(0, "sound/test.wav");
 
Сообщения
1,420
Реакции
2,511
Помог
58 раз(а)
Murz, I don't think you need to write "valve/".
 
  • Нравится
Реакции: Murz
Статус
В этой теме нельзя размещать новые ответы.

Пользователи, просматривающие эту тему

Сейчас на форуме нет ни одного пользователя.
Сверху Снизу