Ошибка Компиляции

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


//// color.sma
//
// D:\╤╥╬╦\╩юьяхы ЄюЁ√\1.9.0_scripting\include\colorchat.inc(28) : error 021: symbol already defined: "client_print_color"
// D:\╤╥╬╦\╩юьяхы ЄюЁ√\1.9.0_scripting\include\colorchat.inc(31) : error 010: invalid function or declaration
// D:\╤╥╬╦\╩юьяхы ЄюЁ√\1.9.0_scripting\include\colorchat.inc(33) : error 010: invalid function or declaration
// D:\╤╥╬╦\╩юьяхы ЄюЁ√\1.9.0_scripting\include\colorchat.inc(36) : error 010: invalid function or declaration
// D:\╤╥╬╦\╩юьяхы ЄюЁ√\1.9.0_scripting\include\colorchat.inc(40) : error 010: invalid function or declaration
// D:\╤╥╬╦\╩юьяхы ЄюЁ√\1.9.0_scripting\include\colorchat.inc(57) : error 010: invalid function or declaration
// D:\╤╥╬╦\╩юьяхы ЄюЁ√\1.9.0_scripting\include\colorchat.inc(59) : error 010: invalid function or declaration
// D:\╤╥╬╦\╩юьяхы ЄюЁ√\1.9.0_scripting\include\colorchat.inc(63) : error 010: invalid function or declaration
// D:\╤╥╬╦\╩юьяхы ЄюЁ√\1.9.0_scripting\include\colorchat.inc(68) : error 010: invalid function or declaration
// D:\╤╥╬╦\╩юьяхы ЄюЁ√\1.9.0_scripting\include\colorchat.inc(70) : error 010: invalid function or declaration
// D:\╤╥╬╦\╩юьяхы ЄюЁ√\1.9.0_scripting\include\colorchat.inc(74) : error 010: invalid function or declaration
// D:\╤╥╬╦\╩юьяхы ЄюЁ√\1.9.0_scripting\include\colorchat.inc(76) : warning 218: old style prototypes used with optional semicolumns
// D:\╤╥╬╦\╩юьяхы ЄюЁ√\1.9.0_scripting\include\colorchat.inc(77) : error 054: unmatched closing brace
// D:\╤╥╬╦\╩юьяхы ЄюЁ√\1.9.0_scripting\include\colorchat.inc(79) : warning 218: old style prototypes used with optional semicolumns
// D:\╤╥╬╦\╩юьяхы ЄюЁ√\1.9.0_scripting\include\colorchat.inc(80) : error 054: unmatched closing brace
// D:\╤╥╬╦\╩юьяхы ЄюЁ√\1.9.0_scripting\include\colorchat.inc(83) : error 010: invalid function or declaration
// D:\╤╥╬╦\╩юьяхы ЄюЁ√\1.9.0_scripting\include\colorchat.inc(88) : error 021: symbol already defined: "get_players"
// D:\╤╥╬╦\╩юьяхы ЄюЁ√\1.9.0_scripting\include\colorchat.inc(89) : error 010: invalid function or declaration
// D:\╤╥╬╦\╩юьяхы ЄюЁ√\1.9.0_scripting\include\colorchat.inc(91) : error 010: invalid function or declaration
// D:\╤╥╬╦\╩юьяхы ЄюЁ√\1.9.0_scripting\include\colorchat.inc(96) : error 010: invalid function or declaration
// D:\╤╥╬╦\╩юьяхы ЄюЁ√\1.9.0_scripting\include\colorchat.inc(98) : error 010: invalid function or declaration
// D:\╤╥╬╦\╩юьяхы ЄюЁ√\1.9.0_scripting\include\colorchat.inc(101) : error 010: invalid function or declaration
// D:\╤╥╬╦\╩юьяхы ЄюЁ√\1.9.0_scripting\include\colorchat.inc(105) : error 010: invalid function or declaration
// D:\╤╥╬╦\╩юьяхы ЄюЁ√\1.9.0_scripting\include\colorchat.inc(106) : error 010: invalid function or declaration
// D:\╤╥╬╦\╩юьяхы ЄюЁ√\1.9.0_scripting\include\colorchat.inc(109) : error 021: symbol already defined: "ArrayPushCell"
// D:\╤╥╬╦\╩юьяхы ЄюЁ√\1.9.0_scripting\include\colorchat.inc(113) : error 010: invalid function or declaration
// D:\╤╥╬╦\╩юьяхы ЄюЁ√\1.9.0_scripting\include\colorchat.inc(121) : error 010: invalid function or declaration
// D:\╤╥╬╦\╩юьяхы ЄюЁ√\1.9.0_scripting\include\colorchat.inc(123) : error 010: invalid function or declaration
//
// Compilation aborted.
// 26 Errors.
// Could not locate output file D:\╤╥╬╦\╩юьяхы ЄюЁ√\1.9.0_scripting\compiled\color.amx (compile failed).
//
// Compilation Time: 0,23 sec
// ----------------------------------------

