Поиск раскраска гранаты и цветной след

Статус
В этой теме нельзя размещать новые ответы.
Сообщения
17
Реакции
0
beratcan, потому что, я вам скидывал ссылку не на этот плагин
Я очень благодарен за вашу помощь.Когда я добавляю строку кода, которую вы бросили в плагин, я получаю такую ошибку компиляции после компиляции:



PHP:
AMX Mod X Compiler 1.10.0.5392

Copyright (c) 1997-2006 ITB CompuPhase

Copyright (c) 2004-2013 AMX Mod X Team



team_grenade_trail.sma(19) : error 010: invalid function or declaration

team_grenade_trail.sma(23) : error 021: symbol already defined: "set_entvar"

team_grenade_trail.sma(18) : warning 203: symbol is never used: "fColor"



2 Errors.

Could not locate output file team_grenade_trail.amx (compile failed).


Это строка кода, которую я написал:

PHP:
// ----------------------------------------- CONFIG START -----------------------------------------



// If you are having problems, that not everyone who should see the trail is seeing them, that can

// be due to message type and ping. Using "MSG_ONE_UNRELIABLE" and "MSG_BROADCAST" is better for server

// stability, however using "MSG_ONE" and "MSG_ALL" garanties that client will recieve the update.

#define MSG_TYPE_ALONE MSG_ONE // default: (uncommented)

//#define MSG_TYPE_ALONE MSG_ONE_UNRELIABLE // default: (commented)

#define MSG_TYPE_ALL MSG_ALL // default: (uncommented)

//#define MSG_TYPE_ALL MSG_BROADCAST // default: (commented)





#define CREATE_CONFIG  // default: (uncommented)

// ------------------------------------------ CONFIG END ------------------------------------------



#include <amxmodx>

#include <reapi>



new Float: fColor[3];   

    fColor[0] = float(iRed);

    fColor[1] = float(iGreen);

    fColor[2] = float(iBlue);



    set_entvar(pEntity, var_rendermode, kRenderGlow);

    set_entvar(pEntity, var_renderamt, 1.0);

    set_entvar(pEntity, var_rendercolor, fColor);

    set_entvar(pEntity, var_renderfx, kRenderFxGlowShell);



enum any:CVARS

{

    GT_STATUS,

    GT_COLOR_HE,

    GT_COLOR_FB,

    GT_COLOR_SG,

    GT_TEAM_COLOR

}

new g_Cvar[CVARS];

new g_iSpriteLine, g_iSpriteArrow;



public plugin_precache()

{

    g_iSpriteArrow = precache_model("sprites/arrow1.spr");

    g_iSpriteLine  = precache_model("sprites/smoke.spr");

}



public plugin_init()

{

    register_plugin("[reapi] Grenade Trail", "1.3", "maFFyoZZyk");



    RegisterHookChain(RG_ThrowFlashbang, "ThrowGrenade_FB_Post", .post = true);

    RegisterHookChain(RG_ThrowHeGrenade, "ThrowGrenade_HE_Post", .post = true);

    RegisterHookChain(RG_ThrowSmokeGrenade, "ThrowGrenade_SG_Post", .post = true);



    RegisterCvars();

#if defined CREATE_CONFIG

    AutoExecConfig(true, "grenade_trail");

#endif

}



public ThrowGrenade_HE_Post(const pPlayer, Float:vecStart[3], Float:vecVelocity[3], Float:time)

{

    new pEntity = GetHookChainReturn(ATYPE_INTEGER);

    // set_entvar(pEntity, var_iuser1);

    func_ThrowGrenade_Post(pPlayer, pEntity);

}



public ThrowGrenade_FB_Post(const pPlayer, Float:vecStart[3], Float:vecVelocity[3], Float:time)

{

    new pEntity = GetHookChainReturn(ATYPE_INTEGER);

    // set_entvar(pEntity, var_iuser1);

    func_ThrowGrenade_Post(pPlayer, pEntity);

}



public ThrowGrenade_SG_Post(const pPlayer, Float:vecStart[3], Float:vecVelocity[3], Float:time)

{

    new pEntity = GetHookChainReturn(ATYPE_INTEGER);

    // set_entvar(pEntity, var_iuser1);

    func_ThrowGrenade_Post(pPlayer, pEntity);

}



func_ThrowGrenade_Post(pPlayer, pEntity)

