hlmod.hu
https://hlmod.hu/

Miért nem megy mindenik körvégi zeném?
https://hlmod.hu/viewtopic.php?f=9&t=18914
Oldal: 1 / 1

Szerző:  protoN [2015.01.11. 11:26 ]
Hozzászólás témája:  Miért nem megy mindenik körvégi zeném?

Valamiért csak 3 körvégi zenét játszik le a plugin, van, hogy semmit, van, hogy a szokásos "Terrosists win" szöveget nyomja.

A zenék: http://jeges.bugs3.com/cstrike/sound/jegesmedve/

A roundsound.ini:
Kód:
; CT Sounds
"sound/jegesmedve/ct1.mp3" "CT"
"sound/jegesmedve/ct2.mp3" "CT"
"sound/jegesmedve/ct3.mp3" "CT"
"sound/jegesmedve/ct4.mp3" "CT"

; T Sounds
"sound/jegesmedve/te1.mp3" "T"
"sound/jegesmedve/te2.mp3" "T"
"sound/jegesmedve/te3.mp3" "T"
"sound/jegesmedve/te4.mp3" "T"


A plugin sma-ja:
SMA Forráskód: [ Mindet kijelol ]
  1.  
  2. /* - - - - - - - - - - -
  3.  
  4.   AMX Mod X script.
  5.   Copyright (C) 2007 - Arkshine
  6.  
  7.   Plugin : 'Alternative End Round Sounds'
  8.   Version : v2.3b
  9.  
  10.   Original idea and plugin by PaintLancer.
  11.  
  12.   This program is free software; you can redistribute it and/or modify it
  13.   under the terms of the GNU General Public License as published by the
  14.   Free Software Foundation; either version 2 of the License, or (at
  15.   your option) any later version.
  16.  
  17.   This program is distributed in the hope that it will be useful, but
  18.   WITHOUT ANY WARRANTY; without even the implied warranty of
  19.   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  20.   General Public License for more details.
  21.  
  22.   You should have received a copy of the GNU General Public License
  23.   along with this program; if not, write to the Free Software Foundation,
  24.   Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  25.  
  26.   In addition, as a special exception, the author gives permission to
  27.   link the code of this program with the Half-Life Game Engine ("HL
  28.   Engine") and Modified Game Libraries ("MODs") developed by Valve,
  29.   L.L.C ("Valve"). You must obey the GNU General Public License in all
  30.   respects for all of the code used other than the HL Engine and MODs
  31.   from Valve. If you modify this file, you may extend this exception
  32.   to your version of the file, but you are not obligated to do so. If
  33.   you do not wish to do so, delete this exception statement from your
  34.   version.
  35.  
  36.   ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
  37.  
  38.   Description :
  39.   - - - - - - -
  40.   Plays random music at the end of a round according to who wins,
  41.   instead of just "Terrorists Win" or "Counter-Terrorists Win".
  42.  
  43.  
  44.   Features :
  45.   - - - - - -
  46.   * Support for mp3 and wav files
  47.   * Using a file for the sounds
  48.   * Per-map config files supported
  49.   * Per-map prefix config files supported
  50.   * Sounds can be toggle on/off by players
  51.   * Ability to choice x sounds to be precache per map
  52.   * Multilingual support
  53.  
  54.  
  55.   Requirements :
  56.   - - - - - - - -
  57.   * CS 1.6 / CZ
  58.   * AMX/X 1.7x or higher
  59.  
  60.  
  61.   Cvars :
  62.   - - - -
  63.   * ers_enabled <iNum
  64.  
  65.   <0|1> Disable/Enable this plugin.
  66.   (default: 1)
  67.  
  68.  
  69.   * ers_player_toggle <iNum>
  70.  
  71.   <0|1> Disable/Enable the client command /roundsound
  72.   (default: 1)
  73.  
  74.  
  75.   * erc_time_ads <iTime>
  76.  
  77.   Times in seconds between each ads messages. 0 disable ads.
  78.   (default: 120)
  79.  
  80.  
  81.   * erc_random_precache <iMaxTeam or iMax_T-iMax_CT>
  82.  
  83.   Specify how many sounds by team you want to precache randomly among all sounds.
  84.   This means that x sounds will be choosen randomly among all sounds of each team so to be precache at each map. ( 0 = disable feature )
  85.  
  86.   e.g : erc_random_precache "2" : 2 sounds will be choosen among all CTs sounds and all Ts sounds
  87.   erc_random_precache "2-3" : 2 Ts sounds will be choosen randomly among all Ts sounds.
  88.   3 CT sound will be choosen randomly among all CTs sounds.
  89.   /!\ Don't forget to insert '-' .
  90.  
  91.   /!\ Map change on cvar change required !
  92.  
  93.  
  94.   Client command :
  95.   - - - - - - - -
  96.   * say /roundsound : Give to players the ability to turn on/off the end round sounds
  97.  
  98.  
  99.   Changelog :
  100.   - - - - - -
  101.  
  102.   -> Arksine :
  103.  
  104.   v3.0 - [ 2007-xx-xx ] ( Major update )
  105.  
  106.   - Soon. A lot of changes/new features. Huge update. <!-- s;) --><img src=\"{SMILIES_PATH}/icon_e_wink.gif\" alt=\";)\" title=\"kacsintás\" /><!-- s;) -->
  107.  
  108.   v2.3b - [ 2007-11-22 ]
  109.  
  110.   (!) Fixed a compatibility bug from 2.3a version.
  111.  
  112.   v2.3a - [ 2007-11-19 ]
  113.  
  114.   (+) Added compatibility for Amxx 1.7x.
  115.   (!) Now 'erc_random_precache' cvar is set to 0 by default.
  116.   (!) Fixed. At the first start of server, value from 'erc_random_precache' cvar from a config file was not read.
  117.   (!) Some others minors changes.
  118.  
  119.   v2.3 - [ 2007-10-29 ]
  120.  
  121.   (+) Added 'erc_random_precache' cvar : Specify how many sounds per team you want to precache randomly among all sounds.
  122.   This means that x sounds will be choosen randomly among all sounds of each team so to be precache at each map. ( request by Arion )
  123.   (!) Debug mode is enabled by default now.
  124.   (-) Removed 3 keys languages. No more need.( ERS_LOG_TOTAL_SOUND_LOADED, ERS_LOG_DEBUG_T, ERS_LOG_DEBUG_CT )
  125.  
  126.   v2.2b - [ 2007-10-28 ]
  127.  
  128.   (!) Removed a check. Since trim() is used :
  129.   Now no need to check space, new line, tabs, carriage returns, etc..
  130.  
  131.   v2.2a - [ 2007-10-28 ]
  132.  
  133.   (!) Changed the method of checking empty file. Now it's more efficient.
  134.   (!) Added another check to ignore texts which are no comments.
  135.   (!) Fixed a typo ( key language ).
  136.  
  137.   v2.2 - [ 2007-10-27 ]
  138.  
  139.   (+) Added a check to prevent to get a warning when a team has no sound.
  140.   (+) Added a check to prevent to not load empty file.
  141.   (+) Added support for coding-style '//' comments.
  142.   (!) No longer has a predefined max sounds limit. ( using dynamic array from amxx 1.8.0 )
  143.   (!) Minors optimizations.
  144.   (-) Removed useless code.
  145.  
  146.   v2.1a - [ 2007-07-13 ]
  147.  
  148.   (!) Fixed a bug with ML system.
  149.   (!) Fixed a stupid glitch with formatex().
  150.  
  151.   v2.1 - [ 2007-07-06 ]
  152.  
  153.   (!) Optimize a little.
  154.   (!) Rewritted loading_file() function.
  155.   (+) Added ML system & some texts.
  156.   (+) Added Color in text. ( !g = green ; !t = team color; !n = yellow (normal) )
  157.   (+) Added #_DEBUG.
  158.   (+) Added chat command : toggle on/off end round sounds.
  159.   (+) Added "ers_enabled" cvar : enable/disable plugin
  160.   (+) Added "ers_player_toggle" cvar : enable/disabled command chat for players
  161.   (+) Added ads message for chat command
  162.   (+) Added "erc_time_ads" cvar : control amount of times between 2 messages.
  163.  
  164.   v2.0b - [ 2007-07-04 ]
  165.  
  166.   (!) No features added. Sma reorganized a little and more.
  167.  
  168.   v2.0a - [ 2007-06-26 ]
  169.  
  170.   (!) Fixed. Bug under linux. Some blank lines weren't ignored. (thanks Deejay & NiLuje)
  171.  
  172.   v2.0 - [ 2007-06-26 ]
  173.  
  174.   (!) Totaly rewritted
  175.   (+) Added support for mp3 files.
  176.   (+) Added support per file. No more to edit .sma file to add sounds.
  177.   (+) Added support per-map file.
  178.   (+) Added support per-map prefix file.
  179.  
  180.   -> Paintlancer :
  181.  
  182.   v1.0 : [ 2004-10-14 ]
  183.   First release by Paintlancer.
  184.  
  185.   Credits:
  186.   - - - - - - -
  187.   * PaintLancer : Original idea and plugin.
  188.   * Avalanche : Inspired color chat function from gungame plugin.
  189.   * Arion : Random precache idea.
  190.  
  191.   * Languages translation :
  192.   - [fr] : Arkshine
  193.   - [de] : Mordekay
  194.   - [es] : Darkless
  195.  
  196.  
  197.   - - - - - - - - - - - */
  198.  
  199. #include <amxmodx>
  200. #include <amxmisc>
  201.  
  202.  
  203. new const
  204. // _________________________________________________
  205.  
  206. PLUGIN [] = "Alternative End Round Sounds",
  207. VERSION[] = "2.3b",
  208. AUTHOR [] = "Arkshine";
  209. // _________________________________________________
  210.  
  211.  
  212. #if AMXX_VERSION_NUM < 180
  213. #define old_amxx
  214. #endif
  215.  
  216.  
  217. /* ========================= [ "START" AERA FOR CHANGES ] ========================= */
  218.  
  219.  
  220. #define _DEBUG // Active debug
  221. #define MAX_FILE_LENGTH 196 // Max length for files + path.
  222.  
  223. #if defined old_amxx
  224. #define MAX_SOUNDS 25 // Max sounds per team
  225. #endif
  226.  
  227. new const
  228.  
  229. g_FileName[] = "roundsound", // Name of the main file if no files is found in 'g_FileFolder'.
  230. g_FileFolder[] = "round_sound", // Name of the directory in amxmodx/configs/ for per-map files.
  231. g_FilePrefix[] = "ini", // File extension used for the files.
  232. g_CmdChat[] = "/roundsound"; // Chat command for player.
  233.  
  234.  
  235. /* ========================= [ "END" AERA FOR CHANGES ] ========================= */
  236.  
  237.  
  238.  
  239. // - - - - - - - - - - - - - - - - - - - - - - -
  240.  
  241. #define MAX_PLAYERS 32
  242. #define TASKID_ADS 1333
  243. #define SIZE_FILE 0
  244. #define NULL -1
  245.  
  246. new
  247. bool:g_pHeardSound[ MAX_PLAYERS + 1 ],
  248.  
  249. #if !defined old_amxx
  250. Array:g_lstSoundCT,
  251. Array:g_lstSoundT,
  252. #endif
  253.  
  254. p_enabled,
  255. p_player_toggle,
  256. p_time_ads,
  257. p_random_precache,
  258.  
  259. g_sRp_value[12],
  260. g_msgSayText;
  261.  
  262.  
  263. enum _:e_Team
  264. {
  265. T = 0,
  266. CT,
  267. };
  268.  
  269. new g_nSnd[ e_Team ];
  270.  
  271. #if defined old_amxx
  272. new g_sTeam_sounds[ MAX_SOUNDS ][ e_Team ][ MAX_FILE_LENGTH ];
  273. #define charsmax(%1) sizeof( %1 ) - 1
  274. #endif
  275.  
  276. #define _is_wav(%1) equali( %1[strlen( %1 ) - 4 ], ".wav" )
  277.  
  278. // - - - - - - - - - - - - - - - - - - - - - - -
  279.  
  280.  
  281. public plugin_precache()
  282. {
  283. register_dictionary( "end_roundsound.txt" );
  284.  
  285. if( ( p_random_precache = get_cvar_pointer( "erc_random_precache" ) ) )
  286. get_pcvar_string( p_random_precache, g_sRp_value, charsmax( g_sRp_value ) );
  287.  
  288. if( !p_random_precache )
  289. return;
  290.  
  291. #if !defined old_amxx
  292. g_lstSoundCT = ArrayCreate( MAX_FILE_LENGTH );
  293. g_lstSoundT = ArrayCreate( MAX_FILE_LENGTH );
  294. #endif
  295.  
  296. loading_file();
  297. }
  298.  
  299.  
  300. public plugin_init()
  301. {
  302. register_plugin( PLUGIN, VERSION, AUTHOR );
  303. register_cvar( "ers_version", VERSION, FCVAR_SERVER | FCVAR_SPONLY );
  304.  
  305. register_event( "SendAudio", "eT_win" , "a", "2&%!MRAD_terwin" );
  306. register_event( "SendAudio", "eCT_win", "a", "2&%!MRAD_ctwin" );
  307.  
  308. p_enabled = register_cvar( "ers_enabled" , "1" );
  309. p_player_toggle = register_cvar( "ers_player_toggle" , "1" );
  310. p_time_ads = register_cvar( "erc_time_ads" , "120" );
  311.  
  312. if( !p_random_precache )
  313. {
  314. register_cvar( "erc_random_precache", g_sRp_value );
  315. server_cmd( "restart" );
  316. }
  317.  
  318. register_clcmd( "say" , "cmd_Say" );
  319. register_clcmd( "say_team" , "cmd_Say" );
  320.  
  321. g_msgSayText = get_user_msgid( "SayText" );
  322. }
  323.  
  324.  
  325. public client_authorized( id )
  326. g_pHeardSound[id] = true;
  327.  
  328.  
  329. public client_disconnect( id )
  330. {
  331. g_pHeardSound[id] = true;
  332. remove_task( id + TASKID_ADS );
  333. }
  334.  
  335.  
  336. public client_putinserver( id )
  337. {
  338. new Float:time = get_pcvar_float( p_time_ads );
  339.  
  340. if( !time )
  341. return;
  342.  
  343. remove_task( id + TASKID_ADS );
  344. set_task( time, "show_ads", id + TASKID_ADS, _, _, "b" );
  345. }
  346.  
  347.  
  348. public show_ads( taskid )
  349. {
  350. new id = taskid - TASKID_ADS;
  351. ShowPrint( id, "%L", id, "ERS_DISPLAY_ADS", g_CmdChat );
  352. }
  353.  
  354.  
  355. public cmd_Say( id )
  356. {
  357. if( !get_pcvar_num( p_enabled ) )
  358. return PLUGIN_CONTINUE;
  359.  
  360. static sMsg[64];
  361. read_argv( 1, sMsg, charsmax( sMsg ) );
  362.  
  363. if( equali( sMsg, g_CmdChat ) )
  364. {
  365. if( !get_pcvar_num( p_player_toggle ) )
  366. {
  367. ShowPrint( id, "%L", id, "ERS_CMD_DISABLED" );
  368. return PLUGIN_HANDLED;
  369. }
  370.  
  371. g_pHeardSound[id] = g_pHeardSound[id] ? false : true;
  372. ShowPrint( id, "%L", id, g_pHeardSound[id] ? "ERS_SOUND_ENABLED" : "ERS_SOUND_DISABLED" );
  373.  
  374. return PLUGIN_HANDLED;
  375. }
  376.  
  377. return PLUGIN_CONTINUE;
  378. }
  379.  
  380.  
  381. public eT_win()
  382. {
  383. if( !g_nSnd[ e_Team:T ] )
  384. return;
  385.  
  386. play_sound( e_Team:T );
  387. }
  388.  
  389.  
  390. public eCT_win()
  391. {
  392. if( !g_nSnd[ e_Team:CT ] )
  393. return;
  394.  
  395. play_sound( e_Team:CT );
  396. }
  397.  
  398.  
  399. play_sound( iTeam )
  400. {
  401. static
  402. // - - - - - - - - - - - - - - - -
  403. sCurSnd[ MAX_FILE_LENGTH ];
  404. // - - - - - - - - - - - - - - - -
  405.  
  406. new iRand;
  407.  
  408. if( g_nSnd[ iTeam ] > 1 )
  409. iRand = random( g_nSnd[ iTeam ] );
  410.  
  411. #if defined old_amxx
  412. copy( sCurSnd, MAX_FILE_LENGTH - 1, g_sTeam_sounds[ iRand ][ iTeam ] );
  413. #else
  414. ArrayGetString( iTeam == CT ? g_lstSoundCT : g_lstSoundT, iRand, sCurSnd, MAX_FILE_LENGTH - 1 );
  415. #endif
  416.  
  417. _is_wav( sCurSnd ) ?
  418.  
  419. format( sCurSnd, MAX_FILE_LENGTH - 1, "spk %s", sCurSnd[6] ) :
  420. format( sCurSnd, MAX_FILE_LENGTH - 1, "mp3 play %s", sCurSnd );
  421.  
  422. if( get_pcvar_num( p_player_toggle ) )
  423. {
  424. static
  425. // - - - - - - - - - - -
  426. iPlayers[32],
  427. iNum, pid;
  428. // - - - - - - - - - - -
  429.  
  430. get_players( iPlayers, iNum, "c" );
  431.  
  432. for( new i; i < iNum; i++ )
  433. {
  434. pid = iPlayers[i];
  435.  
  436. if( !g_pHeardSound[pid] || is_user_bot( pid ) )
  437. continue;
  438.  
  439. client_cmd( pid, "%s", sCurSnd );
  440. }
  441. }
  442. else
  443. client_cmd( 0, "%s", sCurSnd );
  444. }
  445.  
  446.  
  447. get_prefix( sMap[], iLen_map, sMapType[], iLen_type )
  448. {
  449. new
  450. // - - - - - - - - -
  451. sRest[32];
  452. // - - - - - - - - -
  453.  
  454. get_mapname( sMap, iLen_map );
  455. strtok( sMap, sMapType, iLen_type, sRest, charsmax( sRest ), '_', 1 );
  456. }
  457.  
  458.  
  459. loading_file()
  460. {
  461. static
  462. // - - - - - - - - - - - - - - - - -
  463. sPath[ MAX_FILE_LENGTH ],
  464. // |
  465. sConfigsDir[64],
  466. sPrefix[6],
  467. sMap[32];
  468. // - - - - - - - - - - - - - - - - -
  469.  
  470. get_prefix( sMap, charsmax( sMap ), sPrefix, charsmax( sPrefix ) );
  471. get_configsdir( sConfigsDir, charsmax( sConfigsDir ) );
  472.  
  473.  
  474. new bool:bFound;
  475.  
  476. for( new i = 1; i <= 3; i++ )
  477. {
  478. switch( i )
  479. {
  480. case 1 : formatex( sPath, charsmax( sPath ), "%s/%s/prefix-%s.%s", sConfigsDir, g_FileFolder, sPrefix, g_FilePrefix );
  481. case 2 : formatex( sPath, charsmax( sPath ), "%s/%s/%s.%s", sConfigsDir, g_FileFolder, sMap, g_FilePrefix );
  482. case 3 : formatex( sPath, charsmax( sPath ), "%s/%s.%s", sConfigsDir, g_FileName, g_FilePrefix );
  483.  
  484. default : break;
  485. }
  486.  
  487. if( !CheckFile( sPath ) )
  488. continue;
  489.  
  490. bFound = true;
  491. break;
  492. }
  493.  
  494. log_amx( "---" );
  495.  
  496. bFound ?
  497. log_amx( "%L", LANG_SERVER, "ERS_LOG_LOADING", sPath ) :
  498. log_amx( "%L", LANG_SERVER, "ERS_LOG_NO_FILES_FOUND" );
  499.  
  500. load_sound( sPath );
  501. }
  502.  
  503.  
  504. load_sound( const file[] )
  505. {
  506. new
  507. // - - - - - - - - - - - - - - -
  508. sBuffer[256],
  509. // |
  510. sLeft[ MAX_FILE_LENGTH ],
  511. sRight[4],
  512. sExt[6],
  513. // |
  514. eTeam;
  515. // - - - - - - - - - - - - - - -
  516.  
  517. new fp = fopen( file, "rt" );
  518.  
  519. while( !feof( fp ) )
  520. {
  521. fgets( fp, sBuffer, charsmax( sBuffer ) );
  522.  
  523. trim( sBuffer );
  524.  
  525. if( !sBuffer[0] || sBuffer[0] == ';' || ( sBuffer[0] == '/' && sBuffer[1] == '/' ) )
  526. continue;
  527.  
  528. if( sBuffer[0] != '"' || strlen( sBuffer ) < 11 )
  529. continue;
  530.  
  531. parse( sBuffer, sLeft, charsmax( sLeft ), sRight, charsmax( sRight ) );
  532. formatex( sExt, charsmax( sExt ), sLeft[ strlen( sLeft ) - 4 ] );
  533.  
  534. if( equali( sExt, ".mp3" ) == -1 || equali( sExt, ".wav" ) == -1 )
  535. {
  536. log_amx( "%L", LANG_SERVER, "ERS_LOG_UNKNOW_EXTENSION", sExt );
  537. continue;
  538. }
  539.  
  540. if( !file_exists( sLeft ) )
  541. {
  542. log_amx( "%L", LANG_SERVER, "ERS_LOG_INEXISTENT_FILE", sLeft );
  543. continue;
  544. }
  545.  
  546. eTeam = NULL;
  547.  
  548. if( equali( sRight, "CT" ) )
  549. eTeam = CT;
  550.  
  551. else if( equali( sRight, "T" ) )
  552. eTeam = T;
  553.  
  554. if( eTeam == NULL )
  555. {
  556. log_amx( "%L", LANG_SERVER, "ERS_LOG_NO_TEAM_SOUND", sLeft );
  557. continue;
  558. }
  559.  
  560. #if defined old_amxx
  561. copy( g_sTeam_sounds[ g_nSnd[ eTeam ] ][ eTeam ], MAX_FILE_LENGTH - 1, sLeft );
  562. #else
  563. ArrayPushString( eTeam == CT ? g_lstSoundCT : g_lstSoundT, sLeft );
  564. #endif
  565.  
  566. ++g_nSnd[ eTeam ];
  567. }
  568. fclose( fp );
  569.  
  570. if( g_nSnd[ e_Team:T ] > 1 || g_nSnd[ e_Team:CT ] > 1 )
  571. {
  572. new iMax_t, iMax_ct;
  573. GetPrecacheValue( iMax_t, iMax_ct );
  574.  
  575. #if defined old_amxx
  576. UpdateArray( iMax_t, e_Team:T );
  577. UpdateArray( iMax_ct, e_Team:CT );
  578. #else
  579. p_DeleteRandomItem( iMax_t , e_Team:T , g_lstSoundT );
  580. p_DeleteRandomItem( iMax_ct, e_Team:CT, g_lstSoundCT );
  581. #endif
  582. }
  583.  
  584. log_amx( "---" );
  585.  
  586. #if defined _DEBUG
  587. log_amx( "[ Loading %d CTs Sounds ]", g_nSnd[ e_team:CT ] );
  588. #endif
  589. #if defined old_amxx
  590. PrecacheSounds( e_Team:CT );
  591. #else
  592. PrecacheSounds_n( g_lstSoundCT );
  593. #endif
  594.  
  595. #if defined _DEBUG
  596. log_amx( "[ Loading %d Ts Sounds ]", g_nSnd[ e_team:T ] );
  597. #endif
  598. #if defined old_amxx
  599. PrecacheSounds( e_Team:T );
  600. #else
  601. PrecacheSounds_n( g_lstSoundT );
  602. #endif
  603. }
  604.  
  605.  
  606. GetPrecacheValue( &iMax_t, &iMax_ct )
  607. {
  608. trim( g_sRp_value );
  609. new pos = contain( g_sRp_value, "-" );
  610.  
  611. if( pos > 0 )
  612. {
  613. iMax_ct = str_to_num( g_sRp_value[ pos + 1 ] )
  614. g_sRp_value[ pos ] = '^0';
  615. iMax_t = str_to_num( g_sRp_value );
  616. }
  617. else
  618. {
  619. iMax_t = str_to_num( g_sRp_value );
  620. iMax_ct = iMax_t;
  621. }
  622. }
  623.  
  624.  
  625. stock UpdateArray( iMax, iTeam )
  626. {
  627. new const iCnt_sound = g_nSnd[ iTeam ];
  628.  
  629. if( !iMax || iMax == iCnt_sound )
  630. return;
  631.  
  632. if( iMax >= iCnt_sound )
  633. iMax = iCnt_sound - 1;
  634.  
  635. static
  636. sTmp_sounds[ MAX_SOUNDS ][ e_Team ][ MAX_FILE_LENGTH ],
  637. iLast_number[ MAX_SOUNDS ];
  638.  
  639. new i, iRand;
  640. for( i = 0; i < iCnt_sound; i++ )
  641. {
  642. copy( sTmp_sounds[i][ iTeam ], MAX_FILE_LENGTH - 1, g_sTeam_sounds[i][ iTeam ] );
  643. g_sTeam_sounds[i][ iTeam ][0] = '^0';
  644. }
  645.  
  646. arrayset( iLast_number, 0, charsmax( iLast_number ) );
  647.  
  648. i = 0;
  649. while( i != iMax )
  650. {
  651. check:
  652. iRand = random( iCnt_sound );
  653.  
  654. if( iLast_number[ iRand ] )
  655. goto check;
  656.  
  657. copy( g_sTeam_sounds[i][ iTeam ], MAX_FILE_LENGTH - 1, sTmp_sounds[ iRand ][ iTeam ] );
  658. ++i;
  659.  
  660. iLast_number[ iRand ] = 1;
  661. }
  662.  
  663. g_nSnd[ iTeam ] = iMax;
  664. }
  665.  
  666.  
  667. stock p_DeleteRandomItem( iMax, iTeam, Array:sSound_a )
  668. {
  669. new const iCnt_sound = g_nSnd[ iTeam ];
  670.  
  671. if( !iMax || iMax == iCnt_sound )
  672. return;
  673.  
  674. if( iMax >= iCnt_sound )
  675. iMax = iCnt_sound - 1;
  676.  
  677. DeleteRandomItem( iCnt_sound - iMax, sSound_a );
  678. g_nSnd[ iTeam ] = iMax;
  679. }
  680.  
  681.  
  682. stock DeleteRandomItem( iRandom_n, Array:sSound_a )
  683. {
  684. new i;
  685.  
  686. while( i++ != iRandom_n )
  687. ArrayDeleteItem( sSound_a, random( ArraySize( sSound_a ) ) );
  688. }
  689.  
  690.  
  691. stock PrecacheSounds( iTeam )
  692. {
  693. for( new i; i < g_nSnd[ iTeam ]; i++ )
  694. {
  695. PrecacheFile( g_sTeam_sounds[i][ iTeam ] );
  696.  
  697. #if defined _DEBUG
  698. log_amx( " - %s", g_sTeam_sounds[i][ iTeam ] );
  699. #endif
  700. }
  701.  
  702. log_amx( "---" );
  703. }
  704.  
  705.  
  706. stock PrecacheSounds_n( Array:sSound_a )
  707. {
  708. static
  709. // - - - - - - - - - - - - - - - - - - -
  710. sFile[ MAX_FILE_LENGTH ],
  711. iFileLen = charsmax( sFile );
  712. // - - - - - - - - - - - - - - - - - - -
  713.  
  714. for( new i; i < ArraySize( sSound_a ); i++ )
  715. {
  716. ArrayGetString( sSound_a, i, sFile, iFileLen );
  717. PrecacheFile( sFile );
  718.  
  719. #if defined _DEBUG
  720. log_amx( " - %s", sFile );
  721. #endif
  722. }
  723.  
  724. log_amx( "---" );
  725. }
  726.  
  727.  
  728. PrecacheFile( const sound[] )
  729. {
  730. _is_wav( sound ) ?
  731.  
  732. precache_sound( sound[6] ) :
  733. precache_generic( sound );
  734. }
  735.  
  736.  
  737. ShowPrint( id, const sMsg[], { Float, Sql, Result, _ }:... )
  738. {
  739. static
  740. // - - - - - - - - -
  741. newMsg[191],
  742. message[191],
  743. // |
  744. tNewMsg;
  745. // - - - - - - - - -
  746.  
  747. tNewMsg = charsmax( newMsg );
  748. vformat( newMsg, tNewMsg, sMsg, 3 );
  749.  
  750. replace_all( newMsg, tNewMsg, "!t", "^3" );
  751. replace_all( newMsg, tNewMsg, "!g", "^4" );
  752. replace_all( newMsg, tNewMsg, "!n", "^1" );
  753.  
  754. formatex( message, charsmax( message ), "^4[ERS]^1 %s", newMsg );
  755.  
  756. emessage_begin( MSG_ONE, g_msgSayText, _, id );
  757. ewrite_byte( id );
  758. ewrite_string( message );
  759. emessage_end();
  760. }
  761.  
  762.  
  763. bool:CheckFile( const file[] )
  764. {
  765. new
  766. // - - - - - - - - - - - - - - - - -
  767. sBuffer[256],
  768. fp = fopen( file, "rt" );
  769. // - - - - - - - - - - - - - - - - -
  770.  
  771. if( !fp )
  772. return false;
  773.  
  774. while( !feof( fp ) )
  775. {
  776. fgets( fp, sBuffer, charsmax( sBuffer ) );
  777.  
  778. trim( sBuffer );
  779.  
  780. if( !sBuffer[0] || sBuffer[0] == ';' || ( sBuffer[0] == '/' && sBuffer[1] == '/' ) || sBuffer[0] != '"' )
  781. continue;
  782.  
  783. if( ( contain( sBuffer, ".mp3^"" ) != -1 || contain( sBuffer, ".wav^"" ) != -1 ) && ( contain( sBuffer, "^"T^"" ) != -1 || contain( sBuffer, "^"CT^"" ) != -1 ) )
  784. return true;
  785. }
  786. fclose( fp );
  787.  
  788. return false;
  789. }
  790. /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
  791.   *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1038\\ f0\\ fs16 \n\\ par }
  792.   */
  793.  


