ReHLDS/ReAPI Parachute для ZP

victormevsa

Пользователь
Регистрация
5 Янв 2018
Сообщения
129
Симпатии
31
Пол
Мужской
Здравствуйте, такой вопрос:
- Поставил плагин от Leo_[BH] Parachute 3.0, сделал изменение в виде проверки на то зомби или нет.
Изначально работало всё как надо( только у людей был парашют), но после смены карты не работало так.

Вот код:
#include <amxmodx>
#include <reapi>
#include <engine>
#include <zombieplague>

new pFallSpeed = 100

new bool:g_is_alive[33]

public plugin_init()
{
    register_plugin("[ZP] Addon: Parachute", "3.1", "Leo_[BH] & Slove.")

    RegisterHookChain(RG_CBasePlayer_PreThink, "RG_client_PreThink");
  
    RegisterHookChain(RG_CBasePlayer_Killed, "RG_Player_Killed", 0);
    RegisterHookChain(RG_CBasePlayer_Spawn, "RG_Spawn_Post", 1);
}

public RG_client_PreThink(id)
{
    if(!g_is_alive[id] && zp_get_user_zombie(id)) return;

    new Float:fallspeed = pFallSpeed * -1.0

    new button = get_entvar(id, EntVars:var_button); // get_user_button(id)
    new oldbutton = get_entvar(id, EntVars:var_oldbuttons); // get_user_oldbutton(id)

    if (get_entvar(id, EntVars:var_gravity) == 0.1) set_entvar(id, EntVars:var_gravity, 1.0)

    if (button & IN_USE)
    {
        new Float:velocity[3]
        entity_get_vector(id, EV_VEC_velocity, velocity)

        if (velocity[2] < 0.0)
        {
            set_entvar(id, EntVars:var_gravity, 0.1)

            velocity[2] = (velocity[2] + 40.0 < fallspeed) ? velocity[2] + 40.0 : fallspeed
            entity_set_vector(id, EV_VEC_velocity, velocity)
        }
    }
    else if ((oldbutton & IN_USE))
    {
        set_entvar(id, EntVars:var_gravity, 1.0)
    }
}

// // // // // // // // // // // // // // //

public RG_Spawn_Post(id)
{
    if(is_user_alive(id))
    {
        g_is_alive[id] = true
    }
}

public RG_Player_Killed(victim, attacker)
{
    g_is_alive[victim] = false
}

public client_disconnected(id)
{
    g_is_alive[id] = false
}
Может кто знает почему?
 

Анатолий

Заблокированные
Пользователь
Регистрация
8 Июн 2017
Сообщения
686
Симпатии
196
Пол
Мужской
ВКонтакте
e1337ace
Здравствуйте, такой вопрос:
- Поставил плагин от Leo_[BH] Parachute 3.0, сделал изменение в виде проверки на то зомби или нет.
Изначально работало всё как надо( только у людей был парашют), но после смены карты не работало так.

Вот код:
#include <amxmodx>
#include <reapi>
#include <engine>
#include <zombieplague>

new pFallSpeed = 100

new bool:g_is_alive[33]

public plugin_init()
{
    register_plugin("[ZP] Addon: Parachute", "3.1", "Leo_[BH] & Slove.")

    RegisterHookChain(RG_CBasePlayer_PreThink, "RG_client_PreThink");
 
    RegisterHookChain(RG_CBasePlayer_Killed, "RG_Player_Killed", 0);
    RegisterHookChain(RG_CBasePlayer_Spawn, "RG_Spawn_Post", 1);
}

public RG_client_PreThink(id)
{
    if(!g_is_alive[id] && zp_get_user_zombie(id)) return;

    new Float:fallspeed = pFallSpeed * -1.0

    new button = get_entvar(id, EntVars:var_button); // get_user_button(id)
    new oldbutton = get_entvar(id, EntVars:var_oldbuttons); // get_user_oldbutton(id)

    if (get_entvar(id, EntVars:var_gravity) == 0.1) set_entvar(id, EntVars:var_gravity, 1.0)

    if (button & IN_USE)
    {
        new Float:velocity[3]
        entity_get_vector(id, EV_VEC_velocity, velocity)

        if (velocity[2] < 0.0)
        {
            set_entvar(id, EntVars:var_gravity, 0.1)

            velocity[2] = (velocity[2] + 40.0 < fallspeed) ? velocity[2] + 40.0 : fallspeed
            entity_set_vector(id, EV_VEC_velocity, velocity)
        }
    }
    else if ((oldbutton & IN_USE))
    {
        set_entvar(id, EntVars:var_gravity, 1.0)
    }
}