{

    // new pPlayer = get_entvar(pEntity, var_iuser1);

    

    if (!is_entity(pEntity) || !is_user_connected(pPlayer))

        return HC_CONTINUE;   

    

    // if(!is_user_connected(pPlayer)) return HC_CONTINUE;

    new iTemp;

    switch( WeaponIdType:GetGrenadeType(pEntity))

    {

        case WEAPON_FLASHBANG:    iTemp = g_Cvar[GT_COLOR_FB];

        case WEAPON_HEGRENADE:    iTemp = g_Cvar[GT_COLOR_HE];

        case WEAPON_SMOKEGRENADE:    iTemp = g_Cvar[GT_COLOR_SG];

        default: return HC_CONTINUE;

    }

    

    new iRed = iTemp/1000000;

    iTemp %= 1000000;

    new iGreen = iTemp/1000;

    new iBlue = iTemp%1000;

    

    iTemp = clamp(g_Cvar[GT_TEAM_COLOR], 0, 1);

    

    switch( clamp(g_Cvar[GT_STATUS], 0, 3) )

    {

        case 1:

        {

            new CsTeams:iOwnerTeam = get_member(pPlayer, m_iTeam);

            

            for( new iPlayer=1; iPlayer<=MaxClients; iPlayer++ )

            {

                if( is_user_connected(iPlayer) )

                {

                    if( get_member(iPlayer, m_iTeam) == iOwnerTeam )

                    {

                        message_begin(MSG_TYPE_ALONE, SVC_TEMPENTITY, _, iPlayer);

                        write_byte(TE_BEAMFOLLOW);

                        write_short(pEntity);

                        write_short(g_iSpriteArrow);

                        write_byte(15);

                        write_byte(7);

                        write_byte(iRed);

                        write_byte(iGreen);

                        write_byte(iBlue);

                        write_byte(191);

                        message_end();

                        

                        if( iTemp )

                        {

                            message_begin(MSG_TYPE_ALONE, SVC_TEMPENTITY, _, iPlayer);

                            write_byte(TE_BEAMFOLLOW);

                            write_short(pEntity);

                            write_short(g_iSpriteLine);

                            write_byte(15);

                            write_byte(1);

                            switch( iOwnerTeam )

                            {

                                case TEAM_TERRORIST:

                                {

                                    write_byte(255);

                                    write_byte(0);

                                    write_byte(0);

                                }

                                case TEAM_CT:

                                {

                                    write_byte(0);

                                    write_byte(0);

                                    write_byte(255);

                                }

                                default:

                                {

                                    write_byte(127);

                                    write_byte(127);

                                    write_byte(127);

                                }

                            }

                            write_byte(191);

                            message_end();

                        }

                    }

                }

            }

        }

        case 2:

        {

            new CsTeams:iOwnerTeam = get_member(pPlayer, m_iTeam);

            

            for( new iPlayer=1; iPlayer<=MaxClients; iPlayer++ )

            {

                if(is_user_connected(iPlayer))

                {

                    if( is_user_alive(iPlayer) || get_member(iPlayer, m_iTeam) == iOwnerTeam )

                    {

                        message_begin(MSG_TYPE_ALONE, SVC_TEMPENTITY, _, iPlayer);

                        write_byte(TE_BEAMFOLLOW);

                        write_short(pEntity);

                        write_short(g_iSpriteArrow);

                        write_byte(15);

                        write_byte(7);

                        write_byte(iRed);

                        write_byte(iGreen);

                        write_byte(iBlue);

                        write_byte(191);

                        message_end();

                        

                        if( iTemp )

                        {

                            message_begin(MSG_TYPE_ALONE, SVC_TEMPENTITY, _, iPlayer);

                            write_byte(TE_BEAMFOLLOW);

                            write_short(pEntity);

                            write_short(g_iSpriteLine);

                            write_byte(15);

                            write_byte(1);

                            switch( iOwnerTeam )

                            {

                                case TEAM_TERRORIST:

                                {

                                    write_byte(255);

                                    write_byte(0);

                                    write_byte(0);

                                }

                                case TEAM_CT:

                                {

                                    write_byte(0);

                                    write_byte(0);

                                    write_byte(255);

                                }

                                default:

                                {

                                    write_byte(127);

                                    write_byte(127);

                                    write_byte(127);

                                }

                            }

                            write_byte(191);

                            message_end();

                        }

                    }

                }

            }

        }

        case 3:

        {

            message_begin(MSG_TYPE_ALL, SVC_TEMPENTITY);

            write_byte(TE_BEAMFOLLOW);

            write_short(pEntity);

            write_short(g_iSpriteArrow);

            write_byte(15);

            write_byte(7);

            write_byte(iRed);

            write_byte(iGreen);

            write_byte(iBlue);

            write_byte(191);

            message_end();

            

            if( iTemp )

            {

                message_begin(MSG_TYPE_ALL, SVC_TEMPENTITY);

                write_byte(TE_BEAMFOLLOW);

                write_short(pEntity);

                write_short(g_iSpriteLine);

                write_byte(15);

                write_byte(1);

                switch( get_member(pPlayer, m_iTeam) )

                {

                    case TEAM_TERRORIST:

                    {

                        write_byte(255);

                        write_byte(0);

                        write_byte(0);

                    }

                    case TEAM_CT:

                    {

                        write_byte(0);

                        write_byte(0);

                        write_byte(255);

                    }

                    default:

                    {

                        write_byte(127);

                        write_byte(127);

                        write_byte(127);

                    }

                }

                write_byte(191);

                message_end();

            }

        }

    }

    return HC_CONTINUE;

}



