Поиск Изменение урона у стандартных оружий

Сообщения
105
Реакции
23
Помог
2 раз(а)
Привет. Помогите найти, может кто-то знает, есть ли плагин, который может менять урон у стандартного оружия, которое можно купить в меню buy
Спасибо
 
Сообщения
890
Реакции
149
Помог
25 раз(а)
Damage Constrole поищи, возможно то, что тебе нужно.
 
Сообщения
1,031
Реакции
827
Помог
10 раз(а)
Можно чет такое сделать, но оно на все оружие, не только стандартное.
P.s.: не проверял.

Код:
#include amxmodx
#include reapi

#pragma semicolon 1

new const WEAPONS[ ] =
{
    10, // WEAPON_NONE
    10, // WEAPON_P228
    10, // WEAPON_GLOCK
    10, // WEAPON_SCOUT
    10, // WEAPON_HEGRENADE
    10, // WEAPON_XM1014
    10, // WEAPON_C4
    10, // WEAPON_MAC10
    10, // WEAPON_AUG
    10, // WEAPON_SMOKEGRENADE
    10, // WEAPON_ELITE
    10, // WEAPON_FIVESEVEN
    10, // WEAPON_UMP45
    10, // WEAPON_SG550
    10, // WEAPON_GALIL
    10, // WEAPON_FAMAS
    10, // WEAPON_USP
    10, // WEAPON_GLOCK18
    10, // WEAPON_AWP
    10, // WEAPON_MP5N
    10, // WEAPON_M249
    10, // WEAPON_M3
    10, // WEAPON_M4A1
    10, // WEAPON_TMP
    10, // WEAPON_G3SG1
    10, // WEAPON_FLASHBANG
    10, // WEAPON_DEAGLE
    10, // WEAPON_SG552
    10, // WEAPON_AK47
    10, // WEAPON_KNIFE
    10, // WEAPON_P90
};

public plugin_init( )
{
    register_plugin( "Damage Control", "1.0.0", "Javekson" );
   
    RegisterHookChain( RG_CBasePlayer_TakeDamage, "hook_player_take_damage_pre", .post = false );
}

public hook_player_take_damage_pre( const victim, const inflictor, const attacker, Float:damage, const type )
{
    if( attacker == victim || inflictor != attacker || damage < 1.0 || type & ( DMG_BLAST | DMG_GRENADE ) || !is_user_connected( attacker ) || !rg_is_player_can_takedamage( victim, attacker ) )
    {
        return HC_CONTINUE;
    }
   
    new item = get_member( attacker, m_pActiveItem );
   
    if( is_nullent( item ) )
    {
        return HC_CONTINUE;
    }
   
    new weapon = get_member( item, m_iId );
   
    if( !weapon || WEAPONS[ weapon ] <= 0 )
    {
        return HC_CONTINUE;
    }
   
    damage += ( damage * WEAPONS[ weapon ] ) / 100.0;
   
    SetHookChainArg( 4, ATYPE_FLOAT, damage );
   
    return HC_CONTINUE;
}
 
Сообщения
75
Реакции
82
Помог
6 раз(а)
Код:
#include < amxmodx >
#include < hamsandwich >
#include < reapi >

new const WEAPONENTNAMES[CSW_P90 + 1][] = {
    "", "weapon_p228", "", "weapon_scout", "", "weapon_xm1014", "", "weapon_mac10",
    "weapon_aug", "", "weapon_elite", "weapon_fiveseven", "weapon_ump45", "weapon_sg550",
    "weapon_mp5navy", "weapon_famas", "weapon_usp", "weapon_glock18", "weapon_awp", "weapon_mp5navy", "weapon_m249",
    "weapon_m3", "weapon_m4a1", "weapon_tmp", "weapon_g3sg1", "", "weapon_deagle", "weapon_sg552",
    "weapon_ak47", "weapon_knife", "weapon_p90"
};

new g_eCvar[CSW_P90 + 1];

