View Single Post
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 07-26-2018 , 19:46   Re: Bullet Speed Management
Reply With Quote #9

Updated to v1.2:

Code:
. Fixed the damage block (sometimes it wasn't blocking)
. Fixed the deathmsg message (it shows now the weapon icon).
. Changed the way to set sv_maxvelocity in the plugin, sometimes it wasn't setting the value.
Observation:
I figured out that when you catch the death of anyone, with Ham_Killed or DeathMsg, sometimes the weapon id is not passed, so, I recommend to use get_user_weapon() to get the killer's weapon ID.

Like:

1. DeathMsg

PHP Code:
register_event("DeathMsg""event_DeathMsg""a"
PHP Code:
public event_DeathMsg()
{
    new 
iKiller read_data(1), szWeapon[32]
    
get_weaponname(get_user_weapon(iKiller), szWeaponcharsmax(szWeapon))
    
log_amx("iKillerID: %d, iVictimID: %d, Killer's WeaponName: %s"iKillerread_data(2), szWeapon[7])

Output:

Code:
iKillerID: 1, iVictimID: 6, Killer's WeaponName: ak47
2. Ham_Killed

PHP Code:
RegisterHam(Ham_Killed"player""ham_PlayerKilled"
PHP Code:
public ham_PlayerKilled(iVictimiKilleriShouldGib)
{
    new 
szWeapon[32]
    
get_weaponname(get_user_weapon(iKiller), szWeaponcharsmax(szWeapon))
    
log_amx("iKillerID: %d, iVictimID: %d, Killer's WeaponName: %s"iKillerread_data(2), szWeapon[7])

Output:

Code:
[bulletSpeed.amxx] iKillerID: 1, iVictimID: 28, Killer's WeaponName: ak47
So, both works. And I know that the player can throw a nade, change to AK47, kill the enemy with the HE, and it'll pass the weapon ID as AK47 (due the get_user_weapon() native), but, that barely happens. For now, it's the best way.
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo

Last edited by EFFx; 07-26-2018 at 19:50.
EFFx is offline