RegisterCvars()

{

    bind_pcvar_num(

        create_cvar(

            .name = "amx_grentrail_status",

            .string = "3",

            .flags = FCVAR_SERVER,

            .description = fmt("Кто может видеть Ñлед? 3 - вÑе, 2 - команда и мертвые, 1 - только команда."),

            .has_min = true,

            .min_val = 0.0

        ), g_Cvar[GT_STATUS]

    );

    bind_pcvar_num(

        create_cvar(

            .name = "amx_grentrail_color_fb",

            .string = "000255255",

            .flags = FCVAR_SERVER,

            .description = fmt("Цвет Ñледа Ñлеповой [rrrgggbbb]. 000255255 - краÑный 0; 255 зеленый; 255 Ñиний."),

            .has_min = true,

            .min_val = 0.0

        ), g_Cvar[GT_COLOR_FB]

    );

    bind_pcvar_num(

        create_cvar(

            .name = "amx_grentrail_color_he",

            .string = "255063000",

            .flags = FCVAR_SERVER,

            .description = fmt("Цвет Ñледа оÑколочной [rrrgggbbb]. 255063000 - 255 краÑный; 63 зеленый; 0 Ñиний."),

            .has_min = true,

            .min_val = 0.0

        ), g_Cvar[GT_COLOR_HE]

    );

    bind_pcvar_num(

        create_cvar(

            .name = "amx_grentrail_color_sg",

            .string = "031255127",

            .flags = FCVAR_SERVER,

            .description = fmt("Цвет Ñледа дымовой [ррргггббб]. 031255127 - 31 краÑный; 255 зеленый; 127 Ñиний."),

            .has_min = true,

            .min_val = 0.0

        ), g_Cvar[GT_COLOR_SG]

    );

    bind_pcvar_num(

        create_cvar(

            .name = "amx_grentrail_team_color",

            .string = "1",

            .flags = FCVAR_SERVER,

            .description = fmt("Ð´Ð¾Ð¿Ð¾Ð»Ð½Ð¸Ñ‚ÐµÐ»ÑŒÐ½Ð°Ñ Ð»Ð¸Ð½Ð¸Ñ Ñ Ñ†Ð²ÐµÑ‚Ð¾Ð¼ команды. 1 - включено. 0 - отключен."),

            .has_min = true,

            .min_val = 0.0

        ), g_Cvar[GT_TEAM_COLOR]

    );

}
16 Июл 2022
beratcan,
Код:
Success
Output: .complied\visual_grenade_trails.amxx
PHP:
team_grenade_trail.sma(20) : error 088: number of arguments does not match definition
 
Сообщения
458
Реакции
263
Помог
9 раз(а)
beratcan, Use my plugin, there will be no problems, I have adjusted it to suit your skills. Just compile & use
 
Сообщения
775
Реакции
293
Помог
11 раз(а)
@beratcan,я же ясно написал, добавить после
new iBlue = iTemp%1000;

16 Июл 2022
вон, человек предложил свой вариант, почему бы его не попробовать
 
Сообщения
17
Реакции
0
Неприемлемый контент
beratcan, Use my plugin, there will be no problems, I have adjusted it to suit your skills. Just compile & use
Dediklerini zaten yükledim ve bu tür bir hata atmaya devam ediyor.
PHP:
AMX Mod X Compiler 1.10.0.5392
Copyright (c) 1997-2006 ITB CompuPhase
Copyright (c) 2004-2013 AMX Mod X Team

visual_grenade_trails.sma(20) : error 088: number of arguments does not match definition

1 Error.
Could not locate output file visual_grenade_trails.amx (compile failed).
 
Статус
В этой теме нельзя размещать новые ответы.

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

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