02.08.2011, 01:12
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
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;
}