Уменьшение урона от Мега Гранаты

ivankerj

Пользователь
Регистрация
22 Окт 2019
Сообщения
40
Симпатии
2
OS
Linux
Amx Mod X
AMXX 1.8.3-dev
Билд
8308
Metamod
v1.21p37
Meta модули
Код:
Meta модули:
Currently running plugins:
 [  1] SafeNameAndChat, v1.1, 2017.02.01, by WPMG.PRoSToC0der, see http://snac.wpmg.ru/
 [  2] Reunion, v0.1.0.92, 2018-02-11, by The Legion, see
 [  3] ReAuthCheck, v0.1.6, 2017-03-08, by Adidasman, see http://www.dedicated-server.ru/
 [  4] VoiceTranscoder, v2017RC3, 2017.02.12, by WPMG.PRoSToC0der, see http://vtc.wpmg.ru/
 [  5] AMX Mod X, v1.9.0.5249, Dec 18 2018, by AMX Mod X Dev Team, see http://www.amxmodx.org
 [  6] Rechecker, v2.5, Oct 21 2017, by s1lent, see http://www.dedicated-server.ru/
 [  7] WHBlocker, v1.5.696, 2018-11-04, by s1lent, see http://www.aghl.ru/
 [  8] ReSemiclip, v2.3.9, 13/02/17, by s1lent & Adidasman, see http://www.dedicated-server.ru/
 [  9] CStrike, v1.9.0.5249, Sep 10 2018, by AMX Mod X Dev Team, see http://www.amxmodx.org
 [ 10] CSX, v1.9.0.5249, Sep 10 2018, by AMX Mod X Dev Team, see http://www.amxmodx.org/
 [ 11] MySQL, v1.9.0.5249, Sep 10 2018, by AMX Mod X Dev Team, see http://www.amxmodx.org/
 [ 12] SQLite, v1.9.0.5249, Sep 10 2018, by AMX Mod X Dev Team, see http://www.amxmodx.org/
 [ 13] Engine, v1.9.0.5249, Sep 10 2018, by AMX Mod X Dev Team, see http://www.amxmodx.org
 [ 14] ReAPI, v5.10.0.186-dev, 2019-08-29, by Asmodai & s1lent, see https://github.com/s1lentq/reapi/
 [ 15] ReAimDetector, v0.2.2, 2018-02-06, by ReHLDS Team, see http://www.dedicated-server.ru/
 [ 16] FakeMeta, v1.9.0.5249, Sep 10 2018, by AMX Mod X Dev Team, see http://www.amxmodx.org
 [ 17] Ham Sandwich, v1.9.0.5249, Sep 10 2018, by AMX Mod X Dev Team, see http://www.amxmodx.org
 [ 18] Fun, v1.9.0.5249, Sep 10 2018, by AMX Mod X Dev Team, see http://www.amxmodx.org
18 plugins
Плагины
Код:
Плагины:
----- Список загруженных плагинов -----
Наименов   Верси  Автор        Файл         Сост
FreshBans          1.4.0b      kanagava          fresh_bans_1.4.  running 
ReAimDetector API  0.2.2       ReHLDS Team       reaimdetector.a  running 
Gag Me             2.3.4       Radius            gag_me.amxx      running 
New Kick Menu      1.4.2       Radius            newkickmenu.amx  running 
Advanced MapChoos  1.4         neygomon          map_chooser.amx  running 
Admin Base         1.9.0.5249  AMXX Dev Team     admin.amxx       running 
Admin Commands     1.9.0.5249  AMXX Dev Team     admincmd.amxx    running 
Players Menu       1.7         neugomon          players_menu.am  running 
Lite Translit      2.8         neygomon          lite_translit.a  running 
Anti Flood         1.9.0.5249  AMXX Dev Team     antiflood.amxx   running 
Всего 10 плагинов, из них 10 запущены
Amxx Модули
Код:
Список модулей:
Список загруженных модулей:
Наименовани  Верси  Автор           Состо
CStrike                 1.9.0.5249  AMX Mod X Dev Team   running   
CSX                     1.9.0.5249  AMX Mod X Dev Team   running   
nVault                  1.9.0.5249  AMX Mod X Dev Team   running   
MySQL                   1.9.0.5249  AMX Mod X Dev Team   running   
SQLite                  1.9.0.5249  AMX Mod X Dev Team   running   
Engine                  1.9.0.5249  AMX Mod X Dev Team   running   
ReAPI                   5.10.0.186  Asmodai & s1lent     running   
ReAimDetector           0.2.2       ReHLDS Team          running   
FakeMeta                1.9.0.5249  AMX Mod X Dev Team   running   
Ham Sandwich            1.9.0.5249  AMX Mod X Dev Team   running   
Fun                     1.9.0.5249  AMX Mod X Dev Team   running   
Sockets                 1.9.0.5249  AMX Mod X Dev Team   running   
RegEx                   1.9.0.5249  AMX Mod X Dev Team   running   
Всего 13 модулей
Ошибка
Код:
НЕ МОГУ УМЕНЬШИТЬ УРОН ОТ ГРАНАТЫ:
КРИВЫЕ РУКИ!
НЕ ЗНАНИЕ СКРИПТИНГА!
Исходник
Код:
Исходный код:
/*
    Advanced Experience System
    by serfreeman1337        http://gf.hldm.org/
*/

