в системе AES в покупке anew хочу сделать что можно было купить прыжки и невидимость.

Статус
В этой теме нельзя размещать новые ответы.
Сообщения
137
Реакции
9
Помог
3 раз(а)
Вообщем здравствуйте. прописывал от плагинов не получилось. говорят что лучше вносить функцию в сам плагин но не знаю как. помогите. мультиджумп это то что я пытался подвязать а аес это то куда надо внести его
 

Download all Attachments

Последнее редактирование:
Сообщения
2,288
Реакции
1,737
Помог
31 раз(а)
denbtr, Лучше приложите исходный код (желательно с diff) под спойлер
 
Сообщения
137
Реакции
9
Помог
3 раз(а)
Pokemoshka,
Код:
/*
    Advanced Experience System
    by serfreeman1337        http://gf.hldm.org/
*/

/*
    Random CSTRIKE Bonuses
*/

#include <amxmodx>
#include <aes_v>
#include <engine>
#include <reapi>

#define PLUGIN "AES: Bonus CSTRIKE"
#define VERSION "0.5.8 Vega[REAPI]"
#define AUTHOR "serfreeman1337/sonyx"
#define LASTUPDATE "15, December (12), 2017"

#if AMXX_VERSION_NUM < 183
    #include <colorchat>
    
    #define print_team_default DontChange
    #define print_team_grey Grey
    #define print_team_red Red
    #define print_team_blue Blue
    
    #define MAX_NAME_LENGTH    32
    #define MAX_PLAYERS 32
    
    #define client_disconnected client_disconnect
#endif

enum _:
{
    SUPER_NICHEGO,
    SUPER_NADE,
    SUPER_DEAGLE
};

enum DamagerModes
{
    Disable,
    ModeAll,
    ModeIfVisible
};

new g_PlayerPos[MAX_PLAYERS + 1], g_iSyncMsg, g_iSyncMsg2, DamagerModes:g_ModeDam[MAX_PLAYERS + 1];
new const Float:g_flCoords[][] = { {0.55, 0.55}, {0.5, 0.55}, {0.55, 0.5}, {0.45, 0.5}, {0.45, 0.45}, {0.5, 0.45}, {0.55, 0.45}, {0.45, 0.55} };
new g_players[MAX_PLAYERS + 1];
new bool: g_PointDam[MAX_PLAYERS + 1] = false;

public plugin_init()
{
    register_plugin(PLUGIN, VERSION, AUTHOR);
    
    RegisterHookChain(RG_CBasePlayer_TakeDamage, "CBasePlayer_TakeDamage", false);
    RegisterHookChain(RG_CBasePlayer_Killed, "CBasePlayer_Killed_Post", true);
    register_event ("Damage", "EventDamage", "b", "2!0");
    
    g_iSyncMsg = CreateHudSyncObj();
    g_iSyncMsg2 = CreateHudSyncObj();
}

public client_disconnected(id)
    g_players[id] = SUPER_NICHEGO; // сбрасываем возможности на дисконнекте

public CBasePlayer_Killed_Post(const victim, const killer)
    g_players[victim] = SUPER_NICHEGO; // сбрасываем возможности при смерти

public CBasePlayer_TakeDamage(const id, idinflictor, idattacker, Float:damage)
{
    if(!is_user_connected(idattacker))
        return HC_CONTINUE;
    
    if(g_players[idattacker])
    {   
        if(idattacker == idinflictor && get_member(get_member(idattacker, m_pActiveItem), m_iId) == WEAPON_DEAGLE && (g_players[idattacker] & (1 << SUPER_DEAGLE)))
        {
            damage *= 2.0;
        }
        else if(FClassnameIs(idinflictor, "grenade") && (g_players[idattacker] & (1 << SUPER_NADE)))
        {
            set_task(0.5,"deSetNade",idattacker);
            damage *= 3.0;
        }
        
        SetHookChainArg(4, ATYPE_FLOAT, damage);
    }
    return HC_CONTINUE;
}

public EventDamage(iVictim)
{
    static iKiller;
    iKiller = get_user_attacker(iVictim);

    if(!iKiller || iKiller > MAX_PLAYERS) return;

    new iPos = ++g_PlayerPos[iKiller];

    if(iPos == sizeof(g_flCoords))
        iPos = g_PlayerPos[iKiller] = 0;

    if (g_PointDam[iKiller] && iVictim != iKiller)
    {
        if (g_ModeDam[iKiller] == ModeAll || (g_ModeDam[iKiller] == ModeIfVisible && is_visible(iVictim, iKiller)))
        {
            set_hudmessage(0, 100, 200, Float:g_flCoords[iPos][0], Float:g_flCoords[iPos][1], 0, 0.0, 1.0, 0.0, 0.0);
            ShowSyncHudMsg(iKiller, g_iSyncMsg, "%i^n", read_data(2));
        }
    }
    if (g_PointDam[iVictim])
    {
        set_hudmessage(200, 100, 0, Float:g_flCoords[iPos][0], Float:g_flCoords[iPos][1], 0, 0.0, 1.0, 0.0, 0.0);
        ShowSyncHudMsg(iVictim, g_iSyncMsg2, "%i^n", read_data(2));
    }
}

