Не могу скомпилировать. Помогите

Статус
В этой теме нельзя размещать новые ответы.
Сообщения
5
Реакции
0
Ошибка
//AMXXPC compile.exe
// by the AMX Mod X Dev Team


//// zp_cso_winhud.sma
//
zp_cso_winhud.sma(110) : error 021: symbol already defined: "set_dhudmessage"
zp_cso_winhud.sma(115) : error 010: invalid function or declaration
zp_cso_winhud.sma(125) : error 010: invalid function or declaration
zp_cso_winhud.sma(128) : error 021: symbol already defined: "show_dhudmessage"
zp_cso_winhud.sma(133) : error 010: invalid function or declaration
zp_cso_winhud.sma(135) : warning 218: old style prototypes used with optional semicolumns
zp_cso_winhud.sma(136) : error 054: unmatched closing brace
zp_cso_winhud.sma(137) : error 010: invalid function or declaration
zp_cso_winhud.sma(140) : warning 218: old style prototypes used with optional semicolumns
zp_cso_winhud.sma(141) : error 054: unmatched closing brace
zp_cso_winhud.sma(142) : error 010: invalid function or declaration
zp_cso_winhud.sma(145) : error 021: symbol already defined: "get_players"
zp_cso_winhud.sma(147) : error 010: invalid function or declaration
zp_cso_winhud.sma(149) : error 010: invalid function or declaration
zp_cso_winhud.sma(154) : error 010: invalid function or declaration
zp_cso_winhud.sma(156) : error 010: invalid function or declaration
zp_cso_winhud.sma(158) : error 010: invalid function or declaration
zp_cso_winhud.sma(161) : error 010: invalid function or declaration
zp_cso_winhud.sma(170) : error 010: invalid function or declaration
zp_cso_winhud.sma(173) : warning 218: old style prototypes used with optional semicolumns
zp_cso_winhud.sma(174) : error 054: unmatched closing brace
zp_cso_winhud.sma(175) : error 010: invalid function or declaration
zp_cso_winhud.sma(177) : error 010: invalid function or declaration
zp_cso_winhud.sma(181) : error 010: invalid function or declaration
zp_cso_winhud.sma(186) : error 021: symbol already defined: "vformat"
zp_cso_winhud.sma(187) : warning 218: old style prototypes used with optional semicolumns
zp_cso_winhud.sma(188) : error 054: unmatched closing brace
zp_cso_winhud.sma(191) : error 021: symbol already defined: "ArrayDestroy"
zp_cso_winhud.sma(194) : error 010: invalid function or declaration
zp_cso_winhud.sma(197) : error 025: function heading differs from prototype
//
// Compilation aborted.
// 26 Errors.
Компилятор
Локальный
Amx Mod X
1.9.0
Исходный код
#include <amxmodx>
#include <fun>
#include <fakemeta>
#include <zombieplague>
#include <hamsandwich>

#define PLUGIN "CountDown+RoundNumber"
#define VERSION "1.0"
#define AUTHOR "inf"

new count, g_roundhud

stock __dhud_color;
stock __dhud_x;
stock __dhud_y;
stock __dhud_effect;
stock __dhud_fxtime;
stock __dhud_holdtime;
stock __dhud_fadeintime;
stock __dhud_fadeouttime;
stock __dhud_reliable;

public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)

register_event("HLTV", "event_roundstart", "a", "1=0", "2=0")

set_task (0.6,"showhud",_,_,_,"b");

g_roundhud = 1
}

public plugin_precache()
{
precache_sound("zmtime1/1.wav")
precache_sound("zmtime1/2.wav")
precache_sound("zmtime1/3.wav")
precache_sound("zmtime1/4.wav")
precache_sound("zmtime1/5.wav")
precache_sound("zmtime1/6.wav")
precache_sound("zmtime1/7.wav")
precache_sound("zmtime1/8.wav")
precache_sound("zmtime1/9.wav")
precache_sound("zmtime1/10.wav")
precache_sound("zmtime1/start1.mp3")
precache_sound("zmtime1/start2.mp3")
precache_sound("zmtime1/start3.mp3")
}

public event_roundstart()
{
set_task(9.0,"start_countdown",1499)

for (new i = 1; i <= get_maxplayers(); i++)
{
if (!is_user_connected(i))
{
continue;
}

new snd = random_num(0, 2);
if (snd == 0)
{
client_cmd(i,"mp3 play sound/zmtime1/start1.mp3")
}
else if (snd == 1)
{
client_cmd(i,"mp3 play sound/zmtime1/start2.mp3")
}
else if (snd == 2)
{
client_cmd(i,"mp3 play sound/zmtime1/start3.mp3")
}
}
count = 10
g_roundhud += 1
}

