Raised This Month: $ Target: $400
 0% 

[L4D] Average Distance detect


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
AtomicStryker
Veteran Member
Join Date: Apr 2009
Location: Teutonia!!
Old 10-09-2009 , 10:08   Re: [L4D] Average Distance detect
Reply With Quote #1

Because from the code i see you only update your global var "mapcompletion" just once, at leaving the safe room? You might want it in the periodic timer you have there


Just remove it altogether and use GetVersusDistance() instead
AtomicStryker is offline
guilty80100
Member
Join Date: Jul 2009
Old 10-09-2009 , 11:19   Re: [L4D] Average Distance detect
Reply With Quote #2

i try with
PHP Code:
public DrawClientPanel()
{
    
decl String:scoreStr[1024];
    
Format(scoreStr1024"-> Score: %d pts."currentScore);

    
decl String:timerStr[1024];
    
Format(timerStr1024"-> Timer: %d min %d sec."timerMintimerSec);

    
decl String:survStr[1024];
    
Format(survStr1024"-> Survivor : %d."survAlive);

    
decl String:percentStr[1024];
    
Format(percentStr1024"-> Percent Travelled : %d."mapCompletion);

    new 
Handle:panel CreatePanel();
    
DrawPanelText(panelscoreStr);
    
DrawPanelText(paneltimerStr);
    
DrawPanelText(panelsurvStr);
    
DrawPanelText(panelpercentStr);
    
    for (new 
19i++) 
    {
        if(
IsClientInGameHuman(i)) 
        {
            
SendPanelToClient(paneliMenu_Panel2);
            
            
/*
            #if READY_DEBUG
            PrintToChat(i, "[DEBUG] You have been sent the Panel.");
            #endif
            */
        
}
    }
    
CloseHandle(panel);
}

public 
Action:Event_TimerSecond(Handle:timer)
{
    if (!
roundStarted || roundFinished)
        return 
Plugin_Stop;
    
    
mapCompletion GetVersusDistance();
    new 
win GetConVarInt(pm_var_seconds);
    if (
win != 0)
    {
        
timerSec += win;
    }
    if (
timerSec >59)
    {
        
timerMin += 1;
        
timerSec 0;
    }
    
DrawClientPanel();
    
    return 
Plugin_Continue;

and

PHP Code:
public DrawClientPanel()
{
    
decl String:scoreStr[1024];
    
Format(scoreStr1024"-> Score: %d pts."currentScore);

    
decl String:timerStr[1024];
    
Format(timerStr1024"-> Timer: %d min %d sec."timerMintimerSec);

    
decl String:survStr[1024];
    
Format(survStr1024"-> Survivor : %d."survAlive);

    
decl String:percentStr[1024];
    
Format(percentStr1024"-> Percent Travelled :  %d.",GetVersusDistance());

    new 
Handle:panel CreatePanel();
    
DrawPanelText(panelscoreStr);
    
DrawPanelText(paneltimerStr);
    
DrawPanelText(panelsurvStr);
    
DrawPanelText(panelpercentStr);
    
    for (new 
19i++) 
    {
        if(
IsClientInGameHuman(i)) 
        {
            
SendPanelToClient(paneliMenu_Panel2);
            
            
/*
            #if READY_DEBUG
            PrintToChat(i, "[DEBUG] You have been sent the Panel.");
            #endif
            */
        
}
    }
    
CloseHandle(panel);
}

public 
Action:Event_TimerSecond(Handle:timer)
{
    if (!
roundStarted || roundFinished)
        return 
Plugin_Stop;
    
    new 
win GetConVarInt(pm_var_seconds);
    if (
win != 0)
    {
        
timerSec += win;
    }
    if (
timerSec >59)
    {
        
timerMin += 1;
        
timerSec 0;
    }
    
DrawClientPanel();
    
    return 
Plugin_Continue;

Still not work
guilty80100 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 03:39.


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