Пользователь
- Сообщения
- 4
- Реакции
- 0
- Ошибка
-
не воспроизводит музыку при вступе в игру
- ОС
- Linux
- Билд
-
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
ReHLDS version: 3.3.0.631-dev
Build date: 11:13:38 Jan 18 2018 (1377)
Build from: https://github.com/dreamstalker/rehlds/commit/923c838
- ReGamedll
-
ReGameDLL version: 5.3.0.282-dev
Build date: 21:00:02 Jan 17 2018
Build from: https://github.com/s1lentq/ReGameDLL_CS/commit/38ff7ce
- Список метамодулей
-
Currently loaded plugins:
description stat pend file vers src load unload
[ 1] AMX Mod X RUN - amxmodx_mm_i386.so v1.8.3-Re ini Start ANY
[ 2] ReAPI RUN - reapi_amxx_i386.so v5.1.0.112-dev pl1 ANY Never
[ 3] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.8.3-Re pl1 ANY ANY
[ 4] CSX RUN - csx_amxx_i386.so v1.8.3-Re pl1 ANY ANY
4 plugins, 4 running
- Список плагинов
-
Currently loaded plugins:
name version author file status
[ 1] Admin Base 1.8.3-Re AMXX Dev Team admin.amxx running
[ 2] Admin Commands 1.8.3-Re AMXX Dev Team admincmd.amxx running
[ 3] Admin Help 1.8.3-Re AMXX Dev Team adminhelp.amxx running
[ 4] Slots Reservation 1.8.3-Re AMXX Dev Team adminslots.amxx running
[ 5] Multi-Lingual System 1.8.3-Re AMXX Dev Team multilingual.am running
[ 6] Menus Front-End 1.8.3-Re AMXX Dev Team menufront.amxx running
[ 7] Commands Menu 1.8.3-Re AMXX Dev Team cmdmenu.amxx running
[ 8] Players Menu 1.8.3-Re AMXX Dev Team plmenu.amxx running
[ 9] Maps Menu 1.8.3-Re AMXX Dev Team mapsmenu.amxx running
[ 10] Plugin Menu 1.8.3-Re AMXX Dev Team pluginmenu.amxx running
[ 11] Admin Chat 1.8.3-Re AMXX Dev Team adminchat.amxx running
[ 12] Anti Flood 1.8.3-Re AMXX Dev Team antiflood.amxx running
[ 13] Scrolling Message 1.8.3-Re AMXX Dev Team scrollmsg.amxx running
[ 14] Info. Messages 1.8.3-Re AMXX Dev Team imessage.amxx running
[ 15] Admin Votes 1.8.3-Re AMXX Dev Team adminvote.amxx running
[ 16] NextMap 1.8.3-Re AMXX Dev Team nextmap.amxx running
[ 17] Nextmap Chooser 1.8.3-Re AMXX Dev Team mapchooser.amxx running
[ 18] TimeLeft 1.8.3-Re AMXX Dev Team timeleft.amxx running
[ 19] Pause Plugins 1.8.3-Re AMXX Dev Team pausecfg.amxx running
[ 20] Stats Configuration 1.8.3-Re AMXX Dev Team statscfg.amxx running
[ 21] StatsX 1.8.3-Re AMXX Dev Team statsx.amxx running
[ 22] Connect Music 1.0 MakapoH. connect_music.a running
22 plugins, 22 running
- Исходный код
-
#define PLUGIN_NAME "Connect Music"
#define PLUGIN_VERSION "1.0"
#define PLUGIN_AUTHOR "MakapoH."
// IP сервера для привязки
new const valid_ip[] = "185.97.255.5:27005";
#include <amxmodx>
#include <reapi>
new Array:array_music, Array:array_seconds;
new cur_sound, sounds_num;
new bool:music_play;
public plugin_precache()
{
new file_data_handler = fopen("addons/amxmodx/data/connect_music.dat", "rt");
if(file_data_handler)
{
new cur_sound_data[4];
fgets(file_data_handler, cur_sound_data, charsmax(cur_sound_data));
trim(cur_sound_data);
cur_sound = str_to_num(cur_sound_data);
fclose(file_data_handler);
}
new file_handler = fopen("addons/amxmodx/configs/connect_music.ini", "rt");
if(!file_handler)
set_fail_state("File ^"connect_music.ini^" not found...");
array_music = ArrayCreate(256);
array_seconds = ArrayCreate(5);
new buffer[256], music[256], seconds[5];
while(!feof(file_handler))
{
fgets(file_handler, buffer, charsmax(buffer));
trim(buffer);
if(buffer[0] == EOS || buffer[0] == ';')
continue;
parse(buffer, music, charsmax(music), seconds, charsmax(seconds));
if(file_exists(fmt("sound/%s", music)))
{
precache_sound(music);
ArrayPushString(array_music, music);
ArrayPushCell(array_seconds, str_to_num(seconds));
}
else server_print("Sound ^"sound/%s^" not found...", music);
}
fclose(file_handler);
sounds_num = ArraySize(array_music) - 1;
if(cur_sound > sounds_num)
cur_sound = sounds_num;
}
public plugin_init()
register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);
public plugin_natives()
register_native("cm_music_play", "native_cm_music_play");
public plugin_cfg()
{
new server_ip[22];
get_user_ip(0, server_ip, charsmax(server_ip));
if(strcmp(server_ip, valid_ip))
set_fail_state("Вы не приобрели лицензию плагина.");
}
public client_putinserver(id)
{
new sound[256];
ArrayGetString(array_music, cur_sound, sound, charsmax(sound));
music_play = true;
if(containi(sound, ".wav") != -1)
rg_send_audio(id, sound);
else client_cmd(id, "mp3 play sound/%s", sound);
set_task(float(ArrayGetCell(array_seconds, cur_sound)), "Task_StopMusicPlay", 444);
cur_sound >= sounds_num ? (cur_sound = 0) : cur_sound++;
}
public Task_StopMusicPlay(taskid)
music_play = false;
public plugin_end()
{
new file_handler = fopen("addons/amxmodx/data/connect_music.dat", "w+");
if(file_handler)
unlink("addons/amxmodx/data/connect_music.dat");
fprintf(file_handler, "%d", cur_sound);
fclose(file_handler);
ArrayDestroy(array_music);
}
public native_cm_music_play()
return music_play;
при вступе в игру не проигрывается музыка, разве чо какие-то 1-2 мили сек и блокируется, в чем может быть проблема?