Raised This Month: $51 Target: $400
 12% 

Solved CS:GO Kill Counter


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
iskenderkebab33
Senior Member
Join Date: Jun 2018
Old 09-22-2018 , 18:36   CS:GO Kill Counter
Reply With Quote #1

Hey, i need a plugin where a Kill Counter shown as HUD but it goes from 10 to 0 after 10 kills, so it startes by 10 (custom ediatable) to 0 after kill to kill, unter the Crosshair.

Thanks

Last edited by iskenderkebab33; 11-03-2018 at 17:27.
iskenderkebab33 is offline
Vaggelis
Senior Member
Join Date: May 2017
Old 09-22-2018 , 18:51   Re: CS:GO Kill Counter but goes down
Reply With Quote #2

Untested. The RED, GREEN and BLUE are for the color of the HUD
PHP Code:
#include <sourcemod>

#define KILLS 10

#define RED 0
#define GREEN 255
#define BLUE 0

new g_Kills[MAXPLAYERS 1]

public 
OnPluginStart()
{
    
HookEvent("round_start"Event_RoundStart)
    
HookEvent("player_death"Event_PlayerDeath)
    
    
CreateTimer(1.0HUD_Status_TIMER_REPEAT)
}

public 
Event_RoundStart(Handle:event, const String:name[], bool:dontBroadcast)
{
    for(new 
1<= MaxClientsi++)
    {
        if(
IsClientInGame(i))
        {
            
g_Kills[i] = 10
        
}
    }
}

public 
Event_PlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
victim GetClientOfUserId(GetEventInt(event"userid"))
    new 
attacker GetClientOfUserId(GetEventInt(event"attacker"))
    
    if(
attacker && IsClientInGame(attacker) && attacker != victim)
    {
        
g_Kills[attacker]--
    }
}

public 
Action:HUD_Status(Handle:timer)
{
    
SetHudTextParams(-1.00.61.0REDGREENBLUE255)
    
    for(new 
1<= MaxClientsi++)
    {
        if(
IsClientInGame(i) && IsPlayerAlive(i))
        {
            
ShowHudText(i, -1"Kills: %d"g_Kills[i])
        }
    }


Last edited by Vaggelis; 09-22-2018 at 18:51.
Vaggelis is offline
iskenderkebab33
Senior Member
Join Date: Jun 2018
Old 09-22-2018 , 19:04   Re: CS:GO Kill Counter but goes down
Reply With Quote #3

Quote:
Originally Posted by Vaggelis View Post
Untested. The RED, GREEN and BLUE are for the color of the HUD
PHP Code:
#include <sourcemod>

#define KILLS 10

#define RED 0
#define GREEN 255
#define BLUE 0

new g_Kills[MAXPLAYERS 1]

public 
OnPluginStart()
{
    
HookEvent("round_start"Event_RoundStart)
    
HookEvent("player_death"Event_PlayerDeath)
    
    
CreateTimer(1.0HUD_Status_TIMER_REPEAT)
}

public 
Event_RoundStart(Handle:event, const String:name[], bool:dontBroadcast)
{
    for(new 
1<= MaxClientsi++)
    {
        if(
IsClientInGame(i))
        {
            
g_Kills[i] = 10
        
}
    }
}

public 
Event_PlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
victim GetClientOfUserId(GetEventInt(event"userid"))
    new 
attacker GetClientOfUserId(GetEventInt(event"attacker"))
    
    if(
attacker && IsClientInGame(attacker) && attacker != victim)
    {
        
g_Kills[attacker]--
    }
}

public 
Action:HUD_Status(Handle:timer)
{
    
SetHudTextParams(-1.00.61.0REDGREENBLUE255)
    
    for(new 
1<= MaxClientsi++)
    {
        if(
IsClientInGame(i) && IsPlayerAlive(i))
        {
            
ShowHudText(i, -1"Kills: %d"g_Kills[i])
        }
    }

working fine, thanks.
iskenderkebab33 is offline
Reply



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 17:47.


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