Skocz do zawartości

Nowy szablon forum

mygo.pl

Stworzyliśmy dla Was nowy wygląd forum. Z pewnością znajdziesz rzeczy, które wg Ciebie mogą zostać zmienione - wspomnij o tym w specjalnym wątku.

Czytaj więcej

Jak założyć własną sieć

serwerów CS

Zastanawiasz się nad prowadzeniem własnej sieci serwerów? Przeczytaj podstawowe informacje, na które należy zwrócić uwagę, przy takim projekcie.

Czytaj więcej

Tworzymy spis sieci

dodaj swoją

Dodaj sieć do której należysz, pozwoli to na promocję i budowę ogólnopolskiej bazy sieci CS.

Czytaj więcej

RSSPlayer Killed Himself Message


MYGO.pl
 Udostępnij

Rekomendowane odpowiedzi

  • RSSy
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)
}

Przeczytaj cały wpis

Odnośnik do komentarza
Udostępnij na innych stronach

Gość
Ten temat został zamknięty. Brak możliwości dodania odpowiedzi.
 Udostępnij

  • Ostatnio przeglądający   0 użytkowników

    • Brak zarejestrowanych użytkowników przeglądających tę stronę.
×
×
  • Dodaj nową pozycję...