public plugin_init() {
    g_eCvar[CSW_P228] = register_cvar("amx_dmg_p228","1.0");
    g_eCvar[CSW_SCOUT] = register_cvar("amx_dmg_scout","1.0");
    g_eCvar[CSW_XM1014] = register_cvar("amx_dmg_xm1014","1.0");
    g_eCvar[CSW_MAC10] = register_cvar("amx_dmg_mac10","1.0");
    g_eCvar[CSW_AUG] = register_cvar("amx_dmg_aug","1.0");
    g_eCvar[CSW_ELITE] = register_cvar("amx_dmg_elite","1.0");
    g_eCvar[CSW_FIVESEVEN] = register_cvar("amx_dmg_fiveseven","1.0");
    g_eCvar[CSW_UMP45] = register_cvar("amx_dmg_ump45","1.0");
    g_eCvar[CSW_SG550] = register_cvar("amx_dmg_sg550","1.0");
    g_eCvar[CSW_GALIL] = register_cvar("amx_dmg_galil","1.0");
    g_eCvar[CSW_FAMAS] = register_cvar("amx_dmg_famas","1.0");
    g_eCvar[CSW_USP] = register_cvar("amx_dmg_usp","1.0");
    g_eCvar[CSW_GLOCK18] = register_cvar("amx_dmg_glock18","1.0");
    g_eCvar[CSW_AWP] = register_cvar("amx_dmg_awp","1.0");
    g_eCvar[CSW_MP5NAVY] = register_cvar("amx_dmg_mp5navy","1.0");
    g_eCvar[CSW_M249] = register_cvar("amx_dmg_m249","1.0");
    g_eCvar[CSW_M3] = register_cvar("amx_dmg_m3","1.0");
    g_eCvar[CSW_M4A1] = register_cvar("amx_dmg_m4a1","1.0");
    g_eCvar[CSW_TMP] = register_cvar("amx_dmg_tmp","1.0");
    g_eCvar[CSW_G3SG1] = register_cvar("amx_dmg_g3sg1","1.0");
    g_eCvar[CSW_DEAGLE] = register_cvar("amx_dmg_deagle","1.0");
    g_eCvar[CSW_SG552] = register_cvar("amx_dmg_sg552","1.0");
    g_eCvar[CSW_AK47] = register_cvar("amx_dmg_ak47","1.0");
    g_eCvar[CSW_KNIFE] = register_cvar("amx_dmg_knife","3.0");
    g_eCvar[CSW_P90] = register_cvar("amx_dmg_p90","1.0");
    
    for (new i = 1; i < sizeof WEAPONENTNAMES; i++)
        if (WEAPONENTNAMES[i][0]) RegisterHam(Ham_Spawn, WEAPONENTNAMES[i], "Ham_CBasePlayerWeapon__Spawn_Post", true);
}

public Ham_CBasePlayerWeapon__Spawn_Post(const iWeapon)    {
    new iWeaponID = get_member(iWeapon, m_iId);
    new Float:fDamage = get_pcvar_float(g_eCvar[iWeaponID]);
    
    set_member(iWeapon, m_Weapon_flBaseDamage, Float:get_member(iWeapon, m_Weapon_flBaseDamage) * fDamage);
    
    switch(iWeaponID)    {
        case CSW_M4A1:    {
            set_member(iWeapon, m_M4A1_flBaseDamageSil, Float:get_member(iWeapon, m_M4A1_flBaseDamageSil) * fDamage);
        }
        case CSW_USP:    {
            set_member(iWeapon, m_USP_flBaseDamageSil, Float:get_member(iWeapon, m_USP_flBaseDamageSil) * fDamage);
        }
        case CSW_FAMAS:    {
            set_member(iWeapon, m_Famas_flBaseDamageBurst, Float:get_member(iWeapon, m_Famas_flBaseDamageBurst) * fDamage);
        }
        case CSW_KNIFE:    {
            set_member(iWeapon, m_Knife_flStabBaseDamage, Float:get_member(iWeapon, m_Knife_flStabBaseDamage) * fDamage);
            set_member(iWeapon, m_Knife_flSwingBaseDamage, Float:get_member(iWeapon, m_Knife_flSwingBaseDamage) * fDamage);
            set_member(iWeapon, m_Knife_flSwingBaseDamage_Fast, Float:get_member(iWeapon, m_Knife_flSwingBaseDamage_Fast) * fDamage);
        }
    }
}
 
Сообщения
336
Реакции
414
Помог
7 раз(а)
Flymic24, я бы на твоем месте использовал вместо CSW_P90 + 1 константу MAX_WEAPONS - 1, более логично было бы, ИМХО
 

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

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