Team Limit
#2

pawn Код:
#define MAX_MEMBERS YourNumber // Defines the MAX_MEMBERS
Then under ONPlayerRequestClass

Membercount = 0;

PHP код:
foreach (Playeri// Looping through all players.
    
{
        if (
IsPlayerConnected(i))
        {
            if(
GetPlayerTeam(i) == classid// Looks for players with the same classid
            
Membercount ++; // Increases the Membercount variable.
        
}
    } 
Then.

PHP код:
if(Membercount => MAX_MEMBERS// Checks if the membercount is equal or bigger then the max_members define
        
return SendClientMessage(playerid, -1"This team is full");  // It it's like this?, Send an error message 
Reply


Messages In This Thread
Team Limit - by DarkLored - 02.02.2014, 20:33
Re: Team Limit - by ikbenremco - 02.02.2014, 20:52
Re: Team Limit - by DarkLored - 02.02.2014, 21:18
Re: Team Limit - by DarkLored - 02.02.2014, 22:36
Re: Team Limit - by erminpr0 - 02.02.2014, 22:45
Re: Team Limit - by DarkLored - 03.02.2014, 18:41

Forum Jump:


Users browsing this thread: 1 Guest(s)