Counting Players
#1

Hello Guys,

How can i count players like in Derby?
I want that to be in Textdraw.

Like :- Players :- x/y
and When a player joins /derby, it should change x and y.
And when a player leaves derby, it should change x.

If anyone can help, Will be appreciated
Thanks.
Reply
#2

removed
Reply
#3

On top
pawn Код:
//DCMD define
#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
Then
pawn Код:
new PlayersInDerby;
then
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(derby,5,cmdtext);
return 1;
}
then
pawn Код:
dcmd_derby(playerid,params[])
{
SendClientMessageToAll(playerid,-1,"DERBY: A new player has joined the derby!");
PlayersInDerby++; //To count players
//put here the positions u want player to teleport etc
return 1;
}
And for the textdraw, create one and do this OnPlayerUpdate
pawn Код:
public OnPlayerUpdate(playerid)
{
new string[128];
format(string,sizeof(string),"Players: %d",PlayersInDerby);
TextDrawSetString(YourTextdrawNameHere,string);
return 1;
}
I made it with dcmd because i used to use DCMD and i love using it so you're free to change to whatever u want
Hope i helped you
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)