Press enter to exit ...
Компилятор
Локальный
Amx Mod X
1.9.0
Исходный код
#include <amxmodx>
#include <amxmisc>
#include <colorchat>

#define COLORS_DATA_SIZE 8
#define MAX_PLAYERS 32

#define TIME_TO_SHOW 15 //Через сколько секунд показать меню.

//#define isVIP(%0) (get_user_flags(%0) & ADMIN_BAN)

const KEYSMENU = MENU_KEY_0|MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5|MENU_KEY_6|MENU_KEY_7|MENU_KEY_8|MENU_KEY_9;

new g_szMenuItem[][] =
{
"Без цвета", //0
"Голубой", //1
"Синий", //2
"Жёлтый", //3
"Зелёный", //4
"Красный", //5
"Розовый", //6
"Белый" //7
};

new g_eEnable[MAX_PLAYERS + 1][COLORS_DATA_SIZE], g_iAlpha[MAX_PLAYERS + 1], g_iPrecent[MAX_PLAYERS + 1];
new g_iRed[MAX_PLAYERS + 1], g_iGreen[MAX_PLAYERS + 1], g_iBlue[MAX_PLAYERS + 1], g_iSayText;

const ACTIVE = 1;
const NOT_ACTIVE = 0;

public plugin_init()
{
#define VERSION "1.2"
register_plugin( "COLORS MENU", VERSION, "DUKKHAZ0R" );
register_cvar("colors_version", VERSION, FCVAR_SERVER | FCVAR_SPONLY);

register_event( "DeathMsg", "on_death", "a", "1>0" );

register_menu( "menu_title", KEYSMENU, "menu_handler" );
register_clcmd( "say", "hook_say" );
register_clcmd( "say_team", "hook_say" );

register_clcmd( "set_precent", "precent_clcmd" );

g_iSayText = get_user_msgid("SayText");
}

public client_putinserver(id)
{
//if(!isVIP(id)) return;

g_eEnable[id][0] = ACTIVE;
g_iPrecent[id] = 50;

set_task( TIME_TO_SHOW.0, "show_colorsmenu", id );
}

public hook_say(id)
{
static szMessage[192];
read_args( szMessage, charsmax(szMessage) );
remove_quotes( szMessage );

if( szMessage[0] != '/' ) return;

new gszColorsCmd[][] = { "/colors", "/color", ".color", ".colors" };

for( new i; i < sizeof gszColorsCmd; i++ )
{
if( equal( szMessage, gszColorsCmd[i] ) )
show_colorsmenu(id);
}
}

public show_colorsmenu(id)
{
//if(!isVIP(id))
//{
// ChatColor( id, "^1[^4COLOR^1] Меню доступно только ^3VIP ^1игрокам" );
// return PLUGIN_HANDLED;
//}
static iLen, szMenu[512];

iLen = formatex( szMenu, charsmax(szMenu), "\yЗатемнение при фраге:^n^n" );

for( new i; i < sizeof g_szMenuItem; i++ )
iLen += formatex( szMenu[iLen], charsmax(szMenu) - iLen, "\r%d.%s%s^n", i+1, g_eEnable[id][i] ? "\y" : "\w", g_szMenuItem[i] );

iLen += formatex( szMenu[iLen], charsmax(szMenu) - iLen, "^n\r9.\wПрозрачность: \d%d%",g_iPrecent[id] );

iLen += formatex( szMenu[iLen], charsmax(szMenu) - iLen, "^n^n\r0.\yВыход" );

show_menu( id, KEYSMENU, szMenu, -1, "menu_title" );
return PLUGIN_HANDLED;
}

