[HELP]How to block a player becoming grove if groves full
#4

Код:
static gTeam[MAX_PLAYERS];

new GrovePeople;

#define GROVE 1

public OnPlayerRequestClass(playerid, classid)
{
	if(gTeam[playerid] == GROVE) GrovePeople--;
	if(classid == changethistoagrovestreetskin)
	{
	  if(GrovePeople > 3)
	  {
	    SendClientMessage(playerid, COLOR_RED, "You cannot join this team because it is too full.");
	    return 0;
	  }
	  else
	  {
	    GrovePeople++;
	    gTeam[playerid] = GROVE;
	    return 1;
	  }
	}
	return 1;
}
it's not the most efficient code, not even sure if it works
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)