• Страница 1 из 1
  • 1
Нужен скриптер!!!!
Дата: Четверг, 28.06.2018, 14:37 | Сообщение # 1
Мастер
Offline
  • BogdanPP
  • Репутация: 4
  • Сообщений:125
  • Пользователь
  • Статус пользователя 193.124.185.131:27024
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright © 1997-2013 ITB CompuPhase, AMX Mod X Team
 
/hlds/web/www/amxxpc/bin/amxx-1.8.2/include/colorchat.inc(295) : warning 201: redefinition of constant/macro (symbol "DontChange")
/hlds/web/www/amxxpc/bin/amxx-1.8.2/include/colorchat.inc(298) : warning 201: redefinition of constant/macro (symbol "Grey")
/hlds/web/www/amxxpc/bin/amxx-1.8.2/include/colorchat.inc(299) : warning 201: redefinition of constant/macro (symbol "Red")
/hlds/web/www/amxxpc/bin/amxx-1.8.2/include/colorchat.inc(300) : warning 201: redefinition of constant/macro (symbol "Blue")
/hlds/web/www/amxxpc/bin/amxx-1.8.2/include/colorchat.inc(321) : error 040: duplicate "case" label (value 2)
/hlds/web/www/amxxpc/work/scripting/round_sound.sma(67) : warning 213: tag mismatch
/hlds/web/www/amxxpc/work/scripting/round_sound.sma(73) : warning 213: tag mismatch
/hlds/web/www/amxxpc/work/scripting/round_sound.sma(78) : warning 213: tag mismatch
/hlds/web/www/amxxpc/work/scripting/round_sound.sma(144) : warning 213: tag mismatch
 
1 Error.
Could not locate output file /hlds/web/www/amxxpc/work/plugins/round_sound.amx (compile failed).

Добавлено (28.06.2018, 14:33)
---------------------------------------------
Вот сам файл

Добавлено (28.06.2018, 14:34)
---------------------------------------------
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <colorchat>
#include <hamsandwich>
#define PLUGIN " [RS]Round Sound"
#define VERSION "1.0S"
#define AUTHOR "VCL"
#pragma semicolon 1
new Array:g_aTrackNames;
new Array:g_aTrackPaths;
new pMenuStyle = 0;
public plugin_init() 
{

register_plugin(PLUGIN, VERSION, AUTHOR);
register_logevent("leRoundEnd",2,"1=Round_End");
register_dictionary("round_sound.txt");
pMenuStyle = register_cvar("rs_menu_style","1");
register_clcmd("say /music","Show_SoundMenu");
register_clcmd("say_team /music","Show_SoundMenu");
register_menucmd(register_menuid("Show_SoundMenu"), (1<<0|1<<1|1<<2|1<<9), "Handle_SoundMenu");
RegisterHam(Ham_Spawn,"player","hamPlayerSpawnPost",1);
}

new iSpawnsCount[33];
public hamPlayerSpawnPost(id)
{
if(!(++iSpawnsCount[id]>1))
{
set_task(10.0,"Show_SoundMenu",id);
}
}

public plugin_precache()
{
g_aTrackNames = ArrayCreate(256,10);
g_aTrackPaths = ArrayCreate(256,10);
LoadSettings();
}

#define get_bit(%1,%2) ( %1 &   1 << ( %2 & 31 ) )
#define set_bit(%1,%2) %1 |=  ( 1 << ( %2 & 31 ) )
#define clear_bit(%1,%2) %1 &= ~( 1 << ( %2 & 31 ) )
new iSoundPlayers = 0;
public Show_SoundMenu(id)
{
if(!is_user_connected(id)) return PLUGIN_CONTINUE;
new iStyle = get_pcvar_num(pMenuStyle);
new szMenu[512];
new iLen = formatex(szMenu, charsmax(szMenu), "\y%L^n", LANG_PLAYER, "RS_MENU_TITLE");
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, iStyle==1 ? "\y[1] \w%L^n" : "\w1. %L^n", LANG_PLAYER, "RS_MENU_YES");
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, iStyle==1 ? "\y[2] \w%L^n" : "\w2. %L^n", LANG_PLAYER, "RS_MENU_NO");
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, iStyle==1 ? "\y[3] \w%L^n" : "\w3. %L^n", LANG_PLAYER, "RS_MENU_ON_MUSIC");
formatex(szMenu[iLen], charsmax(szMenu) - iLen, iStyle==1 ? "^n\y[0] \w%L" : "^n\w0. %L", id, "RS_MENU_EXIT");
return show_menu(id, (1<<0|1<<1|1<<2|1<<9), szMenu, -1, "Show_SoundMenu");
}

