Raised This Month: $12 Target: $400
 3% 

Check for winning team


Post New Thread Reply   
 
Thread Tools Display Modes
instinctpt1
Senior Member
Join Date: Dec 2016
Location: Chandigarh, India
Old 12-03-2019 , 05:11   Re: Check for winning team
Reply With Quote #11

There should be additional checks too + i have done mistake in get_players its "TERRORIST" not just "T"

Additional check for SecondHalfStarted must be there coz FirstCaptainTeanName changes acc to that

Explanation: If second half has started ( boolean: isSecondHalfStarted ) then FirstCaptainTeamName corresponds to SecondTeamScore rather than ScoreFrstTeam [ Head over to line 632 in sma u will see how its working ]
instinctpt1 is offline
Sanjay Singh
Veteran Member
Join Date: Sep 2016
Old 12-03-2019 , 09:26   Re: Check for winning team
Reply With Quote #12

Quote:
Originally Posted by instinctpt1 View Post
There should be additional checks too + i have done mistake in get_players its "TERRORIST" not just "T"

Additional check for SecondHalfStarted must be there coz FirstCaptainTeanName changes acc to that

Explanation: If second half has started ( boolean: isSecondHalfStarted ) then FirstCaptainTeamName corresponds to SecondTeamScore rather than ScoreFrstTeam [ Head over to line 632 in sma u will see how its working ]
I am confused over it so if you know it better how it can be done then I expect code.
__________________
Sanjay Singh is offline
Send a message via AIM to Sanjay Singh
instinctpt1
Senior Member
Join Date: Dec 2016
Location: Chandigarh, India
Old 12-04-2019 , 01:36   Re: Check for winning team
Reply With Quote #13

PHP Code:
if(ScoreFtrstTeam >= 16)
        {
            
//Change description of the game.
            
            
new GameDescBuffer[32]
            
formatex(GameDescBuffer,charsmax(GameDescBuffer),"GG! %d To %d",ScoreFtrstTeam,ScoreScondteam)

            
// set_task(8.0,"StartSongForAll")
            
new players[32], num
            
if(!isSecondHalfStarted)
                
FirstCaptainTeamName == get_players(playersnum"ae""TERRORIST") : get_players(playersnum"ae""CT")

            else
                
FirstCaptainTeamName == get_players(playersnum"ae""CT") : get_players(playersnum"ae""TERRORIST"//  coz Teams are now swapped 

            
for(new i=0numi++)
                
client_print(i3"You are winning!")

            
set_cvar_string("amx_warname",GameDescBuffer)
            
            
server_cmd("mp_freezetime 99999");
            
set_task(7.0,"FirstTeamWinnerMessage")
            
        }

        if(
ScoreScondteam >= 16)
        {   

            new 
GameDescBuffer[32]
            
formatex(GameDescBuffer,charsmax(GameDescBuffer),"GG! %d To %d",ScoreScondteam,ScoreFtrstTeam)
            
set_cvar_string("amx_warname",GameDescBuffer)

            new 
players[32], num
            
if(!isSecondHalfStarted)
                
FirstCaptainTeamName == get_players(playersnum"ae""CT") : get_players(playersnum"ae""TERRORIST")

            else
                
FirstCaptainTeamName == get_players(playersnum"ae""TERRORIST") : get_players(playersnum"ae""CT"//  coz Teams are now swapped 

            
for(new i=0numi++)
                
client_print(i3"You are winning!")

            
            
server_cmd("mp_freezetime 99999");
            
set_task(7.0,"SecondTeamWinnerMessage"
        } 
instinctpt1 is offline
Sanjay Singh
Veteran Member
Join Date: Sep 2016
Old 12-05-2019 , 09:55   Re: Check for winning team
Reply With Quote #14

looks like its working fine..

Thanks @instinctpt1
__________________
Sanjay Singh is offline
Send a message via AIM to Sanjay Singh
instinctpt1
Senior Member
Join Date: Dec 2016
Location: Chandigarh, India
Old 12-05-2019 , 11:56   Re: Check for winning team
Reply With Quote #15

Glad
instinctpt1 is offline
Reply


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 01:06.


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