/*
    Random CSTRIKE Bonuses
*/

#include <amxmodx>
#include <cstrike>
#include <hamsandwich>
#include <fakemeta_util>

#include <colorchat>

#include <aes_main>

#define PLUGIN "AES: Bonus CSTRIKE"
#define VERSION "0.4"
#define AUTHOR "serfreeman1337"

// биты? да это же круто!
enum _:{
    SUPER_NICHEGO,
    SUPER_NADE,
    SUPER_DEAGLE
}

new g_players[33],g_maxplayers
new bonusEnablePointer,firstRoundPointer,aNewUseTime,buyTimePointer
new bool:st

new HamHook: hamSpawn

new iRound
new Float:g_fBuyTime[33]

public plugin_init(){
    register_plugin(PLUGIN, VERSION, AUTHOR)
    
    hamSpawn = RegisterHam(Ham_Spawn,"player","On_Player_Spawn")
    RegisterHam(Ham_Killed,"player","On_Player_Killed")
    RegisterHam(Ham_TakeDamage,"player","On_Player_TakeDamage")
    
    firstRoundPointer = register_cvar("aes_bonus_firstround","3")
    aNewUseTime = register_cvar("aes_bonus_time","-1.0")
    
    register_logevent("RoundStart",2,"0=World triggered","1=Round_Start")
    register_logevent("RoundRestart",2,"0=World triggered","1=Game_Commencing")
    register_event("TextMsg","RoundRestart","a","2&#Game_will_restart_in")
    
    g_maxplayers = get_maxplayers()
}

public RoundRestart(){
    if(!st)
        return
        
    iRound = 0
    
    set_pcvar_num(bonusEnablePointer,0)
}

public RoundStart(){
    if(!st)
        return
        
    iRound ++
    
    if(iRound < get_pcvar_num(firstRoundPointer))
        set_pcvar_num(bonusEnablePointer,0)
    else{
        set_pcvar_num(bonusEnablePointer,1)
    }
}

public plugin_cfg(){
    bonusEnablePointer = get_cvar_pointer("aes_bonus_enable")
    buyTimePointer = get_cvar_pointer("mp_buytime")
    
    if(get_pcvar_float(aNewUseTime) > 0.0)
        buyTimePointer = aNewUseTime
    else if(get_pcvar_float(aNewUseTime) == 0.0){
        buyTimePointer = 0
        DisableHamForward(hamSpawn)
    }
    
    if(!bonusEnablePointer){
        log_amx("get cvar pointer fail for ^"aes_bonus_enable^"")
        set_fail_state("get cvar pointer fail")
    }
    
    st = get_pcvar_num(bonusEnablePointer) == 1 ? true : false
}

public aes_on_anew_command(id){
    if(iRound < get_pcvar_num(firstRoundPointer)){
        client_print_color(id,0,"%L %L",id,"AES_TAG",id,"AES_ANEW_ROUND",get_pcvar_num(firstRoundPointer))
        
        return PLUGIN_HANDLED
    }
    
    return PLUGIN_CONTINUE
}