public Handle_SoundMenu(id,iKey)
{
switch(iKey)
{
case 0: 
{
set_bit(iSoundPlayers,id);
ColorChat(id,RED,"%L",LANG_PLAYER,"RS_MENU_CHAT_MSG_YES");
}
case 1: 
{
clear_bit(iSoundPlayers,id);
client_cmd(id,"mp3 stop");
ColorChat(id,RED,"%L",LANG_PLAYER,"RS_MENU_CHAT_MSG_NO");
}
case 2: 
{
client_cmd(id,"MP3Volume 3"); 
ColorChat(id,RED,"%L",LANG_PLAYER,"RS_MENU_CHAT_MSG_ON_MUSIC");
Show_SoundMenu(id);
}
}
return PLUGIN_HANDLED;
}

new iTrackListSize = 0;
public LoadSettings()
{
new szIniFile[256];
get_configsdir(szIniFile,charsmax(szIniFile));
format(szIniFile,charsmax(szIniFile),"%s%s",szIniFile,"/round_sound.ini");
new szTempBuffer[512];
new szTrackName[256],szTrackPath[256];
new hFile = fopen(szIniFile,"rt");
if(!hFile)
log_to_error("Cannot open file %s",szIniFile);

while(!feof(hFile))
{

fgets(hFile,szTempBuffer,charsmax(szTempBuffer));
new iParseCount = parse(szTempBuffer,szTrackName,charsmax(szTrackName),szTrackPath,charsmax(szTrackPath));
if(iParseCount==2)
{
trim(szTrackName);
trim(szTrackPath);
if(strlen(szTrackPath)>0 && strlen(szTrackName)>0)
{
ArrayPushString(g_aTrackNames,szTrackName);
ArrayPushString(g_aTrackPaths,szTrackPath);
precache_sound(szTrackPath);
}
}
else
{
log_to_error("Error reading INI File");
log_to_error(" Track Name:%s",szTrackName);
log_to_error(" Track Path:%s",szTrackPath);
}
}
fclose(hFile);

iTrackListSize = ArraySize(g_aTrackNames);
for(new i = 0; i < iTrackListSize; i++) 
{
new iRand = random_num(0,iTrackListSize-1);
ArraySwap(g_aTrackNames,i,iRand);
ArraySwap(g_aTrackPaths,i,iRand);
}
}
new iTrackNum = 0;
public leRoundEnd()
{
new iCurrentTrack = iTrackNum++;
if(iCurrentTrack>iTrackListSize) iCurrentTrack=iTrackNum=0;
new szTrackName[256],szTrackPath[256];
ArrayGetString(g_aTrackNames,iTrackNum,szTrackName,charsmax(szTrackName));
ArrayGetString(g_aTrackPaths,iTrackNum,szTrackPath,charsmax(szTrackPath));
new aPlayers[32],iCount;
get_players(aPlayers,iCount,"c");
for(new i = 0;i<iCount;i++)
{
new id = aPlayers;
if(!get_bit(iSoundPlayers,id)) continue;
ColorChat(id,RED,"%L",LANG_PLAYER,"RS_CHAT_MSG_PLAYING",szTrackName);
client_cmd(id,"mp3 play sound/%s",szTrackPath);
}
}

public client_connect(id)
{
clear_bit(iSoundPlayers,id);
iSpawnsCount[id]
=0;
}

