Raised This Month: $114 Target: $400
 28% 

Check for winning team


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Sanjay Singh
Senior Member
Join Date: Sep 2016
Old 12-01-2019 , 14:04   Check for winning team
Reply With Quote #1

I want to check for winning team and reward that team players with XP.
First Team or Second Team.

Help
ty.
Attached Files
File Type: sma Get Plugin or Get Source (pub_war_nothing.sma - 15 views - 71.3 KB)
__________________

Last edited by Sanjay Singh; 12-01-2019 at 15:48.
Sanjay Singh is offline
Send a message via AIM to Sanjay Singh
redivcram
Veteran Member
Join Date: Jul 2014
Location: Serbia
Old 12-01-2019 , 14:33   Re: Check for winning team
Reply With Quote #2

And what's your problem?
__________________
Discord: wEight#6773

Hobbies:
- Map Designing (Any Half-Life 1 Engine Game)
- Pawn (Intermediate / Counter-Strike 1.6 only)
- C#/VB for .Net (Intermediate / Winforms)
- Java (Mostly Android Application Development)
redivcram is offline
Sanjay Singh
Senior Member
Join Date: Sep 2016
Old 12-01-2019 , 14:49   Re: Check for winning team
Reply With Quote #3

Quote:
Originally Posted by redivcram View Post
And what's your problem?
Unable to find which team won. first or second team after 16 score and get their team players in loop n reward them with xp.
__________________

Last edited by Sanjay Singh; 12-01-2019 at 15:46.
Sanjay Singh is offline
Send a message via AIM to Sanjay Singh
Sanjay Singh
Senior Member
Join Date: Sep 2016
Old 12-01-2019 , 23:58   Re: Check for winning team
Reply With Quote #4

Bump
__________________
Sanjay Singh is offline
Send a message via AIM to Sanjay Singh
instinctpt1
Senior Member
Join Date: Dec 2016
Location: Rajasthan, India
Old 12-02-2019 , 14:37   Re: Check for winning team
Reply With Quote #5

Add additional (CS)TeamCheck in both these if blocks, get captains team accordingly and then do whatever u want with those team players

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")

            
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)

            
            
server_cmd("mp_freezetime 99999");
            
set_task(7.0,"SecondTeamWinnerMessage"
        } 
Example if 1st IF block is running.. now we know FirstTeam is winning
Now check for { FistCaptainTeamName } ,it will be 1 or 2 acc to given code
Now if its 1 ... u knw WinningTeam is terrorists, get all T players else others

Correct section for this is SCRIPTING HELP!
__________________
CSIndia The only Indian Scripters Community

Last edited by instinctpt1; 12-02-2019 at 14:44.
instinctpt1 is offline
Sanjay Singh
Senior Member
Join Date: Sep 2016
Old 12-02-2019 , 14:48   Re: Check for winning team
Reply With Quote #6

like this?
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")

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

    
//Check
    
new players[32], num
    get_players
(playersnum,"h")

    new 
player
    
for(new 0numi++)
    {
        
player players[i]
        if(
FirstCaptainTeamName == && get_user_team(player) == 1)
        {
            
//Your Team T WON
        
}
        else if(
get_user_team(player) == 2)
        {
            
//Your Team CT Lost
        
}
    }
    
}

