Question ! !! [+2 REP] - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Question ! !! [+2 REP] (
/showthread.php?tid=622715)
Question ! !! [+2 REP] -
Yaa - 25.11.2016
How to check this -->
DM Lauched ---> 5 players joined --> some x players leave dm
How to check how many players still in DM Area ?
Re: Question ! !! [+2 REP] -
IceBilizard - 26.11.2016
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;
}