public start_countdown()
{
remove_task(1499)
remove_task(1500)
set_task(1.0,"countdown",1500)
}

public countdown()
{
if(count == 0)
{
set_dhudmessage(random_num(0, 255), random_num(0, 255), random_num(0, 255), -1.0, 0.22, 0, 1.0, 1.0,1.0,1.0)
show_dhudmessage(0,"Инфекция расходится!!!")
}
if(count > 0)
{
set_dhudmessage(random_num(0, 255), random_num(0, 255), random_num(0, 255), -1.0, 0.22, 0, 0.5, 0.5,0.5,0.5)
if(count < 11) client_cmd(0,"spk zmtime1/%d", count)
show_dhudmessage(0,"Заражение начнется через %d секунд!!!",count)
}
count = count - 1
if(count >= 0) set_task(1.0,"countdown",1500)
}

public showhud()
{
set_dhudmessage(random_num(0, 255), random_num(0, 255), random_num(0, 255), -1.0, 0.0, 0, 0.0, 0.01)
show_dhudmessage(0, "[РАУНД: %d]" , g_roundhud)
}

stock set_dhudmessage( red = 0, green = 160, blue = 0, Float:x = -1.0, Float:y = 0.65, effects = 2, Float:fxtime = 0.6, Float:holdtime = 0.6, Float:fadeintime = 0.6, Float:fadeouttime = 0.6, bool:reliable = false );
{
#define clamp_byte(%1) ( clamp( %1, 0, 255 ) )
#define pack_color(%1,%2,%3) ( %3 + ( %2 << 8 ) + ( %1 << 16 ) )

__dhud_color = pack_color( clamp_byte( red ), clamp_byte( green ), clamp_byte( blue ) );
__dhud_x = _:x;
__dhud_y = _:y;
__dhud_effect = effects;
__dhud_fxtime = _:fxtime;
__dhud_holdtime = _:holdtime;
__dhud_fadeintime = _:fadeintime;
__dhud_fadeouttime = _:fadeouttime;
__dhud_reliable = _:reliable;

return 1;
}

stock show_dhudmessage( index, const message[], any:... )
{
new buffer[ 128 ];
new numArguments = numargs();

if( numArguments == 2 )
{
send_dhudMessage( index, message );
}
else if( index || numArguments == 3 )
{
vformat( buffer, charsmax( buffer ), message, 3 );
send_dhudMessage( index, buffer );
}
else
{
new playersList[ 32 ], numPlayers;
get_players( playersList, numPlayers, "ch" );

if( !numPlayers )
{
return 0;
}

new Array:handleArrayML = ArrayCreate();

for( new i = 2, j; i < numArguments; i++ )
{
if( getarg( i ) == LANG_PLAYER )
{
while( ( buffer[ j ] = getarg( i + 1, j++ ) ) ) {}
j = 0;

if( GetLangTransKey( buffer ) != TransKey_Bad )
{
ArrayPushCell( handleArrayML, i++ );
}
}
}

new size = ArraySize( handleArrayML );

if( !size )
{
vformat( buffer, charsmax( buffer ), message, 3 );
send_dhudMessage( index, buffer );
}
else
{
for( new i = 0, j; i < numPlayers; i++ )
{
index = playersList[ i ];

for( j = 0; j < size; j++ )
{
setarg( ArrayGetCell( handleArrayML, j ), 0, index );
}

vformat( buffer, charsmax( buffer ), message, 3 );
send_dhudMessage( index, buffer );
}
}

ArrayDestroy( handleArrayML );
}

return 1;
}

stock send_dhudMessage( const index, const message[] )
{
message_begin( __dhud_reliable ? ( index ? MSG_ONE : MSG_ALL ) : ( index ? MSG_ONE_UNRELIABLE : MSG_BROADCAST ), SVC_DIRECTOR, _, index );
{
write_byte( strlen( message ) + 31 );
write_byte( DRC_CMD_MESSAGE );
write_byte( __dhud_effect );
write_long( __dhud_color );
write_long( __dhud_x );
write_long( __dhud_y );
write_long( __dhud_fadeintime );
write_long( __dhud_fadeouttime );
write_long( __dhud_holdtime );
write_long( __dhud_fxtime );
write_string( message );
}
message_end();
}
Не получается скомпилировать. Помогите
 