stock log_to_error(const message[], any:...)
{
new log[256], date[32], Map[32];
vformat(log, 255, message, 2);
get_time("error_%Y%m%d.log", date, 31);
get_mapname(Map, 31);
log_to_file(date, "[%s] %s", "Round Sound", log);
}

Добавлено (28.06.2018, 14:37)
---------------------------------------------
Посмотрите может что в коде лишнего

Прикрепления: 4291453.jpg (207.0 Kb)
Дата: Четверг, 28.06.2018, 14:46 | Сообщение # 2
Скриптер
Мастер
Offline
  • MakapoH
  • Репутация: 71
  • Сообщений:140
  • Разработчик
А скриптёр зачем? smile Компилируйте локально. Если у вас версия AmxModX 1.8.3, то удалите #include <colorchat> и замените все ColorChat(id,RED на client_print_color(id, print_team_red
Сообщение отредактировал MakapoH - Четверг, 28.06.2018, 14:48
Дата: Пятница, 29.06.2018, 10:27 | Сообщение # 3
Мастер
Offline
  • BogdanPP
  • Репутация: 4
  • Сообщений:125
  • Пользователь
  • Статус пользователя 193.124.185.131:27024
У меня версия AmxModX 1.8.2 Ошибка в логах выходит думаю где то косяк есть

Добавлено (28.06.2018, 16:34)
---------------------------------------------
КТО ПОМОЖЕТ

Добавлено (29.06.2018, 10:27)
---------------------------------------------
L 06/29/2018 - 09:07:20: Start of error session.
L 06/29/2018 - 09:07:20: Info (map "de_dust2_2x2") (file "addons/amxmodx/logs/error_20180629.log")
L 06/29/2018 - 09:07:20: Invalid cellvector handle provided (10:16:16)
L 06/29/2018 - 09:07:20: [AMXX]Run time error 10 (plugin "round_sound.amxx") (native "ArrayGetString") - debug not enabled!
L 06/29/2018 - 09:07:20: [AMXX]To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
L 06/29/2018 - 09:08:09: Invalid cellvector handle provided (10:17:16)
L 06/29/2018 - 09:08:09: [AMXX]Run time error 10 (plugin "round_sound.amxx") (native "ArrayGetString") - debug not enabled!
L 06/29/2018 - 09:08:09: [AMXX]To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
L 06/29/2018 - 09:17:46: Invalid cellvector handle provided (10:16:16)
L 06/29/2018 - 09:17:46: [AMXX]Run time error 10 (plugin "round_sound.amxx") (native "ArrayGetString") - debug not enabled!
L 06/29/2018 - 09:17:46: [AMXX]To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
L 06/29/2018 - 09:18:08: Invalid cellvector handle provided (10:17:16)
L 06/29/2018 - 09:18:08: [AMXX]Run time error 10 (plugin "round_sound.amxx") (native "ArrayGetString") - debug not enabled!
L 06/29/2018 - 09:18:08: [AMXX]To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
L 06/29/2018 - 09:40:56: Start of error session.
L 06/29/2018 - 09:40:56: Info (map "de_dust2") (file "addons/amxmodx/logs/error_20180629.log")
L 06/29/2018 - 09:40:56: Invalid cellvector handle provided (10:16:16)
L 06/29/2018 - 09:40:56: [AMXX]Run time error 10 (plugin "round_sound.amxx") (native "ArrayGetString") - debug not enabled!
L 06/29/2018 - 09:40:56: [AMXX]To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
L 06/29/2018 - 09:41:25: Invalid cellvector handle provided (10:17:16)
L 06/29/2018 - 09:41:25: [AMXX]Run time error 10 (plugin "round_sound.amxx") (native "ArrayGetString") - debug not enabled!
L 06/29/2018 - 09:41:25: [AMXX]To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
L 06/29/2018 - 09:49:28: Invalid cellvector handle provided (10:16:16)
L 06/29/2018 - 09:49:28: [AMXX]Run time error 10 (plugin "round_sound.amxx") (native "ArrayGetString") - debug not enabled!
L 06/29/2018 - 09:49:28: [AMXX]To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
L 06/29/2018 - 09:51:37: Invalid cellvector handle provided (10:17:16)
L 06/29/2018 - 09:51:37: [AMXX]Run time error 10 (plugin "round_sound.amxx") (native "ArrayGetString") - debug not enabled!
L 06/29/2018 - 09:51:37: [AMXX]To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).

