He Grenade Damage

В този раздел можете да подавате всякакви заявки за намиране, изработка или преработка на плъгини/модове.
Аватар
lantimilan
Извън линия
Foreigner
Foreigner
Мнения: 424
Регистриран на: 29 Ное 2017, 22:49
Се отблагодари: 31 пъти
Получена благодарност: 3 пъти

He Grenade Damage

Мнение от lantimilan » 25 Фев 2021, 20:14

Hello i want to ask if somebody see different damage from he grenade in regamedll and in rehlds from HLDS, its possible to size in down damage he grenade in rehlds to make same in hlds.

Аватар
atmax
Извън линия
Потребител
Потребител
Мнения: 492
Регистриран на: 22 Мар 2018, 15:06
Се отблагодари: 37 пъти
Получена благодарност: 43 пъти

He Grenade Damage

Мнение от atmax » 25 Фев 2021, 21:02

Try explaining better what you want. I just put together some code should work try it. It will increase the damage from a HE Grenade.

Код за потвърждение: Избери целия код

#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

#define DMG_HE (1<<24)
#define IsPlayer(%1) (1<=%1<=MaxPlayers)

new ioid, MaxPlayers

public plugin_init()
{
	register_plugin("HE Damage", "1.0", "AMXX-BG Pawn Team")
	RegisterHam(Ham_TakeDamage, "player", "TakeDamage", 0)
}

public plugin_cfg()
{
	MaxPlayers=get_maxplayers()
}

public TakeDamage(victim, idinflictor, idattacker, Float:damage, damagebits)
{
	if(((IsPlayer(idattacker) && is_user_connected(idattacker) && (ioid=idattacker)) ||
	(ioid=pev(idinflictor, pev_owner) && IsPlayer(ioid) && is_user_connected(ioid))))
	{
		if(damagebits & DMG_HE)
		{
			damage+=10
		}
	}
}
Or if you want to reduce the damage try this:

Код за потвърждение: Избери целия код

#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

#define DMG_HE (1<<24)
#define IsPlayer(%1) (1<=%1<=MaxPlayers)

new ioid, MaxPlayers

public plugin_init()
{
	register_plugin("HE Damage", "1.0", "AMXX-BG Pawn Team")
	RegisterHam(Ham_TakeDamage, "player", "TakeDamage", 0)
}

public plugin_cfg()
{
	MaxPlayers=get_maxplayers()
}

public TakeDamage(victim, idinflictor, idattacker, Float:damage, damagebits)
{
	if(((IsPlayer(idattacker) && is_user_connected(idattacker) && (ioid=idattacker)) ||
	(ioid=pev(idinflictor, pev_owner) && IsPlayer(ioid) && is_user_connected(ioid))))
	{
		if(damagebits & DMG_HE)
		{
			damage-=10
		}
	}
}
Rest in peace my friend I always will remember you! 🖤👊

Аватар
OciXCrom
Извън линия
Администратор
Администратор
Мнения: 7206
Регистриран на: 06 Окт 2016, 19:20
Местоположение: /resetscore
Се отблагодари: 117 пъти
Получена благодарност: 1295 пъти
Обратна връзка:

He Grenade Damage

Мнение от OciXCrom » 25 Фев 2021, 22:33

That's not how you change arguments in a forward event.

Don't use flat numbers, use modifiers.
Imagine you deal 1 dmg to an an enemy and your code reduces it by -10. What would happen then?

What in the world is "ioid" and what is its purpose in the code?!

Код за потвърждение: Избери целия код

#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

#define DMG_HE (1<<24)
const Float:HE_DMG_MULTIPLIER = 0.85

public plugin_init()
{
	register_plugin("HE Damage", "1.0", "AMXX-BG Pawn Team")
	RegisterHam(Ham_TakeDamage, "player", "TakeDamage", 0)
}

public TakeDamage(victim, idinflictor, idattacker, Float:damage, damagebits)
{
	if(damagebits & DMG_HE)
	{
		SetHamParamFloat(4, damage * HE_DMG_MULTIPLIER)
		return HAM_OVERRIDE
	}

	return HAM_IGNORED
}

Аватар
lantimilan
Извън линия
Foreigner
Foreigner
Мнения: 424
Регистриран на: 29 Ное 2017, 22:49
Се отблагодари: 31 пъти
Получена благодарност: 3 пъти

He Grenade Damage

Мнение от lantimilan » 26 Фев 2021, 12:22

Thanks ocixcrom thanks atmax for your help ;)

Заключено
  • Подобни теми
    Отговори
    Преглеждания
     Последно мнение

Обратно към “Заявки за плъгини”

Кой е на линия

Потребители разглеждащи този форум: 0 регистрирани и 25 госта