Question ! !! [+2 REP]
#1

How to check this -->

DM Lauched ---> 5 players joined --> some x players leave dm

How to check how many players still in DM Area ?
Reply
#2

You need to use a Global variable to use this for example


PHP код:
new DMPlayers = 0; // At top of script Global variable 
then make it on command join DM

PHP код:
CMD:join(playerid, params[])
{
          
DMPlayers++;
          return 
1;
} 
And Leave DM

PHP код:
CMD:leave(playerid, params[])
{
          new 
string[20], playername[25];
          
GetPlayerName(playerid, playername, MAX_PLAYER_NAME); 
          
format(string,sizeof(string), "%s has left the DM", playername);
          
SendClientMessageToAll(-1, string);
          
DMPlayers--;
          return 
1;
} 
And now see how many players left

PHP код:
CMD:dmplayers(playerid, params[])
{
          new 
string[20];
          
format(string,sizeof(string), "%d players left in the DM", DMPlayers);
          
SendClientMessage(playerid, -1, string);
          return 
1;
} 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)