Дата: Пятница, 29.06.2018, 10:49 | Сообщение # 4
Профи
Offline
  • Mandar1n
  • Репутация: 24
  • Сообщений:244
  • Пользователь
  • Статус пользователя Помощь в личке - платная. Бесплатная только в темах.
140 строка. Должно быть так:
new id = aPlayers;
Дата: Пятница, 29.06.2018, 12:10 | Сообщение # 5
Скриптер
Мастер
Offline
  • Quin
  • Репутация: 56
  • Сообщений:121
  • Разработчик
  • Статус пользователя
Цитата Mandar1n ()
140 строка. Должно быть так:new id = aPlayers;
Форум обычно удаляет в квадратных скобках i, поэтому врятли тут ошибка. 
По коду можно заметить что переменная выходит за пределы существующего массива.
Цитата BogdanPP ()
new iCurrentTrack = iTrackNum++;if(iCurrentTrack>iTrackListSize) iCurrentTrack=iTrackNum=0;
Это условие (iCurrentTrack>iTrackListSize) не верно, нужно (iCurrentTrack>=iTrackListSize) так как массив всегда на один больше чем реальный размер.
Дата: Пятница, 29.06.2018, 12:41 | Сообщение # 6
Мастер
Offline
  • BogdanPP
  • Репутация: 4
  • Сообщений:125
  • Пользователь
  • Статус пользователя 193.124.185.131:27024
L 06/29/2018 - 12:15:40: Start of error session.
L 06/29/2018 - 12:15:40: Info (map "de_dust2_2x2") (file "addons/amxmodx/logs/error_20180629.log")
L 06/29/2018 - 12:15:40: Invalid cellvector handle provided (10:16:16)
L 06/29/2018 - 12:15:40: [AMXX]Displaying debug trace (plugin "round_sound.amxx")
L 06/29/2018 - 12:15:40: [AMXX]Run time error 10: native error (native "ArrayGetString")
L 06/29/2018 - 12:15:40:     [AMXX][0] 41f4dcef5f1c0bf603939f5c5334b5d4.sma::leRoundEnd (line 148)
L 06/29/2018 - 12:16:17: Invalid cellvector handle provided (10:17:16)
L 06/29/2018 - 12:16:17: [AMXX]Displaying debug trace (plugin "round_sound.amxx")
L 06/29/2018 - 12:16:17: [AMXX]Run time error 10: native error (native "ArrayGetString")
L 06/29/2018 - 12:16:17:     [AMXX][0] 41f4dcef5f1c0bf603939f5c5334b5d4.sma::leRoundEnd (line 148)
L 06/29/2018 - 12:30:50: Invalid cellvector handle provided (10:16:16)
L 06/29/2018 - 12:30:50: [AMXX]Displaying debug trace (plugin "round_sound.amxx")
L 06/29/2018 - 12:30:50: [AMXX]Run time error 10: native error (native "ArrayGetString")
L 06/29/2018 - 12:30:50:     [AMXX][0] 41f4dcef5f1c0bf603939f5c5334b5d4.sma::leRoundEnd (line 148)
L 06/29/2018 - 12:31:16: Invalid cellvector handle provided (10:17:16)
L 06/29/2018 - 12:31:16: [AMXX]Displaying debug trace (plugin "round_sound.amxx")
L 06/29/2018 - 12:31:16: [AMXX]Run time error 10: native error (native "ArrayGetString")
L 06/29/2018 - 12:31:16:     [AMXX][0] 41f4dcef5f1c0bf603939f5c5334b5d4.sma::leRoundEnd (line 148)
  • Страница 1 из 1
  • 1
Поиск:
(threadpage)