hlmod.hu

Magyar Half-Life Mód közösség!
Pontos idő: 2024.05.06. 00:33



Jelenlévő felhasználók

Jelenleg 486 felhasználó van jelen :: 0 regisztrált, 0 rejtett és 486 vendég

A legtöbb felhasználó (1565 fő) 2020.11.21. 11:26-kor tartózkodott itt.

Regisztrált felhasználók: nincs regisztrált felhasználó az elmúlt 5 percben aktív felhasználók alapján

Utoljára aktív
Ahhoz hogy lásd ki volt utoljára aktív, be kell jelentkezned.



Az oldal teljeskörű
használatához regisztrálj.

Regisztráció

Kereső


Új téma nyitása  Hozzászólás a témához  [ 14 hozzászólás ]  Oldal 1 2 Következő
Szerző Üzenet
 Hozzászólás témája: roundsound
HozzászólásElküldve: 2012.09.25. 14:21 
Offline
Nagyúr
Avatar

Csatlakozott: 2010.11.21. 18:04
Hozzászólások: 557
Megköszönt másnak: 28 alkalommal
Megköszönték neki: 74 alkalommal
Kód:
Error: server failed to transmit file 'sound/ufk/ct1.mp3'
Error: server failed to transmit file 'sound/ufk/ct2.mp3'
Error: server failed to transmit file 'sound/ufk/ct3.mp3'
Error: server failed to transmit file 'sound/ufk/ct4.mp3'
Error: server failed to transmit file 'sound/ufk/ct5.mp3'
Error: server failed to transmit file 'sound/ufk/ct6.mp3'
Error: server failed to transmit file 'sound/ufk/ct7.mp3'
Error: server failed to transmit file 'sound/ufk/t1.mp3'
Error: server failed to transmit file 'sound/ufk/t2.mp3'
Error: server failed to transmit file 'sound/ufk/t3.mp3'
Error: server failed to transmit file 'sound/ufk/t4.mp3'
Error: server failed to transmit file 'sound/ufk/t5.mp3'
Error: server failed to transmit file 'sound/ufk/t6.mp3'
Error: server failed to transmit file 'sound/ufk/t7.mp3'


Ezt miért irja?:D

ini:

Kód:
; CT Sounds
"sound/ufk/ct1.mp3" "CT"
"sound/ufk/ct2.mp3" "CT"
"sound/ufk/ct3.mp3" "CT"
"sound/ufk/ct4.mp3" "CT"
"sound/ufk/ct5.mp3" "CT"
"sound/ufk/ct6.mp3" "CT"
"sound/ufk/ct7.mp3" "CT"


; T Sounds
"sound/ufk/t1.mp3" "T"
"sound/ufk/t2.mp3" "T"
"sound/ufk/t3.mp3" "T"
"sound/ufk/t4.mp3" "T"
"sound/ufk/t5.mp3" "T"
"sound/ufk/t6.mp3" "T"
"sound/ufk/t7.mp3" "T"


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


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: roundsound
HozzászólásElküldve: 2012.09.25. 14:23 
Offline
Senior Tag
Avatar

Csatlakozott: 2012.08.28. 20:09
Hozzászólások: 207
Megköszönt másnak: 17 alkalommal
Megköszönték neki: 10 alkalommal
Szttem nem megfelelően van megvágva..


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: roundsound
HozzászólásElküldve: 2012.09.25. 14:31 
Offline
Őskövület
Avatar

Csatlakozott: 2013.01.01. 17:48
Hozzászólások: 2441
Megköszönt másnak: 18 alkalommal
Megköszönték neki: 21 alkalommal
Fliter ne beszélj hülyeségeket.
Gondolom a host Sunwell. Írj a tulajnak ezügyben, nekem is ez volt a baj.


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: roundsound
HozzászólásElküldve: 2012.09.25. 15:18 
Offline
Őskövület
Avatar

Csatlakozott: 2011.09.17. 17:54
Hozzászólások: 2350
Megköszönt másnak: 40 alkalommal
Megköszönték neki: 57 alkalommal
A szerver nem precacheli (tölteti) le a fájlokat a klienssel.


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: roundsound
HozzászólásElküldve: 2012.09.25. 17:46 
Offline
Beavatott