В этой теме было размещено решение! Перейти к решению.
Сообщения
967
Реакции
51
Помог
10 раз(а)
Если я не ошибаюсь, это сделано не под amx 1.9.0, я про компилятор
 
Сообщения
967
Реакции
51
Помог
10 раз(а)
@Code_0xABC,Интересно,а как вы это поняли?Сделан под 1.9.0
Версия амх 1.9.0 в аmxmodx.inc уже есть функция set_dhudmessage, а в этом коде сток с таким же названием присуствует, это только по строке 110, дальше не смотрел
 
Сообщения
5
Реакции
0
Code_0xABC, Я вот тоже этого не понимаю.Если он уже встроен,то почему ошибку выдаёт. Я попробовал разные компиляторы,но ошибки такие же остаются
 
Сообщения
5
Реакции
0
Nordic Warrior,Помогите исправить. Какие я смог подправить и то с варнингами оставил .Тут я вообще бессильный)
 

fgd

Сообщения
19
Реакции
5
Помог
2 раз(а)
Pe6eHoK, тебе же ответили что в amxmodx 1.9.0 уже есть функции set_dhudmessage и show_dhudmessage, а у тебя в плагине есть стоки с такими же названиями. Amxmodx не поддерживает перегрузку функций. Так что просто убери стоки с индентичными названиями.

C++:
stock set_dhudmessage( red = 0, green = 160, blue = 0, Float:x = -1.0, Float:y = 0.65, effects = 2, Float:fxtime = 0.6, Float:holdtime = 0.6, Float:fadeintime = 0.6, Float:fadeouttime = 0.6, bool:reliable = false );
{
    #define clamp_byte(%1)       ( clamp( %1, 0, 255 ) )
    #define pack_color(%1,%2,%3) ( %3 + ( %2 << 8 ) + ( %1 << 16 ) )

    __dhud_color       = pack_color( clamp_byte( red ), clamp_byte( green ), clamp_byte( blue ) );
    __dhud_x           = _:x;
    __dhud_y           = _:y;
    __dhud_effect      = effects;
    __dhud_fxtime      = _:fxtime;
    __dhud_holdtime    = _:holdtime;
    __dhud_fadeintime  = _:fadeintime;
    __dhud_fadeouttime = _:fadeouttime;
    __dhud_reliable    = _:reliable;

    return 1;
}

stock show_dhudmessage( index, const message[], any:... )
{
    new buffer[ 128 ];
    new numArguments = numargs();

    if( numArguments == 2 )
    {
        send_dhudMessage( index, message );
    }
    else if( index || numArguments == 3 )
    {
        vformat( buffer, charsmax( buffer ), message, 3 );
        send_dhudMessage( index, buffer );
    }
    else
    {
        new playersList[ 32 ], numPlayers;
        get_players( playersList, numPlayers, "ch" );

        if( !numPlayers )
        {
            return 0;
        }

        new Array:handleArrayML = ArrayCreate();

        for( new i = 2, j; i < numArguments; i++ )
        {
            if( getarg( i ) == LANG_PLAYER )
            {
                while( ( buffer[ j ] = getarg( i + 1, j++ ) ) ) {}
                j = 0;

                if( GetLangTransKey( buffer ) != TransKey_Bad )
                {
                    ArrayPushCell( handleArrayML, i++ );
                }
            }
        }

        new size = ArraySize( handleArrayML );

        if( !size )
        {
            vformat( buffer, charsmax( buffer ), message, 3 );
            send_dhudMessage( index, buffer );
        }
        else
        {
            for( new i = 0, j; i < numPlayers; i++ )
            {
                index = playersList[ i ];

                for( j = 0; j < size; j++ )
                {
                    setarg( ArrayGetCell( handleArrayML, j ), 0, index );
                }

                vformat( buffer, charsmax( buffer ), message, 3 );
                send_dhudMessage( index, buffer );
            }
        }

        ArrayDestroy( handleArrayML );
    }

    return 1;
}
 
Сообщения
967
Реакции
51
Помог
10 раз(а)
fgd, а что за перегрузка?) Пусть попробует скомпилировать компилятором 1.8.2, либо их переименует
 
Сообщения
939
Реакции
187
Помог
4 раз(а)
Код:
#include <amxmodx>
#include <fun>
#include <fakemeta>
#include <zombieplague>
#include <hamsandwich>

