AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [SOLVED] Variable in HUD help (https://forums.alliedmods.net/showthread.php?t=206889)

Blizzard_87 01-27-2013 03:12

[SOLVED] Variable in HUD help
 
PHP Code:

public Left_20(id)
{
    
set_hudmessage(255255255, -1.00.2612.0iSeconds0.10.11)
    if(
is_user_alive(id))
    {
        switch(
cs_get_user_team(id))
    {
        case 
CS_TEAM_Tshow_hudmessageid"Seekers Are Frozen So You Can Hide!");
        case 
CS_TEAM_CTshow_hudmessageid"Hiders Get %d Secs To Hide!"iSeconds);
        case 
CS_TEAM_SPECTATOR: return;
        case 
CS_TEAM_UNASSIGNED: return;
    }
    }


the CT hud shows a bunch of numbers instead of the 20.0 seconds as defined...

PHP Code:

#define iSeconds 20.0 

what im doing wrong?

michal123 01-27-2013 03:22

Re: Variable in HUD help
 
Use floatround.

Code:

public Left_20(id) {
        set_hudmessage(255, 255, 255, -1.0, 0.26, 1, 2.0, iSeconds, 0.1, 0.1, 1);
        if(is_user_alive(id)){
                switch(cs_get_user_team(id)){
                        case CS_TEAM_T: show_hudmessage( id, "Seekers Are Frozen So You Can Hide!");
                        case CS_TEAM_CT: show_hudmessage( id, "Hiders Get %d Secs To Hide!", floatround(iSeconds));
                }
        }
}


Blizzard_87 01-27-2013 03:45

Re: Variable in HUD help
 
cheers thanks

Worked!


All times are GMT -4. The time now is 20:40.

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