public menu_handler(id, item)
{
if( item == 9 )
{
return PLUGIN_HANDLED;
}
if( item == 8 )
{
client_cmd( id, "messagemode ^"set_precent ^"" );
return PLUGIN_HANDLED;
}

arrayset( g_eEnable[id], NOT_ACTIVE, COLORS_DATA_SIZE );
g_eEnable[id][item] = ACTIVE;

item ? ChatColor( id, "^4* ^1Выбран ^3%s ^1цвет с прозрачностью^3 %d%", g_szMenuItem[item], g_iPrecent[id] ) : ChatColor( id, "^4* ^3затемнение при фраге - ^4выключено!" );

switch(item)
{
case 0: {} //empty key
case 1:
{
// 0 200 255
g_iRed[id] = 0;
g_iGreen[id] = 200;
g_iBlue[id] = 255;
}
case 2:
{
// 0 0 255
g_iRed[id] = 0;
g_iGreen[id] = 0;
g_iBlue[id] = 255;
}
case 3:
{
// 255 255 0
g_iRed[id] = 255;
g_iGreen[id] = 255;
g_iBlue[id] = 0;
}
case 4:
{
// 0 255 0
g_iRed[id] = 0;
g_iGreen[id] = 255;
g_iBlue[id] = 0;
}
case 5:
{
// 255 0 0
g_iRed[id] = 255;
g_iGreen[id] = 0;
g_iBlue[id] = 0;
}
case 6:
{
// 255 0 255
g_iRed[id] = 255;
g_iGreen[id] = 0;
g_iBlue[id] = 255;
}
case 7:
{
g_iRed[id] = 255;
g_iGreen[id] = 255;
g_iBlue[id] = 255;
}
case 8:
{
client_cmd( id, "messagemode ^"set_precent ^"" );
}
}
return PLUGIN_HANDLED;
}

public precent_clcmd(id)
{
new i_Data[6];
read_argv( 1, i_Data, 5 );
new iData = str_to_num(i_Data);

if( iData < 0 || iData > 100 )
{
ChatColor( id, "^4* - ^1неверный формат числа!" );
return;
}

g_iPrecent[id] = iData;
ChatColor( id, "^4* ^1- затемнение при фраге теперь ^3%d%", g_iPrecent[id] );
}

public on_death()
{
static nKiller;
nKiller = read_data(1);

if( !is_user_alive(nKiller) || !is_user_connected(nKiller) )
return

g_iAlpha[nKiller] = 255 - ( 2.55 * g_iPrecent[nKiller] );

if( !g_eEnable[nKiller][0] /* && isVIP(nKiller) */ )
{
message_begin( MSG_ONE, get_user_msgid("ScreenFade"), {0,0,0}, nKiller );
write_short( 1<<10 );
write_short( 1<<10 );
write_short( 0x0000 );
write_byte( g_iRed[nKiller] );
write_byte( g_iGreen[nKiller] );
write_byte( g_iBlue[nKiller] );
write_byte( floatround(g_iAlpha[nKiller]) );
message_end();
}
}

stock ChatColor(const id, const input[], any:...)
{
new count = 1, players[32]
static msg[191]
vformat(msg, 190, input, 3)
replace_all(msg, 190, "!g", "^4")
replace_all(msg, 190, "!y", "^1")
replace_all(msg, 190, "!t", "^3")
if (id) players[0] = id; else get_players(players, count, "ch")
{
for (new i = 0; i < count; i++)
{
if (is_user_connected(players[i]))
{
message_begin(MSG_ONE_UNRELIABLE, g_iSayText, _, players[i])
write_byte(players[i])
write_string(msg)
message_end()
}
}
}
}
Здравствуйте. Подскажите в чём может быть проблема. Пытаюсь Скампелировать под 1.9.0 Выдаёт ошибку. Может что то нужно подправить?
 
В этой теме было размещено решение! Перейти к решению.
Сообщения
278
Реакции
137
You don't need to use colorchat include.
Actually, you can delete all ChatColor and replace it with client_print_color.
You can change all messages again. I forgot to save UTF-8 :)

PHP:
-#include <colorchat>

(line 197)
-g_iAlpha[nKiller] = 255 - ( 2.55 * g_iPrecent[nKiller] );
+g_iAlpha[nKiller] = 255 - ( 2 * g_iPrecent[nKiller] );

(line 208)
-write_byte( floatround(g_iAlpha[nKiller]) );
+write_byte( g_iAlpha[nKiller]);

(all colorchats replaced with client_print_color)
-g_iSayText;
-g_iSayText = get_user_msgid("SayText");
-stock ChatColor(const id, const input[], any:...)
Here;
PHP:
#include <amxmodx>
#include <amxmisc>

#define COLORS_DATA_SIZE 8
#define MAX_PLAYERS 32

#define TIME_TO_SHOW 15 //????? ??????? ?????? ???????? ????.

//#define isVIP(%0) (get_user_flags(%0) & ADMIN_BAN)

