Иконка ресурса

ReParachute 1.5

Нет прав для скачивания
Сообщения
3,579
Реакции
1,569
Помог
137 раз(а)
Minni, а тебе всё так и скажи?
Создавалось куча энтити на одного игрока, вместо одной.
 
Сообщения
2,143
Реакции
1,225
Помог
44 раз(а)
Сообщения
3,579
Реакции
1,569
Помог
137 раз(а)
Minni, зачем ты дифф сюда кинул? Объясняю по порядку. Установив одному клиенту данный плагин на сервер, начались жалобы на то, что парашют "плохо работает", "обрывается в середине полета" и тд. После проведения данных манипуляций в коде, проблема решилась.
 
Сообщения
2,143
Реакции
1,225
Помог
44 раз(а)
Nordic Warrior, допустим, это "решило" проблему с прерыванием. Я не понял, в чем заключается фикс кучи создаваемых энтити на одного игрока, о котором ты писал?
 
Сообщения
3,579
Реакции
1,569
Помог
137 раз(а)
Minni, client_print(id, print_chat, "my ent = %i", para_ent[id])

Оригинал плагина:

20200408104220_1.jpg

Мой вариант:

20200408104700_1.jpg
 
Сообщения
2,143
Реакции
1,225
Помог
44 раз(а)
Nordic Warrior, изи фикс:
Код:
#include <amxmodx>
#include <reapi>

/* If you want to add parachute model, please delete // from the beginning of define. Example: #define REPARACHUTE_MODEL
And if you want to change model name, just change parachute_model constant.
Attention please! Do not change #if defined - #else - #endif commands. Yours sincerely. */

#define REPARACHUTE_MODEL

#if defined REPARACHUTE_MODEL
new const parachute_model[] = "models/csd_parasut.mdl";
#endif

new bool:sv_parachute;
new cvar_sv_parachute;
new HookChain:HC_PM;

public plugin_init() {
    register_plugin("ReParachute", "1.4", "PurposeLess");

    #if defined REPARACHUTE_MODEL
    DisableHookChain((HC_PM = RegisterHookChain(RG_PM_Move, "@PM_Move", .post=false)));
    #else
    DisableHookChain((HC_PM = RegisterHookChain(RG_PM_AirMove, "@PM_AirMove", .post=false)));
    #endif

    cvar_sv_parachute = create_cvar("sv_parachute", "1", _, "Enable / Disable Parachute", true, 0.0, true, 1.0);
    bind_pcvar_num(cvar_sv_parachute, sv_parachute);
    hook_cvar_change(cvar_sv_parachute, "@sv_parachute");
}

public plugin_cfg()
{
    if(sv_parachute)
    {
        EnableHookChain(HC_PM);
    }
}

@sv_parachute(pcvar, const old_value[], const new_value[])
{
    str_to_num(new_value) ? EnableHookChain(HC_PM) : DisableHookChain(HC_PM);
}

#if defined REPARACHUTE_MODEL
new para_ent[MAX_CLIENTS + 1], parachute_model_index;

public plugin_precache()
{
    parachute_model_index = precache_model(parachute_model);
}

@PM_Move(const id)
{
    if(get_pmove(pm_dead))
    {
        return HC_CONTINUE;
    }

    if(get_entvar(id, var_button) & IN_USE)
    {
        if(get_pmove(pm_waterlevel) == 0 && get_pmove(pm_onground) == -1)
        {
            new Float:velocity[3];
            get_pmove(pm_velocity, velocity);

            if(velocity[2] < 0.0)
            {
                if(!para_ent[id])
                {
                    //log_amx("Create ENT");
                    para_ent[id] = rg_create_entity("info_target");

                    if(para_ent[id] > 0)
                    {
                        set_entvar(para_ent[id], var_model, parachute_model);
                        set_entvar(para_ent[id], var_modelindex, parachute_model_index);
                        set_entvar(para_ent[id], var_movetype, MOVETYPE_FOLLOW);
                        set_entvar(para_ent[id], var_aiment, id);
                    }
                }

                if(para_ent[id] > 0)
                {
                    //log_amx("Use ENT %d", para_ent[id]);
                    velocity[2] = (velocity[2] + 40.0 < -100.0) ? velocity[2] + 40.0 : -100.0;
                    set_entvar(id, var_sequence, ACT_WALK);
                    set_entvar(id, var_gaitsequence, ACT_IDLE);
                    set_pmove(pm_velocity, velocity);
                    set_movevar(mv_gravity, 80.0);

                    new Float:frame = get_entvar(para_ent[id], var_frame);

                    if(frame < 0.0 || frame > 254.0)
                    {
                        set_entvar(para_ent[id], var_sequence, 1);
                        set_entvar(para_ent[id], var_frame, 0.0);
                    }
                    else
                    {
                        set_entvar(para_ent[id], var_frame, frame + 1.0);
                    }
                }
                return HC_CONTINUE;
            }
            else {
                if(para_ent[id] > 0)
                {
                    set_entvar(para_ent[id], var_flags, FL_KILLME);
                    para_ent[id] = 0;
                }
            }
        }
    }

    return HC_CONTINUE;
}

