Raised This Month: $ Target: $400
 0% 

1v1, 1v2, 1v3 1v4 1v5 Players


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 07-30-2013 , 07:59   1v1, 1v2, 1v3 1v4 1v5 Players
Reply With Quote #1

Hi again need to catch when player is playing on these situations with another users:

1v1, 1v2, 1v3, 1v4, 1v5

Example > In a round, stay 1 TR vs others 5 .. 4 .. 3 ... 2 ... 1 etc.
And if the TR win against others CTs, increase a global variable to variable.

EDIT: Is not needed to post any code, any way to do this (I not good on logical thinking)

Thanks.
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 

Last edited by ^SmileY; 07-30-2013 at 08:03.
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
guipatinador
SourceMod Donner Party
Join Date: Oct 2009
Location: Poortugal
Old 07-30-2013 , 08:18   Re: 1v1, 1v2, 1v3 1v4 1v5 Players
Reply With Quote #2

PHP Code:
IsAloneid )
{
    if( !
is_user_aliveid ) )
    {
        return 
0
    
}

    new 
szTeam12 ]
    if( 
<= get_user_teamidszTeamcharsmaxszTeam ) ) <= )
    {
        new 
Players32 ], iNum
        get_players
PlayersiNum"ae"szTeam )
        
        return ( 
iNum == ) ? 0
    
}
    
    return 
0    
}

GetAliveEnemiesid )
{
    if( !
is_user_aliveid ) )
    {
        return -
1
    
}
    
    new 
szOpposingTeam12 ]
    
    switch( 
get_user_teamid ) )
    {
        case 
1// T
        
{
            
szOpposingTeam =  "CT"
        
}
        
        case 
2// CT
        
{
            
szOpposingTeam "TERRORIST"
        
}
    }
    
    new 
Players32 ], iNum
    get_players
PlayersiNum"ae"szOpposingTeam )
    
    return 
iNum

PHP Code:
    if( IsAloneid ) && GetAliveEnemiesid ) == )
    {
        
// player is alone, versus 3 enemies
    


Last edited by guipatinador; 07-30-2013 at 09:20.
guipatinador is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 07-30-2013 , 09:42   Re: 1v1, 1v2, 1v3 1v4 1v5 Players
Reply With Quote #3

Well, its secure to assign a string directly using a value instead of using copy() ?

Anyway i need like this:

PHP Code:
stock isVsAlone(id)
{
    new 
iPlayers[32],iAlive[CsTeams];
    
get_players(iPlayers,iAlive[CS_TEAM_T],"aeh","TERRORIST");
    
get_players(iPlayers,iAlive[CS_TEAM_CT],"aeh","CT");
    
    if((
cs_get_user_team(id) == CS_TEAM_T) && is_user_alive(id) && (iAlive[CS_TEAM_T] == 1)) return iAlive[CS_TEAM_CT];
    
    else if((
cs_get_user_team(id) == CS_TEAM_CT) && is_user_alive(id) && (iAlive[CS_TEAM_CT] == 1)) return iAlive[CS_TEAM_T];

    return 
0;

EDIT: Sorry, i understand better now, thanks and i changed >>

PHP Code:
GetAliveEnemiesid )
{
    if( !
is_user_aliveid ) )
    {
        return -
1
    
}
    
    new 
Players32 ], iNum
    get_players
PlayersiNum"ae", ( get_user_teamid ) == ) ? "CT" "TERRORIST" )
    
    return 
iNum

solved.
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 

Last edited by ^SmileY; 07-30-2013 at 10:13. Reason: new szOpposingTeam[ 12 ] :(
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
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 15:52.


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