Full team
#5

pawn Code:
new
    iArmyCounts,
    iRobberCounts
;

public OnPlayerSpawn( playerid )
{
    if ( GetPlayerTeam( playerid ) == TEAM_ARMY ) iArmyCounts ++;
    if ( GetPlayerTeam( playerid ) == TEAM_ROBBERS ) iRobberCounts ++;

    return 1;
}

public OnPlayerRequestSpawn( playerid )
{
    if ( GetPlayerTeam( playerid ) == TEAM_ARMY )
    {
        if ( iArmyCounts < iRobberCounts )
            return !SendClientMessage( playerid, -1, "Please join robbers team." );
    }

    if ( GetPlayerTeam( playerid ) == TEAM_ROBBERS )
    {
        if ( iRobberCounts < iArmyCounts )
            return !SendClientMessage( playerid, -1, "Please join army team." );
    }

    return 1;
}
pawn Code:
return !print( "lol" );
// ==
return print( "lol" ), 0;
// afaik xD
Hope this one works, and helped you.

EDIT: I got what do you meant.

pawn Code:
new
    iArmyCounts
;

public OnPlayerSpawn( playerid )
{
    if ( GetPlayerTeam( playerid ) == TEAM_ARMY )
        iArmyCounts ++;

    return 1;
}

public OnPlayerRequestSpawn( playerid )
{
    if ( GetPlayerTeam( playerid ) == TEAM_ARMY )
    {
        if ( iArmyCounts >= 5 )
            return !SendClientMessage( playerid, -1, "Team army is full." );
    }

    return 1;
}
Reply


Messages In This Thread
Full team - by RatHack - 01.08.2011, 13:55
Re: Full team - by Kitten - 01.08.2011, 14:01
Respuesta: Full team - by RatHack - 01.08.2011, 14:08
Re: Full team - by =WoR=Varth - 02.08.2011, 00:51
Re: Full team - by Basicz - 02.08.2011, 01:12

Forum Jump:


Users browsing this thread: 3 Guest(s)