AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Round_End don't support the round time? (https://forums.alliedmods.net/showthread.php?t=143625)

#8 SickneSS 11-22-2010 04:24

Round_End don't support the round time?
 
I have a problem with this,because sometimes Round_End don't support the roundtime.

When T's doesn't plant the bomb,CT's must win that round by time,and that is the correct way to work.

But sometimes this makes a bug in my plugin,I don't know why.

Code...

PHP Code:

        new RoundsH get_pcvar_num(RoundsHalf)
        
        if(
ScoreCT ScoreT >= RoundsH && (!Half))
        {            
            
Half true
            
            FragsHalf 
Best_Fraggers()
            
BestFragger1 get_user_frags(FragsHalf)
            
            if(
get_pcvar_num(Swaper))
                
cmdSwap()
            
            
TotalCT ScoreT
            TotalT 
ScoreCT
            
            ScoreCT 
0
            ScoreT 
0
            
            set_pcvar_num
(pRestart,1)
        } 

Sorry for my english ^_^

ConnorMcLeod 11-22-2010 05:52

Re: Round_End don't support the round time?
 
If you are talking about maps that don't have any objective, round never ends before the whole team is dead, that's how the game works.

#8 SickneSS 11-22-2010 22:49

Re: Round_End don't support the round time?
 
Nope,Im talking about de_ maps.

Exolent[jNr] 11-22-2010 23:31

Re: Round_End don't support the round time?
 
If round time expires without the bomb planted then the Counter-Terrorists win, and that "Round_End" log event is sent.

#8 SickneSS 11-23-2010 02:19

Re: Round_End don't support the round time?
 
Quote:

Originally Posted by Exolent[jNr] (Post 1354895)
If round time expires without the bomb planted then the Counter-Terrorists win, and that "Round_End" log event is sent.

Yes,but sometimes bugs,I don't know why.:/

ConnorMcLeod 11-23-2010 03:42

Re: Round_End don't support the round time?
 
Then, your code fails.

#8 SickneSS 11-23-2010 04:39

Re: Round_End don't support the round time?
 
Can you tell me what is the problem in my code...?

PHP Code:


//Init
    
register_logevent("LogEventRoundEnd",2,"1=Round_End")

//Function
public LogEventRoundEnd() 
{    
    if(
get_pcvar_num(Enable))
    {    
        new 
RoundsH get_pcvar_num(RoundsHalf)
        new 
RoundsE get_pcvar_num(RoundsEnd)
        
        if(
ScoreCT ScoreT >= RoundsH && (!Half))
        {            
            
Half true
            
            FragsHalf 
Best_Fraggers()
            
BestFragger1 get_user_frags(FragsHalf)
            
            if(
get_pcvar_num(Swaper))
                
cmdSwap()
            
            
TotalCT ScoreT
            TotalT 
ScoreCT
            
            ScoreCT 
0
            ScoreT 
0
            
            set_pcvar_num
(pRestart,1)
        }
        
        if(
Half)
        {            
            if(
ScoreCT TotalCT >= RoundsE)
            {
                
set_hudmessage(6464255, -1.0, -1.01)
                
show_hudmessage(0,"Game Over^nCounter-Terrrorists Ganan El Mapa")
                
                
End true 
            
}
            
            if(
ScoreT TotalT >= RoundsE)
            {
                
set_hudmessage(2556464, -1.0, -1.01)
                
show_hudmessage(0,"Game Over^nTerrorist Team Ganan El Mapa")
                
                
End true
            
}
            
            if(
ScoreCT TotalCT >= RoundsH && ScoreT TotalT >= RoundsH)
            {
                
set_hudmessage(6425564, -1.0, -1.01)
                
show_hudmessage(0,"Game Over^nMapa Empatado")
                
                
End true
            
}
        }
        
        if(
End)
        {
            
FragsEnd Best_Fraggers()
            
BestFragger2 get_user_frags(FragsEnd)
            
            
End false
            Half 
false
            bChangeteam 
false
            server_cmd
("amx_new")
            
server_cmd("amx_on")
            
            if(
get_pcvar_num(ShowBestsFraggers))
                
set_task(5.0,"BestFrgrs")
        }
    }        


Thanks!

ConnorMcLeod 11-23-2010 05:18

Re: Round_End don't support the round time?
 
After each if, put a else and log what's happen with gametime.


All times are GMT -4. The time now is 11:22.

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