AlliedModders

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

Near 04-07-2011 10:59

About Round_End
 
Hi,I have a problem with this event,I don't know why,but I made a code ussing the TeamScore Event to get the scores of both teams,when the scores get 15 with CTScore+TScore it must swap the teams,but,when the last round is finished by Time (CT Must win that round) it doesn't check and don't swap the teams.

Example :

CT 7 - T 7 - Last Round - T don't plant the bomb and CT win by time,the teams must be swap but they don't.

Sorry for my bad English.

mottzi 04-07-2011 13:23

Re: About Round_End
 
Check the Scores at the Bombexplode event and in Roundend event. Otherwise give us some code to check it for you.

Near 04-07-2011 13:27

Re: About Round_End
 
Quote:

Originally Posted by mottzi (Post 1445852)
Check the Scores at the Bombexplode event and in Roundend event. Otherwise give us some code to check it for you.

But the round is winned by time,please read all.

matsi 04-07-2011 15:55

Re: About Round_End
 
Quote:

Originally Posted by Near (Post 1445856)
But the round is winned by time,please read all.

"Please read all."

We need to see the code in order to help you.

ConnorMcLeod 04-08-2011 00:51

Re: About Round_End
 
I would do something like this (CT is always sent right before T) :

PHP Code:

#include <amxmodx>

#define VERSION "0.0.1"
#define PLUGIN ""

#define MAX_ROUNDS 15

new g_iTScoreg_iCTScore

public plugin_init()
{
    
register_plugin(PLUGINVERSION"ConnorMcLeod")
    
register_event("TeamScore""Event_TeamScore""a")
}

public 
Event_TeamScore()
{
    new 
szTeam[2]
    
read_data(1szTeamcharsmax(szTeam))
    switch( 
szTeam[0] )
    {
        case 
'CT':
        {
            
g_iCTScore read_data(2)
        }
        case 
'T':
        {
            
g_iTScore read_data(2)
            
CheckScore()
        }
    }
}

CheckScore()
{
    if( 
g_iTScore g_iCTScore == MAX_ROUNDS )
    {
        
SwitchTeams_and_Restart()
    }
}

SwitchTeams_and_Restart()
{
    
// code



Near 04-08-2011 17:05

Re: About Round_End
 
I'll test it.Thanks.


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

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