count players in dm
#2

If I understand correctly, you want to make players only able to join a deathmatch once someone is in it. If so, here is the code.
pawn Код:
CMD:dm(playerid, params[])
{
    new pcount;
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i)) pcount ++;
    }
    if(!pcount) return SendClientMessage(playerid, 0xFFFFFFFF, "Not enough players to join");
    else
    {
        //your join deathmatch code here
    }
    return 1;
}
Remember to add pcount --; once players leave the deathmatch.
Reply


Messages In This Thread
count players in dm - by MA_proking - 21.10.2011, 11:47
Re: count players in dm - by SloProKiller - 21.10.2011, 12:01
Re: count players in dm - by MA_proking - 21.10.2011, 12:13

Forum Jump:


Users browsing this thread: 2 Guest(s)