const KEYSMENU = MENU_KEY_0|MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5|MENU_KEY_6|MENU_KEY_7|MENU_KEY_8|MENU_KEY_9;

new g_szMenuItem[][] =
{
    "??? ?????",     //0
    "???????",       //1
    "?????",         //2
    "??????",        //3
    "???????",       //4
    "???????",       //5
    "???????",       //6
    "?????"          //7
};

new g_eEnable[MAX_PLAYERS + 1][COLORS_DATA_SIZE], g_iAlpha[MAX_PLAYERS + 1], g_iPrecent[MAX_PLAYERS + 1];
new g_iRed[MAX_PLAYERS + 1], g_iGreen[MAX_PLAYERS + 1], g_iBlue[MAX_PLAYERS + 1];

const ACTIVE = 1;
const NOT_ACTIVE = 0;

public plugin_init()
{
    #define VERSION "1.2"
    register_plugin( "COLORS MENU", VERSION, "DUKKHAZ0R" );
    register_cvar("colors_version", VERSION, FCVAR_SERVER | FCVAR_SPONLY);
 
    register_event( "DeathMsg", "on_death", "a", "1>0" );
 
    register_menu( "menu_title", KEYSMENU, "menu_handler" );
    register_clcmd( "say", "hook_say" );
    register_clcmd( "say_team", "hook_say" );
 
    register_clcmd( "set_precent", "precent_clcmd" );
}

public client_putinserver(id)
{
    //if(!isVIP(id)) return;
 
    g_eEnable[id][0] = ACTIVE;
    g_iPrecent[id] = 50;
 
    set_task( TIME_TO_SHOW.0, "show_colorsmenu", id );
}
     
public hook_say(id)
{
    static szMessage[192];
    read_args( szMessage, charsmax(szMessage) );
    remove_quotes( szMessage );
 
    if( szMessage[0] != '/' ) return;
 
    new gszColorsCmd[][] = { "/colors", "/color", ".color", ".colors" };
 
    for( new i; i < sizeof gszColorsCmd; i++ )
    {
        if( equal( szMessage, gszColorsCmd[i] ) )
            show_colorsmenu(id);
    }
}
 
public show_colorsmenu(id)
{
    //if(!isVIP(id))
    //{
    //    client_print_color( id, id, "^1[^4COLOR^1] ???? ???????? ?????? ^3VIP ^1???????" );
    //    return PLUGIN_HANDLED;
    //}
    static iLen, szMenu[512];
 
    iLen = formatex( szMenu, charsmax(szMenu), "\y?????????? ??? ?????:^n^n" );
 
    for( new i; i < sizeof g_szMenuItem; i++ )
        iLen += formatex( szMenu[iLen], charsmax(szMenu) - iLen, "\r%d.%s%s^n", i+1, g_eEnable[id][i] ? "\y" : "\w", g_szMenuItem[i] );
 
    iLen += formatex( szMenu[iLen], charsmax(szMenu) - iLen, "^n\r9.\w????????????: \d%d%",g_iPrecent[id] );
 
    iLen += formatex( szMenu[iLen], charsmax(szMenu) - iLen, "^n^n\r0.\y?????" );
 
    show_menu( id, KEYSMENU, szMenu, -1, "menu_title" );
    return PLUGIN_HANDLED;
}

public menu_handler(id, item)
{
    if( item == 9 )
    {
        return PLUGIN_HANDLED;
    }
    if( item == 8 )
    {
        client_cmd( id, "messagemode ^"set_precent ^"" );
        return PLUGIN_HANDLED;
    }
 
    arrayset( g_eEnable[id], NOT_ACTIVE, COLORS_DATA_SIZE );
    g_eEnable[id][item] = ACTIVE;
 
    item ? client_print_color( id, id, "^4* ^1?????? ^3%s ^1???? ? ?????????????^3 %d%", g_szMenuItem[item], g_iPrecent[id] ) : client_print_color( id, id, "^4* ^3?????????? ??? ????? - ^4?????????!" );
 
    switch(item)
    {
        case 0: {} //empty key
        case 1:
        {
            // 0 200 255
            g_iRed[id] = 0;
            g_iGreen[id] = 200;
            g_iBlue[id] = 255;
        }
        case 2:
        {
            // 0 0 255
            g_iRed[id] = 0;
            g_iGreen[id] = 0;
            g_iBlue[id] = 255;
        }
        case 3:
        {
            // 255 255 0
            g_iRed[id] = 255;
            g_iGreen[id] = 255;
            g_iBlue[id] = 0;
        }
        case 4:
        {
            // 0 255 0
            g_iRed[id] = 0;
            g_iGreen[id] = 255;
            g_iBlue[id] = 0;
        }
        case 5:
        {
            // 255 0 0
            g_iRed[id] = 255;
            g_iGreen[id] = 0;
            g_iBlue[id] = 0;
        }
        case 6:
        {
            // 255 0 255
            g_iRed[id] = 255;
            g_iGreen[id] = 0;
            g_iBlue[id] = 255;
        }
        case 7:
        {
            g_iRed[id] = 255;
            g_iGreen[id] = 255;
            g_iBlue[id] = 255;
        }
        case 8:
        {
            client_cmd( id, "messagemode ^"set_precent ^"" );
        }
    }
    return PLUGIN_HANDLED;
}

