AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   1v1, 1v2, 1v3 1v4 1v5 Players (https://forums.alliedmods.net/showthread.php?t=222132)

^SmileY 07-30-2013 07:59

1v1, 1v2, 1v3 1v4 1v5 Players
 
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.

guipatinador 07-30-2013 08:18

Re: 1v1, 1v2, 1v3 1v4 1v5 Players
 
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
    



^SmileY 07-30-2013 09:42

Re: 1v1, 1v2, 1v3 1v4 1v5 Players
 
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.


All times are GMT -4. The time now is 15:52.

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