// // // // // // // // // // // // // // //

public RG_Spawn_Post(id)
{
    if(is_user_alive(id))
    {
        g_is_alive[id] = true
    }
}

public RG_Player_Killed(victim, attacker)
{
    g_is_alive[victim] = false
}

public client_disconnected(id)
{
    g_is_alive[id] = false
}
Может кто знает почему?
if(!g_is_alive[id] && !zp_get_user_zombie(id)) return
Ты знак ! пропустил
 

Vaqtincha

aggressive
Разработчик
Скриптер
Регистрация
28 Янв 2018
Сообщения
958
Симпатии
682
Пол
Мужской
Анатолий, не знак пропустил а оператор (&& -> ||) перепутал
а плагин вообще бред
 

victormevsa

Пользователь
Регистрация
5 Янв 2018
Сообщения
129
Симпатии
31
Пол
Мужской

Carrion

Пользователь
Регистрация
28 Мар 2020
Сообщения
12
Симпатии
1
Код:
#include <amxmodx>
#include <reapi>
#include <zombieplague>
#define IN_USE            (1<<5)
#define    FL_ONGROUND        (1<<9)
new g_bAlive[33];
public plugin_init() {
    register_plugin("Parachute", "1.0", "Vaqtincha")    // Reapi modification by mforce
    RegisterHookChain(RG_CBasePlayer_ObjectCaps, "fwd_objectcaps");
    RegisterHookChain(RG_CBasePlayer_Spawn, "playerspawn_post", true);
    RegisterHookChain(RG_CBasePlayer_Killed, "playerkilled_post", true);
}
public client_putinserver(id)
    g_bAlive[id] = 0;
public playerspawn_post(id)
    g_bAlive[id] = is_user_alive(id);
public playerkilled_post(id)
    g_bAlive[id] = 0;
public fwd_objectcaps(id) {
    if(zp_get_user_zombie(id) || !g_bAlive[id] || ~get_entvar(id, var_button) & IN_USE || get_entvar(id, var_flags) & FL_ONGROUND) {
        return
    }
    static Float:velocity[3]; get_entvar(id, var_velocity, velocity);
    if(velocity[2] < 0) {
        velocity[2] = (velocity[2] + 40.0 < -100) ? velocity[2] + 40.0 : -100.0
        set_entvar(id, var_velocity, velocity);
    }
}
 

Vaqtincha

aggressive
Разработчик
Скриптер
Регистрация
28 Янв 2018
Сообщения
958
Симпатии
682
Пол
Мужской

Carrion

Пользователь
Регистрация
28 Мар 2020
Сообщения
12
Симпатии
1
im using this

#include <amxmodx>
#include <reapi>
#pragma semicolon 1
public plugin_init() {
register_plugin("Parachute", "1.1", "ReHLDS Team");
RegisterHookChain(RG_PM_AirMove, "PM_AirMove", .post = false);
}
public PM_AirMove(const playerIndex) {
if (!(get_entvar(playerIndex, var_button) & IN_USE) || get_entvar(playerIndex, var_waterlevel) > 0) return;
new Float:flVelocity[3];
get_entvar(playerIndex, var_velocity, flVelocity);
if (flVelocity[2] < 0.0) {
flVelocity[2] = (flVelocity[2] + 40.0 < -100.0) ? flVelocity[2] + 40.0 : -100.0;
set_entvar(playerIndex, var_sequence, ACT_WALK);
set_entvar(playerIndex, var_gaitsequence, ACT_IDLE);
set_pmove(pm_velocity, flVelocity);
}
}
 
Сверху Снизу