Raised This Month: $51 Target: $400
 12% 

Player Killed Himself Message


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Ark_Procession
Senior Member
Join Date: Jun 2020
Location: Argentina
Old 12-08-2022 , 21:43   Player Killed Himself Message
Reply With Quote #1

Hello, i have this code for a custom message that replaces the kill sprite from top right.

Problem is that i use plugins with fakedamage, i think, and some times it gives the messages
that: "player killed himself" i only modify damage of knife,glock and awp. Those 3 weapons give that message error.

Is there any way around this? like detect who is the inflictor of damage to reference with the message?

HTML Code:
#include <amxmodx>
#include <reapi>

#define PLUGIN  "[Reapi] Mensaje de Muerte en el Chat"
#define VERSION "1.5"
#define AUTHOR  "[N]drs"

public plugin_init()
{
    register_plugin(PLUGIN, VERSION, AUTHOR)

    register_message(get_user_msgid("DeathMsg"), "OnServer_SendMessage_DeathMsg")
    RegisterHookChain(RG_CBasePlayer_Killed, "OnPlayer_Killed_Post", true)
}

public OnServer_SendMessage_DeathMsg()
    return PLUGIN_HANDLED

public OnPlayer_Killed_Post(iVictim, iAttacker, iGib)
{
    static szWeaponName[25]

    if(!iAttacker || iAttacker == iVictim)
    {
        client_print_color(0, print_team_grey, "^4[Server] ^3^4%n ^3 killed himself", iVictim)
        return
    }

    get_weaponname(get_user_weapon(iAttacker), szWeaponName, charsmax(szWeaponName))
    replace_string(szWeaponName, charsmax(szWeaponName), "weapon_", "")

    client_print_color(0, print_team_grey, "[Server]^4%n ^3killed ^4%n ^3with ^4%s", iAttacker, iVictim, szWeaponName)
} 
Ark_Procession is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:19.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode