29.09.2018, 21:33
PHP код:
new
PlayerCount[2],
bool:InDM[MAX_PLAYERS];
CMD:dm(playerid, params[])
{
if(InDM[playerid]) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "You are already in a DM arena, do /lobby first.");
new str[350];
format(str, 350, "{11799C}ID\t{11799C}Name\t{11799C}Players Online\n{9C9C9C}0\t{9C9C9C}Las Venturas Police Department\t%d players here\n{9C9C9C}1\t{9C9C9C}Big Smoke's Crack Factory\t%d players here", PlayerCount[0], PlayerCount[1]);
Dialog_Show(playerid, DIALOG_DM, DIALOG_STYLE_TABLIST_HEADERS, "DM Arenas List", str, "Enter", "Close");
return 1;
}
PHP код:
PlayerCount[0] //players in the sand id 0
PlayerCount[1] //players in the sand id 1
PHP код:
PlayerCount[0] += 1; //when the player enters the arena "0"
PlayerCount[1] += 1; //when the player enters the arena "1"
PHP код:
PlayerCount[0] -= 1; //when the player leaves the arena "0"
PlayerCount[1] -= 1; /when the player leaves the arena "1"