18.02.2010, 00:11
sure but it might still be a bit complicated:
add this to the top of your script below the #includes:
new TEAM_ARMY_COUNT;
add this under OnPlayerSpawn:
if(gTeam[playerid] == TEAM_ARMY) TEAM_ARMY_COUNT++;
now add this to OnPlayerRequestClass:
if(TEAM_ARMY_COUNT >= 5) return SendClientMessage(playerid, COLOR_RED, "The army team is full! (5 Players)");
this could be the complicated part,
if you have OnPlayerDisconnect in your gamemode script, add this:
if(gTeam[playerid] == TEAM_ARMY) TEAM_ARMY_COUNT--;
if not add this under a callback in the script:
public OnPlayerDisconnect();
{
then add the line above
add this to the top of your script below the #includes:
new TEAM_ARMY_COUNT;
add this under OnPlayerSpawn:
if(gTeam[playerid] == TEAM_ARMY) TEAM_ARMY_COUNT++;
now add this to OnPlayerRequestClass:
if(TEAM_ARMY_COUNT >= 5) return SendClientMessage(playerid, COLOR_RED, "The army team is full! (5 Players)");
this could be the complicated part,
if you have OnPlayerDisconnect in your gamemode script, add this:
if(gTeam[playerid] == TEAM_ARMY) TEAM_ARMY_COUNT--;
if not add this under a callback in the script:
public OnPlayerDisconnect();
{
then add the line above