count players in dm
#1

Its a very complicated problem so please read the following

When player do /dm 1

a textdrawn appear dm 1 is starting in 25 second do /dm 1 to join


if more than one players join start dm
else SendClientMessage(playerid, color, "Not enough player to join");


After starting when last player left it declare him winner.


Please help me with red part.

Thanks hope you help
Reply
#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
#3

I think I got it <3
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)