public client_disconnect(id){
    g_fBuyTime[id] = 0.0
    g_players[id] = SUPER_NICHEGO // сбрасываем возможности на дисконнекте
}

public On_Player_Spawn(id)
    g_fBuyTime[id] = get_gametime() + 60 * get_pcvar_float(buyTimePointer)

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

public On_Player_TakeDamage(victim,idinflictor,idattacker,Float:damage,damagebits){
    if(!idattacker || idattacker > g_maxplayers)
        return HAM_IGNORED
    
    if(!g_players[idattacker])
        return HAM_IGNORED
    
    if(0 < idinflictor <= g_maxplayers){
        new wp = get_user_weapon(idattacker)
        
        if(wp == CSW_DEAGLE && (g_players[idattacker] & (1 << SUPER_DEAGLE)))
            SetHamParamFloat(4,damage * 2.0)
        }else{
        new classname[32]
        pev(idinflictor,pev_classname,classname,31)
        
        if(!strcmp(classname,"grenade") && (g_players[idattacker] & (1 << SUPER_NADE))){
            set_task(0.5,"deSetNade",idattacker)
            
            SetHamParamFloat(4,damage * 3.0)
        }
    }
    
    return HAM_IGNORED
}

// сбарсываем множитель урона гранаты
public deSetNade(id)
    g_players[id] &= ~(1<<SUPER_NADE)

public roundBonus_GiveDefuser(id,cnt){
    if(!cnt)
        return
    
    if(cs_get_user_team(id) == CS_TEAM_CT)
        cs_set_user_defuse(id)
}

public roundBonus_GiveNV(id,cnt){
    if(!cnt)
        return
    
    cs_set_user_nvg(id)
}

public roundBonus_GiveArmor(id,cnt){
    if(!cnt)
        return
    
    switch(cnt){
        case 1: cs_set_user_armor(id,100,CS_ARMOR_KEVLAR)
            case 2: cs_set_user_armor(id,100,CS_ARMOR_VESTHELM)
            default: cs_set_user_armor(id,cnt,CS_ARMOR_VESTHELM)
    }
}

public roundBonus_GiveHP(id,cnt){
    if(!cnt)
        return
    
    fm_set_user_health(id,(get_user_health(id) + cnt))
}

#define CHECK_ALIVE(%1) \
if(!is_user_alive(%1)){\
    client_print_color(id,0,"%L %L",id,"AES_TAG",id,"AES_ANEW_ALIVE"); \
    return 0; \
}

#define CHECK_ROUNDTIME(%1) \
if(get_gametime() > g_fBuyTime[id] && buyTimePointer){\
    client_print(id,print_center,"%L",id,"AES_ANEW_BUYTIME",floatround(60.0 * get_pcvar_float(buyTimePointer))); \
    return 0; \
}

public pointBonus_GiveM4a1(id){
    CHECK_ALIVE(id)
    CHECK_ROUNDTIME(id)
    
    DropWeaponSlot(id,1)
    
    fm_give_item(id,"weapon_m4a1")
    cs_set_user_bpammo(id,CSW_M4A1,90)
    
    return 1
}

public pointBonus_GiveAk47(id){
    CHECK_ALIVE(id)
    CHECK_ROUNDTIME(id)
    
    DropWeaponSlot(id,1)
    
    fm_give_item(id,"weapon_ak47")
    cs_set_user_bpammo(id,CSW_AK47,90)
    
    return 1
}

public pointBonus_GiveAWP(id){
    CHECK_ALIVE(id)
    CHECK_ROUNDTIME(id)
    
    DropWeaponSlot(id,1)
    
    fm_give_item(id,"weapon_awp")
    cs_set_user_bpammo(id,CSW_AWP,30)
    
    return 1
}

public pointBonus_Give10000M(id){
    CHECK_ALIVE(id)
    CHECK_ROUNDTIME(id)
    
    new money = cs_get_user_money(id) + 10000
    money = clamp(money,0,16000)
    cs_set_user_money(id,money)
    
    return 1
}

public pointBonus_Set200HP(id){
    CHECK_ALIVE(id)
    CHECK_ROUNDTIME(id)
    
    fm_set_user_health(id,200)
    
    return 1
}

