- Ошибка
-
// C:\amxmodx-1.9.0\scripting\include\dhudmessage.inc(19) : error 021: symbol already defined: "set_dhudmessage"
// C:\amxmodx-1.9.0\scripting\include\dhudmessage.inc(24) : error 010: invalid function or declaration
// C:\amxmodx-1.9.0\scripting\include\dhudmessage.inc(34) : error 010: invalid function or declaration
// C:\amxmodx-1.9.0\scripting\include\dhudmessage.inc(37) : error 021: symbol already defined: "show_dhudmessage"
// C:\amxmodx-1.9.0\scripting\include\dhudmessage.inc(42) : error 010: invalid function or declaration
// C:\amxmodx-1.9.0\scripting\include\dhudmessage.inc(44) : warning 218: old style prototypes used with optional semicolumns
// C:\amxmodx-1.9.0\scripting\include\dhudmessage.inc(45) : error 054: unmatched closing brace
// C:\amxmodx-1.9.0\scripting\include\dhudmessage.inc(46) : error 010: invalid function or declaration
// C:\amxmodx-1.9.0\scripting\include\dhudmessage.inc(49) : warning 218: old style prototypes used with optional semicolumns
// C:\amxmodx-1.9.0\scripting\include\dhudmessage.inc(50) : error 054: unmatched closing brace
// C:\amxmodx-1.9.0\scripting\include\dhudmessage.inc(51) : error 010: invalid function or declaration
// C:\amxmodx-1.9.0\scripting\include\dhudmessage.inc(54) : error 021: symbol already defined: "get_players"
// C:\amxmodx-1.9.0\scripting\include\dhudmessage.inc(56) : error 010: invalid function or declaration
// C:\amxmodx-1.9.0\scripting\include\dhudmessage.inc(58) : error 010: invalid function or declaration
// C:\amxmodx-1.9.0\scripting\include\dhudmessage.inc(63) : error 010: invalid function or declaration
// C:\amxmodx-1.9.0\scripting\include\dhudmessage.inc(65) : error 010: invalid function or declaration
// C:\amxmodx-1.9.0\scripting\include\dhudmessage.inc(67) : error 010: invalid function or declaration
// C:\amxmodx-1.9.0\scripting\include\dhudmessage.inc(70) : error 010: invalid function or declaration
// C:\amxmodx-1.9.0\scripting\include\dhudmessage.inc(79) : error 010: invalid function or declaration
// C:\amxmodx-1.9.0\scripting\include\dhudmessage.inc(82) : warning 218: old style prototypes used with optional semicolumns
// C:\amxmodx-1.9.0\scripting\include\dhudmessage.inc(83) : error 054: unmatched closing brace
// C:\amxmodx-1.9.0\scripting\include\dhudmessage.inc(84) : error 010: invalid function or declaration
// C:\amxmodx-1.9.0\scripting\include\dhudmessage.inc(86) : error 010: invalid function or declaration
// C:\amxmodx-1.9.0\scripting\include\dhudmessage.inc(90) : error 010: invalid function or declaration
// C:\amxmodx-1.9.0\scripting\include\dhudmessage.inc(95) : error 021: symbol already defined: "vformat"
// C:\amxmodx-1.9.0\scripting\include\dhudmessage.inc(96) : warning 218: old style prototypes used with optional semicolumns
// C:\amxmodx-1.9.0\scripting\include\dhudmessage.inc(97) : error 054: unmatched closing brace
// C:\amxmodx-1.9.0\scripting\include\dhudmessage.inc(100) : error 021: symbol already defined: "ArrayDestroy"
// C:\amxmodx-1.9.0\scripting\include\dhudmessage.inc(103) : error 010: invalid function or declaration
// C:\amxmodx-1.9.0\scripting\include\dhudmessage.inc(106) : error 025: function heading differs from prototype
- Компилятор
- Локальный
- Amx Mod X
- 1.9.0
- Исходный код
-
#include <amxmodx>
#include <amxmisc>
#include <dhudmessage>
#define INTERVAL 10 //
new Array:g_Messages;
new g_ArraySize, g_counter;
public plugin_init()
{
register_plugin( "dhud advert", "1.0", "DUKKHAZ0R" );
g_Messages = ArrayCreate(128);
set_task( INTERVAL.0,"show_advert",.flags="b");
}
public plugin_cfg()
{
new cfgsdir[128];
get_configsdir(cfgsdir,charsmax(cfgsdir));
add(cfgsdir,charsmax(cfgsdir),"/dhud_advert.ini");
if(!file_exists(cfgsdir))
{
new szError[256];
formatex(szError,charsmax(szError),"Enable to open ^"%s^"!",cfgsdir);
set_fail_state(szError);
}
new i_File,szLine[256];
i_File = fopen(cfgsdir,"rt");
while(i_File && !feof(i_File))
{
fgets(i_File,szLine,charsmax(szLine));
if(!szLine[0] || szLine[0] == ';' || szLine[0] == '/' && szLine[1] == '/' || strlen(szLine) >= 128)
continue;
remove_quotes(szLine);
ArrayPushString(g_Messages,szLine);
}
g_ArraySize = ArraySize(g_Messages);
fclose(i_File);
}
public show_advert()
{
clrscr();
if(g_counter >= g_ArraySize)
g_counter = 0;
new szMessage[128];
ArrayGetString(g_Messages,g_counter,szMessage,charsmax(szMessage));
new g_iRed = random_num(1,255),g_iGreen = random_num(1,255),g_iBlue = random_num(1,255);
set_dhudmessage(g_iRed, g_iGreen, g_iBlue, -1.0, 0.02, 1, 2.0, 12.0, 2.0, 2.0, true);
show_dhudmessage(0,szMessage);
g_counter++;
}
public clrscr()
{
for(new i; i < 8; i++)
show_dhudmessage(0,"");
}
Подскажите, как исправить? Не получается скомпилировать под Amx Mod X 1.9.0.
В этой теме было размещено решение! Перейти к решению.