Raised This Month: $ Target: $400
 0% 

Spectator Hud help - prokreedz


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
plowed
Senior Member
Join Date: Oct 2010
Location: germany
Old 06-22-2011 , 08:25   Spectator Hud help - prokreedz
Reply With Quote #1

Hi, Im using prokreedz 2.27 and have problem with the spectator HUD.

First the Code

PHP Code:
public timer_task()
{
    for(new 
i=1;i<=MaxPlayers;i++)
    {
        if ( 
get_pcvar_num(kz_show_timer) == // Only do the code if the Cvar is 1..
        
{
            if (
is_user_alive(i))
            {
                if( 
is_user_connected(i) && timer_started[i])
                {
                    new 
Float:kreedztime get_gametime() - (IsPaused[i] ? get_gametime() - g_pausetime[i] : timer_time[i])

                    if( 
ShowTime[i] == )
                    {
                        new 
colors[12], r[4], g[4], b[4];
                        new 
imin floatround(kreedztime 60.0,floatround_floor)
                        new 
isec floatround(kreedztime imin 60.0,floatround_floor)
                        
get_pcvar_string(kz_hud_colorcolors11)
                        
parse(colorsr3g3b4)
                        
                        
set_hudmessage(str_to_num(r), str_to_num(g), str_to_num(b), 0.400.1000.01.00.00.0, -1)    
                        
show_hudmessage(i"Time: %02d:%02d  | CPs: %d | TPs: %d ",iminisec,checknumbers[i], gochecknumbers[i]) 
                    }
                    else
                    if( 
ShowTime[i] == )
                    {
                        
kz_showtime_roundtime(ifloatround(kreedztime))
                    }
                }
                
                if( 
get_pcvar_num(kz_godmode) == )
                    
set_user_godmode(i1)
                else
                    
set_user_godmode(i0)
            }
            else 
//Here is the Spec HUD
            
{
                new 
specmode pev(ipev_iuser1)
                if(
specmode == || specmode == 4)
                {
                    new 
target pev(ipev_iuser2)
                    if(
target != i)
                        if(
is_user_alive(target) && timer_started[target])
                        {
                            new 
name[32], colors[12], r[4], g[4], b[4];
                            
get_user_name (targetname31)

                            new 
Float:kreedztime get_gametime() - (IsPaused[target] ? get_gametime() - g_pausetime[target] : timer_time[target])
                            new 
imin floatround(kreedztime 60.0,floatround_floor)
                            new 
isec floatround(kreedztime imin 60.0,floatround_floor)

                            
get_pcvar_string(kz_hud_colorcolors11)
                            
parse(colorsr3g3b4)

                            
set_hudmessage(str_to_num(r), str_to_num(g), str_to_num(b), 0.400.1000.01.00.00.0, -1)
                            
show_hudmessage(i"Time: %02d:%02d  | CPs: %d | TPs: %d %s ",iminisecchecknumbers[target], gochecknumbers[target], IsPaused[target] ? "| *Paused*" "")     
                        }
                }
            }
        }
    }

Ive command the part where the the cvar and spechud message begin..So when the cvar is "1" the Spec HUD works.

Everytime a user is spec the hudmessage should work. But now its only work if the cvar is "1"...
The problem is I wont set the cvar to 1 because it changed it in the whole code and I only want it for this single function.
Hope you understand what I mean

Last edited by plowed; 06-22-2011 at 08:28.
plowed 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 23:34.


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