View Single Post
pr0mers
Junior Member
Join Date: May 2020
Old 08-10-2021 , 16:48   Re: [HELP]Trying to do custom kill feed icons
Reply With Quote #3

Quote:
Originally Posted by kratoss1812 View Post
You have to stop the broadcast of the initial event, then create a new one and send it to everyone.

Credits to "Patriot of Anarchy" from HLMod.

PHP Code:
public Action Event_Death(Event event, const char[] namebool dontBroadcast)
{
    
int iClient GetClientOfUserId(event.GetInt("attacker"));
    if(!
iClient)
        return 
Plugin_Continue;

    
event.BroadcastDisabled true;

    
char buffer[124];
    
Event fake CreateEvent("player_death"true);
    
fake.SetInt("userid",            event.GetInt("userid"));
    
fake.SetInt("attacker",            event.GetInt("attacker"));
    
fake.SetInt("assister",            event.GetInt("assister"));

    
fake.SetString("weapon"buffer);

    
fake.SetInt("dominated",        event.GetInt("dominated"));
    
fake.SetInt("revenge",            event.GetInt("revenge"));
    
fake.SetInt("wipe",                event.GetInt("wipe"));
    
fake.SetInt("penetrated",        event.GetInt("penetrated"));
    
fake.SetBool("noreplay",        event.GetBool("noreplay"));

    
fake.SetBool("assistedflash",    event.GetBool("assistedflash"));
    
fake.SetBool("headshot",        event.GetBool("headshot"));
    
fake.SetBool("thrusmoke",        event.GetBool("thrusmoke"));
    
fake.SetBool("attackerblind",    event.GetBool("attackerblind"));
    
fake.SetBool("noscope",            event.GetBool("noscope"));

    for(
int i 1<= MaxClientsi++) if(IsClientInGame(i) && !IsFakeClient(i)) fake.FireToClient(i);
    
fake.Cancel();

    return 
Plugin_Changed;

that didn't work too as i said i tried
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;
}
which is from https://forums.alliedmods.net/showthread.php?t=330116 but this didn't work too
__________________
My Steam
My Youtube Channel
My Github
My Discord : pr0mers#0369
-I always write unnecessary plugins-
(you can tell me better ways to do something, thank you)
pr0mers is offline