Csatlakozott: 2012.08.03. 08:24
Hozzászólások: 79
Megköszönt másnak: 6 alkalommal
extra_precacher.amxx +zip fájl tartalma.


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: roundsound
HozzászólásElküldve: 2012.09.25. 21:14 
Offline
Őskövület
Avatar

Csatlakozott: 2011.09.26. 20:33
Hozzászólások: 2105
Megköszönt másnak: 28 alkalommal
Megköszönték neki: 33 alkalommal
nem, fliternek igaza volt, akkor nem precacheli ha a hang nem megfelelő


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: roundsound
HozzászólásElküldve: 2012.09.25. 22:20 
Offline
Nagyúr
Avatar

Csatlakozott: 2010.11.21. 18:04
Hozzászólások: 557
Megköszönt másnak: 28 alkalommal
Megköszönték neki: 74 alkalommal
Beraktam másikokat ezt irja:

Kód:
Invalid file type...skipping download of sound/ukf.team/1.mp3
Invalid file type...skipping download of sound/ukf.team/2.mp3
Invalid file type...skipping download of sound/ukf.team/3.mp3
Invalid file type...skipping download of sound/ukf.team/4.mp3
Invalid file type...skipping download of sound/ukf.team/5.mp3
Invalid file type...skipping download of sound/ukf.team/6.mp3
Invalid file type...skipping download of sound/ukf.team/7.mp3
Invalid file type...skipping download of sound/ukf.team/8.mp3
Invalid file type...skipping download of sound/ukf.team/9.mp3
Invalid file type...skipping download of sound/ukf.team/10.mp3
Invalid file type...skipping download of sound/ukf.team/11.mp3


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: roundsound
HozzászólásElküldve: 2012.09.26. 08:45 
Offline
Minden6ó
Avatar

Csatlakozott: 2011.01.19. 12:14
Hozzászólások: 4280
Megköszönt másnak: 218 alkalommal
Megköszönték neki: 285 alkalommal
Alap zenéket le játszota?

_________________
<<eb@>>Team Website - Közösség
17Buddies - Általam készített pályák.
GameBanana - Általam készített pályák/vágott hangok.

Kép
Kép


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: roundsound
HozzászólásElküldve: 2012.09.26. 22:19 
Offline
Nagyúr
Avatar

Csatlakozott: 2010.11.21. 18:04
Hozzászólások: 557
Megköszönt másnak: 28 alkalommal
Megköszönték neki: 74 alkalommal
ja


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: roundsound
HozzászólásElküldve: 2012.09.27. 06:46 
Offline
Minden6ó
Avatar

Csatlakozott: 2011.01.19. 12:14
Hozzászólások: 4280
Megköszönt másnak: 218 alkalommal
Megköszönték neki: 285 alkalommal
Akkor rosszul van kivágva és szerintem az a baj hogy tul hangos legtöbbször ez a baj.

_________________
<<eb@>>Team Website - Közösség
17Buddies - Általam készített pályák.
GameBanana - Általam készített pályák/vágott hangok.

Kép
Kép


Hozzászólás jelentése
Vissza a tetejére
   
Hozzászólások megjelenítése:  Rendezés  
Új téma nyitása  Hozzászólás a témához  [ 14 hozzászólás ]  Oldal 1 2 Következő


Ki van itt

Jelenlévő fórumozók: nincs regisztrált felhasználó valamint 39 vendég


Nyithatsz új témákat ebben a fórumban.
Válaszolhatsz egy témára ebben a fórumban.
Nem szerkesztheted a hozzászólásaidat ebben a fórumban.
Nem törölheted a hozzászólásaidat ebben a fórumban.
Nem küldhetsz csatolmányokat ebben a fórumban.

Keresés:
Ugrás:  
Powered by phpBB® Forum Software © phpBB Limited
Magyar fordítás © Magyar phpBB Közösség
Portal: Kiss Portal Extension © Michael O'Toole