It's been a long time since my last contribution to this forum section or at all
So what do I have here to share with you today?
It's an example code of something I've used in many ways for different private plugins already.
The snipped shows you how to use custom icons inside the killfeed. The attached example plugin adds an icon for deaths caused by fall damage, but you can use it for many other things too.
PHP Code:
stock Action FakeDeathEvent(Event oldEvent, char[] weapon)
{
oldEvent.BroadcastDisabled = true;
Event event_fake = CreateEvent("player_death", true);
char sWeapon[64];
Format(sWeapon, sizeof sWeapon, "weapon_%s", weapon); // trys to use materials/panorama/images/icons/equipment/<WEAPONNAME>.svg
event_fake.SetString("weapon", sWeapon);
event_fake.SetInt("userid", oldEvent.GetInt("userid"));
event_fake.SetInt("attacker", oldEvent.GetInt("attacker"));
event_fake.SetInt("assister", oldEvent.GetInt("assister"));
event_fake.SetBool("assistedflash", oldEvent.GetBool("assistedflash"));
event_fake.SetBool("headshot", oldEvent.GetBool("headshot"));
event_fake.SetBool("dominated", oldEvent.GetBool("dominated"));
event_fake.SetBool("revenge", oldEvent.GetBool("revenge"));
event_fake.SetBool("wipe", oldEvent.GetBool("wipe"));
event_fake.SetBool("penetrated", oldEvent.GetBool("penetrated"));
event_fake.SetBool("noreplay", oldEvent.GetBool("noreplay"));
event_fake.SetBool("noscope", oldEvent.GetBool("noscope"));
event_fake.SetBool("thrusmoke", oldEvent.GetBool("thrusmoke"));
event_fake.SetBool("attackerblind", oldEvent.GetBool("attackerblind"));
for(int i = 1; i <= MaxClients; i++) if(IsClientInGame(i) && !IsFakeClient(i))
{
event_fake.FireToClient(i);
}
event_fake.Cancel();
return Plugin_Changed;
}
If you plan to use this for your own servers, please choose unique filenames which include a shortcut of your communityname as a prefix or something, thanks.
.