public pointBonus_GiveMegaGrenade(id){
    CHECK_ALIVE(id)
    CHECK_ROUNDTIME(id)
    
    if(!user_has_weapon(id,CSW_HEGRENADE))
        fm_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 1
}

public pointBonus_GiveMegaDeagle(id){
    CHECK_ALIVE(id)
    CHECK_ROUNDTIME(id)
    
    DropWeaponSlot(id,2)
    
    fm_give_item(id,"weapon_deagle")
    cs_set_user_bpammo(id,CSW_DEAGLE,35) // какой максимум?
    
    g_players[id] |= (1<<SUPER_DEAGLE)
    
    client_print_color(id,0,"%L %L",id,"AES_TAG",id,"AES_BONUS_GET_MEGADEAGLE")
    
    return 1
}

DropWeaponSlot( iPlayer, iSlot ){
    static const m_rpgPlayerItems = 367; // player
    static const m_pNext = 42; // weapon_*
    static const m_iId = 43; // weapon_*
    
    if( !( 1 <= iSlot <= 2 ) )    {
        return 0;
    }
    
    new iCount;
    
    new iEntity = get_pdata_cbase( iPlayer, ( m_rpgPlayerItems + iSlot ), 5 );
    if( iEntity > 0 )    {
        new iNext;
        new szWeaponName[ 32 ];
        
        do    {
            iNext = get_pdata_cbase( iEntity, m_pNext, 4 );
            
            if( get_weaponname( get_pdata_int( iEntity, m_iId, 4 ), szWeaponName, charsmax( szWeaponName ) ) )        {
                engclient_cmd( iPlayer, "drop", szWeaponName );
                
                iCount++;
            }
        }    while( ( iEntity = iNext ) > 0 );
    }
    
    return iCount;
}
Добрый день,помогите пожалуйста уменьшить урон от бонусной Мега гранаты
Столкнулся с такой проблемой,у меня на сервере стоит система званий AES и от него стоит система бонусов /anew
Проблема в том,что при выборе через бонусные очки /anew мега гранаты,она сносит слишком много ХП игрокам нравиться мега но все жалуются что она через чур мощная! Я лазил в исходнике и нашел там только вот это
Вставка из исходника:
}

public pointBonus_GiveMegaGrenade(id){
    CHECK_ALIVE(id)
    CHECK_ROUNDTIME(id)
    
    if(!user_has_weapon(id,CSW_HEGRENADE))
        fm_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 1
}
 

Вложения

r1nk0

Пользователь
Регистрация
3 Окт 2018
Сообщения
258
Симпатии
53
Код:
    if(0 < idinflictor <= g_maxplayers){
        new wp = get_user_weapon(idattacker)
        
        if(wp == CSW_DEAGLE && (g_players[idattacker] & (1 << SUPER_DEAGLE)))
            SetHamParamFloat(4,damage * 2.0)
        }else{
        new classname[32]
        pev(idinflictor,pev_classname,classname,31)
        
        if(!strcmp(classname,"grenade") && (g_players[idattacker] & (1 << SUPER_NADE))){
            set_task(0.5,"deSetNade",idattacker)
            
            SetHamParamFloat(4,damage * 3.0)
        }
Код:
            SetHamParamFloat(4,damage * 3.0)
где 3 это множитель урона. х2 для дигла и х3 для гранаты.
 

ivankerj

Пользователь
Регистрация
22 Окт 2019
Сообщения
40
Симпатии
2
Код:
    if(0 < idinflictor <= g_maxplayers){
        new wp = get_user_weapon(idattacker)
       
        if(wp == CSW_DEAGLE && (g_players[idattacker] & (1 << SUPER_DEAGLE)))
            SetHamParamFloat(4,damage * 2.0)
        }else{
        new classname[32]
        pev(idinflictor,pev_classname,classname,31)
       
        if(!strcmp(classname,"grenade") && (g_players[idattacker] & (1 << SUPER_NADE))){
            set_task(0.5,"deSetNade",idattacker)
           
            SetHamParamFloat(4,damage * 3.0)
        }
Код:
            SetHamParamFloat(4,damage * 3.0)
где 3 это множитель урона. х2 для дигла и х3 для гранаты.
Спасибо,добрый человек
 
Сверху Снизу