if(
ScoreScondteam >= 16)
{   

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

    
    
server_cmd("mp_freezetime 99999");
    
set_task(7.0,"SecondTeamWinnerMessage"

    
//Check
    
new players[32], num
    get_players
(playersnum,"h")

    new 
player
    
for(new 0numi++)
    {
        
player players[i]
        if(
FirstCaptainTeamName == && get_user_team(player) == 2)
        {
            
//Your Team CT WON
        
}
        else if(
get_user_team(player) == 1)
        {
            
//Your Team T Lost
        
}
    }


Quote:
Originally Posted by instinctpt1 View Post
Add additional (CS)TeamCheck in both these if blocks, get captains team accordingly and then do whatever u want with those team players

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")

            
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)

            
            
server_cmd("mp_freezetime 99999");
            
set_task(7.0,"SecondTeamWinnerMessage"
        } 
Example if 1st IF block is running.. now we know FirstTeam is winning
Now check for { FistCaptainTeamName } ,it will be 1 or 2 acc to given code
Now if its 1 ... u knw WinningTeam is terrorists, get all T players else others

Correct section for this is SCRIPTING HELP!
__________________
Sanjay Singh is offline
Send a message via AIM to Sanjay Singh
instinctpt1
Senior Member
Join Date: Dec 2016
Location: Rajasthan, India
Old 12-02-2019 , 14:59   Re: Check for winning team
Reply With Quote #7

Something like this ( in both IF statements) :
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
            FirstCaptainTeamName 
== get_players(players,num"ae""T") : get_players(playersnum"ae""CT")
            for(new 
0numi++)
            {
                
// you are winning
            
}

            
set_cvar_string("amx_warname",GameDescBuffer)
            
            
server_cmd("mp_freezetime 99999");
            
set_task(7.0,"FirstTeamWinnerMessage")
            
        } 
__________________
CSIndia The only Indian Scripters Community

Last edited by instinctpt1; 12-02-2019 at 15:00.
instinctpt1 is offline
Sanjay Singh
Senior Member
Join Date: Sep 2016
Old 12-02-2019 , 15:05   Re: Check for winning team
Reply With Quote #8

Ok but i want to show msg to lost team too in that case?
__________________

Last edited by Sanjay Singh; 12-03-2019 at 02:47.
Sanjay Singh is offline
Send a message via AIM to Sanjay Singh
Sanjay Singh
Senior Member
Join Date: Sep 2016
Old 12-03-2019 , 02:47   Re: Check for winning team
Reply With Quote #9

Tested & this isnt working. Added in both ifs.

Code used to test
PHP Code:
if(ScoreFtrstTeam >= 16)
        {
            
//Change description of the game.
            
            
new GameDescBuffer[32]
            
formatex(GameDescBuffer,charsmax(GameDescBuffer),"GG! %d To %d",ScoreFtrstTeam,ScoreScondteam)
            
            
server_cmd("mp_freezetime 99999");
            
set_task(7.0,"FirstTeamWinnerMessage")
            
            new 
players[32], numiPlayer
            FirstCaptainTeamName 
== get_players(players,num"ae""T") : get_players(playersnum"ae""CT")
            for(new 
0numi++)
            {
                
iPlayer players[i];
                
client_print_color(iPlayer, -1"Debug: Your Team WON");
            }    
        }

        if(
ScoreScondteam >= 16)
        {   
            new 
GameDescBuffer[32]
            
formatex(GameDescBuffer,charsmax(GameDescBuffer),"GG! %d To %d",ScoreScondteam,ScoreFtrstTeam)
            
            
server_cmd("mp_freezetime 99999");
            
set_task(7.0,"SecondTeamWinnerMessage")

            new 
players[32], numiPlayer
            FirstCaptainTeamName 
== get_players(players,num"ae""T") : get_players(playersnum"ae""CT")
            for(new 
0numi++)
            {
                
iPlayer players[i];
                
client_print_color(iPlayer, -1"Debug: Your Team WON");
            }
        } 
__________________

Last edited by Sanjay Singh; 12-04-2019 at 10:26.
Sanjay Singh is offline
Send a message via AIM to Sanjay Singh
ZaX
Member
Join Date: Jan 2015
Old 12-03-2019 , 04:47   Re: Check for winning team
Reply With Quote #10

Check this thread it might help you
https://forums.alliedmods.net/showthread.php?t=286591

Also check comment #10

Last edited by ZaX; 12-03-2019 at 04:49.
ZaX 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 08:13.


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