[HELP]How to made
#5

Quote:
Originally Posted by K0P
Посмотреть сообщение
Make a global array variable:

Код:
new InDM[MAX_PLAYERS];
Set its value to 1 when the player joins the deathmatch

Код:
new InDM[playerid] = 1;
Set its value to 0 when the player leaves the deathmatch

Код:
new InDM[playerid] = 0;
Also set its value to 0 when the layer disconnects so it wont effect the other players who join the server

Код:
new InDM[playerid] = 0;
Add this where u want to count
Код:
    new count;
    new string[50];

    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(InDM[i] == 1)
            {
                count++;
            }   
        }
    }

    format(string, sizeof(string), "%s Has Joined in Sniper DM Total players %d  ",GetName(playerid),count);
    SendClientMessage(playerid, 0xFFFFFFFF, string);
    return 1;
}
Код:
GetName(playerid)
{
	new pName[24];
	GetPlayerName(playerid, pName, 24);
	return pName;
}
>> add this at end
Reply


Messages In This Thread
[HELP]How to made - by Hunud - 23.07.2016, 18:27
Re: [HELP]How to made - by K0P - 23.07.2016, 18:47
Re: [HELP]How to made - by Kaliber - 23.07.2016, 18:48
Re: [HELP]How to made - by Hunud - 23.07.2016, 18:58
Re: [HELP]How to made - by FuNkYTheGreat - 23.07.2016, 19:04
Re: [HELP]How to made - by Stinged - 23.07.2016, 19:07

Forum Jump:


Users browsing this thread: 1 Guest(s)