public deSetNade(id)
    g_players[id] &= ~(1<<SUPER_NADE);

public roundBonus_GiveDefuser(id,cnt)
{
    if(!cnt)
        return false;
    
    if(get_member(id, m_iTeam) != TEAM_CT)
        return false;

    rg_give_item(id, "item_thighpack");
    
    return true;
}

public roundBonus_GiveNV(id,cnt)
{
    if(!cnt)
        return false;
    
    set_member(id, m_bHasNightVision, 1);
    
    return true;
}

public roundBonus_Dmgr(id,DamagerModes:cnt)
{
    if(cnt <= Disable)
        return false;
    
    g_PointDam[id] = true;
    g_ModeDam[id] = (ModeAll < cnt <= ModeIfVisible) ? cnt : ModeAll;
    
    return true;
}

public roundBonus_GiveArmor(id,cnt)
{
    if(!cnt)
        return false;
    
    new iArmor = rg_get_user_armor(id);
    
    switch(cnt)
    {
        case 1:rg_set_user_armor(id, max(100, iArmor), ARMOR_KEVLAR);
        case 2:rg_set_user_armor(id, max(100, iArmor), ARMOR_VESTHELM);
        default:rg_set_user_armor(id, max(cnt, iArmor), ARMOR_VESTHELM);
    }
    
    return true;
}

public roundBonus_GiveHP(id,cnt)
{
    if(!cnt)
        return false;

    set_entvar(id, var_health, (Float:get_entvar(id, var_health) + float(cnt)));
    return true;
}

public pointBonus_Dmgr(id)
{
    g_PointDam[id] = true;
    
    return true;
}

public pointBonus_Give10000M(id)
{
    if(!is_user_alive(id))
    {
        client_print_color(id,0,"%L %L",id,"AES_TAG",id,"AES_ANEW_ALIVE");
        return false;
    }
    
    rg_add_account(id, 10000);
    
    return true;
    
}

public pointBonus_Set100HP(id)
{
    if(!is_user_alive(id))
    {
        client_print_color(id,0,"%L %L",id,"AES_TAG",id,"AES_ANEW_ALIVE");
        return false;
    }
    
    set_entvar(id, var_health, 100.0);
    
    return true;
}   

public pointBonus_Set200HP(id)
{
    if(is_user_alive(id))
    {
        client_print_color(id,0,"%L %L",id,"AES_TAG",id,"AES_ANEW_ALIVE");
        return false;
    }
    
    set_entvar(id, var_health, 200.0);
    
    return true;
}

public pointBonus_Set200CP(id)
{
    if(is_user_alive(id))
    {
        client_print_color(id,0,"%L %L",id,"AES_TAG",id,"AES_ANEW_ALIVE");
        return false;
    }

    rg_set_user_armor(id, 200, ARMOR_VESTHELM);
    
    return true;
}

public pointBonus_GiveMegaGrenade(id)
{
    if(!is_user_alive(id))
    {
        client_print_color(id,0,"%L %L",id,"AES_TAG",id,"AES_ANEW_ALIVE");
        return false;
    }
    
    if(!user_has_weapon(id,CSW_HEGRENADE))
    {
        rg_give_item(id, "weapon_hegrenade");
    }
    
    g_players[id] |= (1<<SUPER_NADE);
    
    client_print_color(id,0,"%L %L",id,"AES_TAG",id,"AES_BONUS_GET_MEGAGRENADE");
    
    return true;
}

public pointBonus_GiveMegaDeagle(id){
    if(!is_user_alive(id))
    {
        client_print_color(id,0,"%L %L",id,"AES_TAG",id,"AES_ANEW_ALIVE");
        return false;
    }
    
    rg_give_item(id, "weapon_deagle", GT_REPLACE);
    rg_set_user_bpammo(id, WEAPON_DEAGLE, 35);

    g_players[id] |= (1<<SUPER_DEAGLE);
    client_print_color(id,0,"%L %L",id,"AES_TAG",id,"AES_BONUS_GET_MEGADEAGLE");
    
    return true;
}

public pointBonus_GiveAWP(id){
    if(!is_user_alive(id))
    {
        client_print_color(id,0,"%L %L",id,"AES_TAG",id,"AES_ANEW_ALIVE");
        return false;
    }
    
    rg_give_item(id, "weapon_awp", GT_REPLACE);
    rg_set_user_bpammo(id, WEAPON_AWP, 15);

    client_print_color(id,0,"%L %L",id,"AES_TAG",id,"AES_BONUS_GET_AWP");
    
    return true;
}

public pointBonus_GiveExp(id)
{
if(!is_user_alive(id))
{
client_print_color(id,0,"%L %L",id,"AES_TAG",id,"AES_ANEW_ALIVE");
return false;
}

aes_add_player_exp_f(id, 200);

return true;
}
 
Сообщения
137
Реакции
9
Помог
3 раз(а)
Все вопрос решен уже
 
Статус
В этой теме нельзя размещать новые ответы.

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

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