A plugin: http://hlmod.hu/viewtopic.php?f=101&t=12542

Csak 3 zenét játsz le, azokat is csak elvétve 5-6 kör után. Valakinek ötlete? :(

Szerző:  Fantom [2015.01.11. 11:27 ]
Hozzászólás témája:  Re: Miért nem megy mindenik körvégi zeném?

Counter-Strike 1.6 Hangfájlok

Ez alapján konvertáld a zenéket !

Szerző:  V!rusHD [2015.01.11. 11:44 ]
Hozzászólás témája:  Re: Miért nem megy mindenik körvégi zeném?

Nekem is ezzel van bajom, nemtudom miértnem mennek pedig mindent jól csináltam itt vannak a zenék nézzétek meg:
http://data.hu/get/8386823/te9.mp3
http://data.hu/get/8386825/te4.mp3
http://data.hu/get/8386826/te5.mp3
http://data.hu/get/8386828/te3.mp3
http://data.hu/get/8386829/te6.mp3
http://data.hu/get/8386831/te8.mp3
http://data.hu/get/8386832/te7.mp3
http://data.hu/get/8386833/ct9.mp3
http://data.hu/get/8386834/te2.mp3
http://data.hu/get/8386836/te10.mp3
http://data.hu/get/8386837/ct7.mp3
http://data.hu/get/8386839/te1.mp3
http://data.hu/get/8386840/ct8.mp3
http://data.hu/get/8386842/ct5.mp3
http://data.hu/get/8386843/ct4.mp3
http://data.hu/get/8386845/ct1.mp3
http://data.hu/get/8386846/ct2.mp3
http://data.hu/get/8386847/ct3.mp3
http://data.hu/get/8386849/ct6.mp3
http://data.hu/get/8386850/ct10.mp3
Már kivannak vágva.

Szerző:  protoN [2015.01.11. 12:20 ]
Hozzászólás témája:  Re: Miért nem megy mindenik körvégi zeném?

Fantom írta:
https://hlmod.hu/viewtopic.php?f=14&t=1646

Ez alapján konvertáld a zenéket !


Átnéztem az összeset, volt ahol mono volt az mp3, abból stereot csináltam, bitrate és Hz klappol. De sajnos így sem megy. A T-knek egy zenét sem játszik be

Oldal: 1 / 1 Minden időpont UTC+02:00 időzóna szerinti
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/