Raised This Month: $ Target: $400
 0% 

Solved How to print all with highest int value at round end separately


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
alasfourom
Senior Member
Join Date: Feb 2022
Location: Saudi Arabia
Old 08-03-2022 , 06:03   How to print all with highest int value at round end separately
Reply With Quote #1

Hello everyone,

I want to know 2 things,

Lets take this script as an example which show you how many kills players got "Frags".

PHP Code:
int KillCount [MAXPLAYERS+1];


public 
void OnPluginStart() 
{
    
HookEvent("round_start"Event_RoundStart);
    
HookEvent("player_death"EVENT_PlayerDeath);
}

public 
void Event_RoundStart(Event event, const char[] namebool dontBroadcast)
{
    for (
int i 1<= MaxClientsi++)
        if (
IsClientInGame(i)) KillCount[i] = 0;
}

public 
void EVENT_PlayerDeath(Event event, const char[] namebool dontBroadcast)
{
    
int victim GetClientOfUserId(event.GetInt("userid"));
    if (!
victim || !IsClientInGame(victim)) return;
    
    
int attacker GetClientOfUserId(event.GetInt("attacker"));
    if (!
attacker || !IsClientInGame(attacker)) return;
    
    if(
attacker != victim)
    {
        
KillCount[attacker]++;
        
        if (
KillCount[attacker] > 0PrintHintText(attacker"Kills: %d"KillCount[attacker]);
    }


- The first thing I would like to know, is how print in the end of the round everyone's kill like:
mario kills: 15, sonic kills: 10, dragon kills: 8, noob kills: 5


- The second thing is how to show in the end of the round only the highest killer, like:
mario kills: 15 > thats all


Thank you

Last edited by alasfourom; 12-26-2022 at 04:16.
alasfourom is offline
 


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 01:01.


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