public client_disconnected(id)
{
    if(para_ent[id] > 0)
    {
        set_entvar(para_ent[id], var_flags, FL_KILLME);
        para_ent[id] = 0;
    }
}
#else
@PM_AirMove(const id)
{
    if(~get_entvar(id, var_button) & IN_USE || get_pmove(pm_waterlevel) > 0 || get_pmove(pm_dead))
    {
        return;
    }

    new Float:velocity[3];
    get_pmove(pm_velocity, velocity);

    if(velocity[2] < 0.0)
    {
        velocity[2] = (velocity[2] + 40.0 < -100.0) ? velocity[2] + 40.0 : -100.0;
        set_entvar(id, var_sequence, ACT_WALK);
        set_entvar(id, var_gaitsequence, ACT_IDLE);
        set_pmove(pm_velocity, velocity);
        set_movevar(mv_gravity, 80.0);
    }
}
#endif
 
Сообщения
2,143
Реакции
1,225
Помог
44 раз(а)
Логи (обрати внимание на количество вызовов):
Код:
С зажатым Е и прыжками вприсяде на одном месте:
L 04/08/2020 - 13:47:55: [reparachute.amxx] Create ENT
L 04/08/2020 - 13:47:55: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:47:55: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:47:55: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:47:55: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:47:55: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:47:55: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:47:55: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:47:55: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:47:55: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:47:55: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:47:55: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:47:55: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:47:55: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:47:55: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:47:55: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:47:55: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:47:55: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:47:55: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:47:55: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:47:55: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:47:55: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:47:55: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:47:55: [reparachute.amxx] Create ENT
L 04/08/2020 - 13:47:55: [reparachute.amxx] Use ENT 332
L 04/08/2020 - 13:47:55: [reparachute.amxx] Use ENT 332
L 04/08/2020 - 13:47:55: [reparachute.amxx] Use ENT 332
L 04/08/2020 - 13:47:55: [reparachute.amxx] Use ENT 332
L 04/08/2020 - 13:47:55: [reparachute.amxx] Use ENT 332
L 04/08/2020 - 13:47:55: [reparachute.amxx] Use ENT 332
L 04/08/2020 - 13:47:55: [reparachute.amxx] Use ENT 332
L 04/08/2020 - 13:47:55: [reparachute.amxx] Use ENT 332
L 04/08/2020 - 13:47:55: [reparachute.amxx] Use ENT 332
L 04/08/2020 - 13:47:55: [reparachute.amxx] Use ENT 332
L 04/08/2020 - 13:47:56: [reparachute.amxx] Use ENT 332
L 04/08/2020 - 13:47:56: [reparachute.amxx] Use ENT 332
L 04/08/2020 - 13:47:56: [reparachute.amxx] Use ENT 332
L 04/08/2020 - 13:47:56: [reparachute.amxx] Use ENT 332
L 04/08/2020 - 13:47:56: [reparachute.amxx] Use ENT 332
L 04/08/2020 - 13:47:56: [reparachute.amxx] Use ENT 332
L 04/08/2020 - 13:47:56: [reparachute.amxx] Use ENT 332
L 04/08/2020 - 13:47:56: [reparachute.amxx] Use ENT 332
L 04/08/2020 - 13:47:56: [reparachute.amxx] Use ENT 332
L 04/08/2020 - 13:47:56: [reparachute.amxx] Use ENT 332
L 04/08/2020 - 13:47:56: [reparachute.amxx] Use ENT 332
L 04/08/2020 - 13:47:56: [reparachute.amxx] Use ENT 332
L 04/08/2020 - 13:47:56: [reparachute.amxx] Use ENT 332
L 04/08/2020 - 13:47:56: [reparachute.amxx] Use ENT 332
L 04/08/2020 - 13:47:56: [reparachute.amxx] Use ENT 332
L 04/08/2020 - 13:47:56: [reparachute.amxx] Use ENT 332
L 04/08/2020 - 13:47:56: [reparachute.amxx] Create ENT
L 04/08/2020 - 13:47:56: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:47:56: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:47:56: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:47:56: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:47:56: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:47:56: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:47:56: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:47:56: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:47:56: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:47:56: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:47:56: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:47:56: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:47:56: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:47:56: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:47:56: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:47:56: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:47:56: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:47:56: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:47:56: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:47:56: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:47:56: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:47:56: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:47:57: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:47:57: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:47:57: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:47:57: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:47:57: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:47:57: [reparachute.amxx] Create ENT
L 04/08/2020 - 13:47:57: [reparachute.amxx] Use ENT 332
L 04/08/2020 - 13:47:57: [reparachute.amxx] Use ENT 332
L 04/08/2020 - 13:47:57: [reparachute.amxx] Use ENT 332
L 04/08/2020 - 13:47:57: [reparachute.amxx] Use ENT 332
L 04/08/2020 - 13:47:57: [reparachute.amxx] Use ENT 332
L 04/08/2020 - 13:47:57: [reparachute.amxx] Use ENT 332
L 04/08/2020 - 13:47:57: [reparachute.amxx] Use ENT 332
L 04/08/2020 - 13:47:57: [reparachute.amxx] Use ENT 332
L 04/08/2020 - 13:47:57: [reparachute.amxx] Use ENT 332
L 04/08/2020 - 13:47:57: [reparachute.amxx] Use ENT 332
L 04/08/2020 - 13:47:57: [reparachute.amxx] Use ENT 332
L 04/08/2020 - 13:47:57: [reparachute.amxx] Use ENT 332
L 04/08/2020 - 13:47:57: [reparachute.amxx] Use ENT 332
L 04/08/2020 - 13:47:57: [reparachute.amxx] Use ENT 332
L 04/08/2020 - 13:47:57: [reparachute.amxx] Use ENT 332
L 04/08/2020 - 13:47:57: [reparachute.amxx] Use ENT 332
L 04/08/2020 - 13:47:57: [reparachute.amxx] Use ENT 332
L 04/08/2020 - 13:47:58: [reparachute.amxx] Create ENT
L 04/08/2020 - 13:47:58: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:47:58: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:47:58: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:47:58: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:47:58: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:47:58: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:47:58: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:47:58: [reparachute.amxx] Use ENT 328
Код:
С зажатым Е и прыжками вприсяде на одном месте:
L 04/08/2020 - 13:50:51: [reparachute.amxx] Create ENT
L 04/08/2020 - 13:50:51: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:50:51: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:50:51: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:50:51: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:50:51: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:50:51: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:50:51: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:50:52: [reparachute.amxx] Create ENT
L 04/08/2020 - 13:50:52: [reparachute.amxx] Use ENT 340
L 04/08/2020 - 13:50:52: [reparachute.amxx] Use ENT 340
L 04/08/2020 - 13:50:52: [reparachute.amxx] Use ENT 340
L 04/08/2020 - 13:50:52: [reparachute.amxx] Use ENT 340
L 04/08/2020 - 13:50:53: [reparachute.amxx] Use ENT 340
L 04/08/2020 - 13:50:53: [reparachute.amxx] Use ENT 340
L 04/08/2020 - 13:50:53: [reparachute.amxx] Use ENT 340
L 04/08/2020 - 13:50:53: [reparachute.amxx] Use ENT 340
L 04/08/2020 - 13:50:53: [reparachute.amxx] Use ENT 340
L 04/08/2020 - 13:50:53: [reparachute.amxx] Use ENT 340
L 04/08/2020 - 13:50:53: [reparachute.amxx] Use ENT 340
L 04/08/2020 - 13:50:54: [reparachute.amxx] Create ENT
L 04/08/2020 - 13:50:54: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:50:54: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:50:54: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:50:54: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:50:55: [reparachute.amxx] Create ENT
L 04/08/2020 - 13:50:55: [reparachute.amxx] Use ENT 340
L 04/08/2020 - 13:50:55: [reparachute.amxx] Use ENT 340
L 04/08/2020 - 13:50:55: [reparachute.amxx] Use ENT 340
L 04/08/2020 - 13:50:55: [reparachute.amxx] Use ENT 340
L 04/08/2020 - 13:50:55: [reparachute.amxx] Use ENT 340
L 04/08/2020 - 13:50:55: [reparachute.amxx] Use ENT 340
L 04/08/2020 - 13:50:55: [reparachute.amxx] Use ENT 340
L 04/08/2020 - 13:50:55: [reparachute.amxx] Use ENT 340
L 04/08/2020 - 13:50:55: [reparachute.amxx] Use ENT 340
L 04/08/2020 - 13:50:55: [reparachute.amxx] Use ENT 340
L 04/08/2020 - 13:50:55: [reparachute.amxx] Use ENT 340
L 04/08/2020 - 13:50:56: [reparachute.amxx] Create ENT
L 04/08/2020 - 13:50:56: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:50:56: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:50:56: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:50:56: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:50:56: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:50:56: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:50:56: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:50:56: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:50:56: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:50:56: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:50:56: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:50:57: [reparachute.amxx] Create ENT
L 04/08/2020 - 13:50:57: [reparachute.amxx] Use ENT 340
L 04/08/2020 - 13:50:57: [reparachute.amxx] Use ENT 340
L 04/08/2020 - 13:50:57: [reparachute.amxx] Use ENT 340
L 04/08/2020 - 13:50:57: [reparachute.amxx] Use ENT 340
L 04/08/2020 - 13:50:57: [reparachute.amxx] Use ENT 340
L 04/08/2020 - 13:50:58: [reparachute.amxx] Use ENT 340
L 04/08/2020 - 13:50:58: [reparachute.amxx] Use ENT 340
L 04/08/2020 - 13:50:58: [reparachute.amxx] Create ENT
L 04/08/2020 - 13:50:58: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:50:58: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:50:58: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:50:59: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:50:59: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:50:59: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:50:59: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:50:59: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:50:59: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:50:59: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:51:00: [reparachute.amxx] Create ENT
L 04/08/2020 - 13:51:00: [reparachute.amxx] Use ENT 340
L 04/08/2020 - 13:51:00: [reparachute.amxx] Use ENT 340
L 04/08/2020 - 13:51:00: [reparachute.amxx] Use ENT 340
L 04/08/2020 - 13:51:00: [reparachute.amxx] Use ENT 340
L 04/08/2020 - 13:51:00: [reparachute.amxx] Use ENT 340
L 04/08/2020 - 13:51:00: [reparachute.amxx] Use ENT 340
L 04/08/2020 - 13:51:00: [reparachute.amxx] Use ENT 340
L 04/08/2020 - 13:51:00: [reparachute.amxx] Use ENT 340
L 04/08/2020 - 13:51:00: [reparachute.amxx] Use ENT 340
L 04/08/2020 - 13:51:00: [reparachute.amxx] Use ENT 340
L 04/08/2020 - 13:51:01: [reparachute.amxx] Create ENT
L 04/08/2020 - 13:51:01: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:51:01: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:51:01: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:51:01: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:51:01: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:51:01: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:51:01: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:51:01: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:51:01: [reparachute.amxx] Use ENT 328
L 04/08/2020 - 13:51:02: [reparachute.amxx] Create ENT
L 04/08/2020 - 13:51:02: [reparachute.amxx] Use ENT 340
L 04/08/2020 - 13:51:02: [reparachute.amxx] Use ENT 340
L 04/08/2020 - 13:51:02: [reparachute.amxx] Use ENT 340
L 04/08/2020 - 13:51:02: [reparachute.amxx] Use ENT 340
L 04/08/2020 - 13:51:02: [reparachute.amxx] Use ENT 340
L 04/08/2020 - 13:51:02: [reparachute.amxx] Use ENT 340
L 04/08/2020 - 13:51:02: [reparachute.amxx] Use ENT 340
L 04/08/2020 - 13:51:02: [reparachute.amxx] Use ENT 340
L 04/08/2020 - 13:51:02: [reparachute.amxx] Use ENT 340
/SPOILER]
 
