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

CS:GO Show Weapon Ammo/Health/Ammor as HUDText center on the bottom


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
iskenderkebab33
Senior Member
Join Date: Jun 2018
Old 07-08-2018 , 16:05   CS:GO Show Weapon Ammo/Health/Ammor as HUDText center on the bottom
Reply With Quote #1

Hey, i need a Plugin to show the Weapon Ammo/ Health and Ammor as a HUD Text like Fortnite.

Thanks

Last edited by iskenderkebab33; 07-20-2018 at 04:04.
iskenderkebab33 is offline
mug1wara
AlliedModders Donor
Join Date: Jun 2018
Old 07-08-2018 , 18:27   Re: CS:GO Show Weapon Ammo/Health/Ammor as HUDText center on the bottom (like Fortnit
Reply With Quote #2

hahaha I just found this so funny, but here you go with the health, don't know how it's gonna look in game XD
PHP Code:
#include <sourcemod>

#pragma semicolon 1

public void OnPluginStart()
{
    
SetHudTextParams(-1.0, -0.150.5255255255255);
}

public 
void OnMapStart()
{
    for (
int i 1<= MaxClientsi++)
    {
        
CreateTimer(0.5Timer_PrintiTIMER_REPEAT TIMER_FLAG_NO_MAPCHANGE);
    }
}

public 
Action Timer_Print(Handle hTimerint iClient)
{
    if (
IsValidClient(iClient))
    {
        
int iHealth GetClientHealth(iClient);
        
        if (
iHealth <= 100)
        {
            
ShowHudText(iClient1"%d ◼◼◼◼◼◼◼◼◼◼"iHealth);
        }
        
        if (
iHealth <= 90)
        {
            
ShowHudText(iClient1"%d ◼◼◼◼◼◼◼◼◼"iHealth);
        }
        
        if (
iHealth <= 80)
        {
            
ShowHudText(iClient1"%d ◼◼◼◼◼◼◼◼"iHealth);
        }
        
        if (
iHealth <= 70)
        {
            
ShowHudText(iClient1"%d ◼◼◼◼◼◼◼"iHealth);
        }
        
        if (
iHealth <= 60)
        {
            
ShowHudText(iClient1"%d ◼◼◼◼◼◼"iHealth);
        }
        
        if (
iHealth <= 50)
        {
            
ShowHudText(iClient1"%d ◼◼◼◼◼"iHealth);
        }
        
        if (
iHealth <= 40)
        {
            
ShowHudText(iClient1"%d ◼◼◼◼"iHealth);
        }
        
        if (
iHealth <= 30)
        {
            
ShowHudText(iClient1"%d ◼◼◼"iHealth);
        }
        
        if (
iHealth <= 20)
        {
            
ShowHudText(iClient1"%d ◼◼"iHealth);
        }
        
        if (
iHealth <= 10)
        {
            
ShowHudText(iClient1"%d ◼"iHealth);
        }
    }
}

stock bool IsValidClient(int iClient)
{
    if (!(
iClient <= MaxClients) || !IsClientInGame(iClient) || IsFakeClient(iClient))
    {
        return 
false;
    }
    
    return 
true;


Last edited by mug1wara; 07-08-2018 at 19:55.
mug1wara is offline
Grey83
Veteran Member
Join Date: Dec 2014
Location: Ukraine
Old 07-22-2018 , 09:59   Re: CS:GO Show Weapon Ammo/Health/Ammor as HUDText center on the bottom (like Fortnit
Reply With Quote #3

why not just
PHP Code:
#pragma semicolon 1

public void OnPluginStart()
{
    
SetHudTextParams(-1.0, -0.150.531255127191);
}

public 
void OnMapStart()
{
    
CreateTimer(0.5Timer_Print_TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
}

public 
Action Timer_Print(Handle timer)
{
    static 
char buffer[64];
    static 
int iHPjnum;
    for (
1<= MaxClientsi++) if(IsClientInGame(i) && !IsFakeClient(i) && IsPlayerAlive(i))
    {
        
HP GetClientHealth(i);
        
buffer[0] = 0;
        for(
0num RoundToZero(HP 0.1); numj++) Format(buffersizeof(buffer), "%s☐"buffer);
        
ShowHudText(i1"%d %s"HPbuffer);
    }

?
Attached Files
File Type: sp Get Plugin or Get Source (hp_bar.sp - 113 views - 625 Bytes)
File Type: smx hp_bar.smx (4.2 KB, 45 views)
__________________
Grey83 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 22:21.


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