Raised This Month: $344 Target: $400
 86%   Almost there!

Solved How to print all players/highest player kills at the end of the round?


Post New Thread Reply   
 
Thread Tools Display Modes
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 08-11-2022 , 08:20   Re: How to print all players/highest player kills at the end of the round?
Reply With Quote #11

...tips
Code:
public void Event_RoundStart(Event event, const char[] name, bool dontBroadcast)
{
    g_bRoundEnd = false;
    
    for (int i = 1; i <= MaxClients; i++)
    {
        if (IsClientInGame(i))
        {
            SI_KillCount     [i] = 0;
            Boss_KillCount    [i] = 0;
        }
    }
}
Why not reset whole array, either client is in game or not.


Code:
    for (client = 1; client <= MaxClients; client++)
    {
        if (!IsClientInGame(client) || GetClientTeam(client) == 3) continue;
        players_clients[players] = client;
        players++;
    }
... I don't remember L4D teams, but now you exlude clients from that team only. What about spectators ?
Should it be GetClientTeam(client) != 2, if any another team than index 2



This look nonsense, what happened here ?
Code:
    
    SortCustom1D(players_clients, players, SortDescending);
    {
        client = players_clients [0];
        SI_KillCount_MVP = SI_KillCount [client];
        PrintToChatAll("MVP SI Kills: %N (%d)", client, SI_KillCount_MVP);
    }
    
    SortCustom1D(players_clients, players, SortDescending);
    {
        client = players_clients    [0];
        Boss_KillCount_MVP = Boss_KillCount [client];
        PrintToChatAll("MVP Boss Kills: %N (%d)", client, Boss_KillCount_MVP);
    }
}
__________________
Do not Private Message @me
Bacardi is offline
alasfourom
Senior Member
Join Date: Feb 2022
Old 08-11-2022 , 08:32   Re: How to print all players/highest player kills at the end of the round?
Reply With Quote #12

Quote:
Originally Posted by Grey83 View Post
PHP Code:
PrintToChatAll("MVP SI Kills: %N (%d)"clientSI_KillCount_MVP); 
==>
PHP Code:
if(SI_KillCount_MVP 0PrintToChatAll("MVP SI Kills: %N (%d)"clientSI_KillCount_MVP);
else 
PrintToChatAll("MVP SI Kills: %N (None)"client); 
Noice, got it now

Thanks as always Grey83,
__________________
Now I Know: Peace
alasfourom is offline
alasfourom
Senior Member
Join Date: Feb 2022
Old 08-11-2022 , 08:57   Re: How to print all players/highest player kills at the end of the round?
Reply With Quote #13

Quote:
Originally Posted by Bacardi View Post
...tips
Code:
public void Event_RoundStart(Event event, const char[] name, bool dontBroadcast)
{
    g_bRoundEnd = false;
    
    for (int i = 1; i <= MaxClients; i++)
    {
        if (IsClientInGame(i))
        {
            SI_KillCount     [i] = 0;
            Boss_KillCount    [i] = 0;
        }
    }
}
Why not reset whole array, either client is in game or not.
Thanks I changed it now,


Quote:
Originally Posted by Bacardi View Post
I don't remember L4D teams, but now you exlude clients from that team only. What about spectators ?
Should it be GetClientTeam(client) != 2, if any another team than index 2

Thanks for the tips, yeah I should have changed that cause it showed even some spec kills when they go afk, excellent Bacardi

Quote:
Originally Posted by Bacardi View Post
This look nonsense, what happened here ?
Me neither , I'm not familiar with it, what my end result which is working at least < I'm sure its not the best way > is like this, when round end it will print in this way:

MVP SI Kills: Mike (12)
MVP Boss Kills: Sara (2)


only the one with highest value and ignoring the rest of players with lower value
__________________
Now I Know: Peace

Last edited by alasfourom; 08-11-2022 at 09:01.
alasfourom is offline
Reply


Thread Tools
Display Modes

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 02:18.


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