#define PLUGIN "CountDown+RoundNumber"
#define VERSION "1.0"
#define AUTHOR "inf"

new count, g_roundhud

stock __dhud_color;
stock __dhud_x;
stock __dhud_y;
stock __dhud_effect;
stock __dhud_fxtime;
stock __dhud_holdtime;
stock __dhud_fadeintime;
stock __dhud_fadeouttime;
stock __dhud_reliable;

public plugin_init()
{
    register_plugin(PLUGIN, VERSION, AUTHOR)

    register_event("HLTV", "event_roundstart", "a", "1=0", "2=0")

    set_task (0.6,"showhud",_,_,_,"b");

    g_roundhud = 1
}

public plugin_precache()
{
    precache_sound("zmtime1/1.wav")
    precache_sound("zmtime1/2.wav")
    precache_sound("zmtime1/3.wav")
    precache_sound("zmtime1/4.wav")
    precache_sound("zmtime1/5.wav")
    precache_sound("zmtime1/6.wav")
    precache_sound("zmtime1/7.wav")
    precache_sound("zmtime1/8.wav")
    precache_sound("zmtime1/9.wav")
    precache_sound("zmtime1/10.wav")
    precache_sound("zmtime1/start1.mp3")
    precache_sound("zmtime1/start2.mp3")
    precache_sound("zmtime1/start3.mp3")
}

public event_roundstart()
{
    set_task(9.0,"start_countdown",1499)

    for (new i = 1; i <= get_maxplayers(); i++)
    {
            if (!is_user_connected(i))
        {
                  continue;
        }

        new snd = random_num(0, 2);
            if (snd == 0)
        {
                  client_cmd(i,"mp3 play sound/zmtime1/start1.mp3")
        }
            else if (snd == 1)
        {
                  client_cmd(i,"mp3 play sound/zmtime1/start2.mp3")
        }
        else if (snd == 2)
        {
            client_cmd(i,"mp3 play sound/zmtime1/start3.mp3")
        }
    }
    count = 10
    g_roundhud += 1
}

public start_countdown()
{
    remove_task(1499)
    remove_task(1500)
    set_task(1.0,"countdown",1500)
}

public countdown()
{
    if(count == 0)
    {
        set_dhudmessage(random_num(0, 255), random_num(0, 255), random_num(0, 255), -1.0, 0.22,  0, 1.0, 1.0,1.0,1.0)
        show_dhudmessage(0,"Инфекция расходится!!!")
    }
    if(count > 0)
    {
        set_dhudmessage(random_num(0, 255), random_num(0, 255), random_num(0, 255), -1.0, 0.22,  0, 0.5, 0.5,0.5,0.5)
        if(count < 11) client_cmd(0,"spk  zmtime1/%d", count)
        show_dhudmessage(0,"Заражение начнется через %d секунд!!!",count)
    }
    count = count - 1
    if(count >= 0) set_task(1.0,"countdown",1500)
}

public showhud()
{
    set_dhudmessage(random_num(0, 255), random_num(0, 255), random_num(0, 255), -1.0, 0.0, 0, 0.0, 0.01)
    show_dhudmessage(0, "[РАУНД: %d]" , g_roundhud) 
}

stock send_dhudMessage( const index, const message[] )
{
    message_begin( __dhud_reliable ? ( index ? MSG_ONE : MSG_ALL ) : ( index ? MSG_ONE_UNRELIABLE : MSG_BROADCAST ), SVC_DIRECTOR, _, index );
    {
        write_byte( strlen( message ) + 31 );
        write_byte( DRC_CMD_MESSAGE );
        write_byte( __dhud_effect );
        write_long( __dhud_color );
        write_long( __dhud_x );
        write_long( __dhud_y );
        write_long( __dhud_fadeintime );
        write_long( __dhud_fadeouttime );
        write_long( __dhud_holdtime );
        write_long( __dhud_fxtime );
        write_string( message );
    }
    message_end();
}
 

fgd

Сообщения
19
Реакции
5
Помог
2 раз(а)
Code_0xABC, самый простой пример.

Код:
int sum(int a, int b)
    return a + b;
float sum(float a, float b)
    return a + b;
 
Сообщения
967
Реакции
51
Помог
10 раз(а)
murlemur, спасибо, понял теперь о чем вы))
 
Последнее редактирование:
Статус
В этой теме нельзя размещать новые ответы.

Пользователи, просматривающие эту тему

Сейчас на форуме нет ни одного пользователя.
Сверху Снизу