public precent_clcmd(id)
{
    new i_Data[6];
    read_argv( 1, i_Data, 5 );
    new iData = str_to_num(i_Data);
 
    if( iData < 0 || iData > 100 )
    {
        client_print_color( id, id, "^4* - ^1???????? ?????? ?????!" );
        return;
    }
 
    g_iPrecent[id] = iData;
    client_print_color( id, id, "^4* ^1- ?????????? ??? ????? ?????? ^3%d%", g_iPrecent[id] );
}

public on_death()
{
    static nKiller;
    nKiller = read_data(1);

    if( !is_user_alive(nKiller) || !is_user_connected(nKiller) )
        return
 
    g_iAlpha[nKiller] = 255 - ( 2 * g_iPrecent[nKiller] );

    if( !g_eEnable[nKiller][0] /* && isVIP(nKiller) */ )
    {
        message_begin( MSG_ONE, get_user_msgid("ScreenFade"), {0,0,0}, nKiller );
        write_short( 1<<10 );
        write_short( 1<<10 );
        write_short( 0x0000 );
        write_byte( g_iRed[nKiller] );
        write_byte( g_iGreen[nKiller] );
        write_byte( g_iBlue[nKiller] );
        write_byte( g_iAlpha[nKiller]);
        message_end();
    }
}
 
Последнее редактирование:
Сообщения
1,176
Реакции
2,144
Помог
57 раз(а)
:scratch_one-s_head:
 

Вложения

Сообщения
80
Реакции
24
Алексеич, К сожалению немного не то что нужно.

You don't need to use colorchat include.
Actually, you can delete all ChatColor and replace it with client_print_color
Сам в скриптенге не очень боюсь что нибудь не так сделаю. Думаю стоит тогда в раздел Заказы написать чтобы переписали плагин по 1.9.0
6 Сен 2019
BlackSignature, Спасибо большое.
 
Сообщения
80
Реакции
24
BlackSignature, Скажите знак % нельзя указать? Просто в исходнике он вроде как есть

PHP:
item ? ChatColor( id, "^4* ^1Выбран ^3%s ^1цвет с прозрачностью^3 %.0f%%", g_szMenuItem[item], g_fPrecent[id] ) : ChatColor( id, "^4* ^3затемнение при фраге - ^4выключено!" );
а в игре нет

Скриншот 06-09-2019 091841.png
 
Сообщения
2,827
Реакции
1,662
Помог
75 раз(а)
sas333, он блокируется сервером. такой знак использовать нельзя в чате.
 
Сообщения
1,176
Реакции
2,144
Помог
57 раз(а)
sas333, попробуйте так, наверно режет стоковый колорчат
Алексеич, разве? у меня выводится, SNAC есть, выше amxx. Мб в этом как раз и дело (подменяет)
 

Вложения

Сообщения
197
Реакции
16
Помог
1 раз(а)
попробуй двойной поставить (%%). вроде как в худ сообщениях срабатывало, но это не точно
 
Сообщения
80
Реакции
24
BlackSignature, Так работает))

Скриншот 06-09-2019 095018.png
6 Сен 2019
Так понимаю только без пробела будет да?
 
Сообщения
1,176
Реакции
2,144
Помог
57 раз(а)
sas333, я заменил % на %, символы разные. Именно им SNAC и подменяет дефолтный. Если нужен пробел, поменяйте все
Код:
- %.0f%
+ %.0f %
 
Сообщения
80
Реакции
24
BlackSignature, Спасибо, Работает. Так понимаю На форуме Спасибо не как не поставить вам или благодарность?

Скриншот 06-09-2019 095951.png

Скриншот 06-09-2019 100006.png
6 Сен 2019
Вижу только кнопку Жалоба))
 
Статус
В этой теме нельзя размещать новые ответы.

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

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