AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Replacing (https://forums.alliedmods.net/showthread.php?t=251978)

~Ice*shOt 11-23-2014 10:33

Replacing
 
Maybe anyone has better ideas than this my attempt?
I tried to make a bar hud by percentage (when it's max limit is 2500).

PHP Code:

#include <amxmodx>

new const g_szBarStatus[][] =
{
    
"                                        ""|                                      ""||                                    ",
    
"|||                                  ""||||                                ""|||||                              ",
    
"||||||                            ""|||||||                          ""||||||||                        ",
    
"|||||||||                      ""||||||||||                    ""|||||||||||                  ",
    
"||||||||||||                ""|||||||||||||              ""||||||||||||||            ",
    
"|||||||||||||||          ""||||||||||||||||        ""|||||||||||||||||      ",
    
"||||||||||||||||||    ""|||||||||||||||||||  ""||||||||||||||||||||"
};

new 
g_iBar[33];

public 
plugin_init()
        
register_clcmd("addbar""Clcmd_AddBar");

public 
Task_HUD(id)
{
    
id -= TASKID_HUD;

    
set_hudmessage(25500, -1.00.800.10.250.010.01, -1);
    
show_hudmessage(id"Bar [%s]"g_szBarStatus[g_iBar[id] * 20 2500);

    
set_task(0.2"Task_HUD"id TASKID_HUD);
}

public 
Clcmd_AddBar(id)
{
        
g_iBar[id] += 100;
        
Task_HUD(id TASKID_HUD);




All times are GMT -4. The time now is 17:36.

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