Сообщения
175
Реакции
11
Ребят, нельзя ли в данном плагине сделать разделение 1) Подефалту випам 2) покупать остальным (на 1 карту) ?
Есть аналогичный плагин, но там модель откючить не получается
 
Сообщения
1,698
Реакции
1,510
Помог
26 раз(а)
Said, да, можно.
 
  • Like a Boss
Реакции: Ayk
Сообщения
175
Реакции
11
fl0wer, как? Пару раз пересматривал строки и не нашел там ни админ флагов, ни указание денег для покупки
 
Сообщения
175
Реакции
11
Nordic Warrior,
а, ну это другое дело :D

Это уже для гуру скриптинга, а не для смертных, как я

Я спрашивал есть ли такая настройка тут, а не возможность допилить плагин, допилить то вроде все можно когда код открытый и ты умеешь писать))
 
Сообщения
53
Реакции
12
Подскажите, где в исходнике плагина"ReParachure 1.5", нужно поменять квар, что бы зомби не могли использовать парашют. Спасибо
 
Сообщения
678
Реакции
56
Помог
16 раз(а)
Обратите внимание, если вы хотите заключить сделку с этим пользователем, он заблокирован
Valve, Ну как бы тут такого нету. Тебе дописывать нужно под ЗМ.
 

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

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