new InDM[MAX_PLAYERS];
CMD:dm(playerid, params[])
{
new arenas[1000], string[1000];
if(InDM[playerid]) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "You are already in a DM arena, do /lobby first.");
format(string, sizeof(string), "{11799C}ID\t{11799C}Name\t{11799C}Players Online\n"); strcat(arenas, string);
format(string, sizeof(string), "{9C9C9C}0\t{9C9C9C}Las Venturas Police Department\t%d players here\n", WHAT DO I DO HERE"); strcat(arenas, string);
format(string, sizeof(string), "{9C9C9C}1\t{9C9C9C}Big Smoke's Crack Factory\t%dplayers here\n" WHAT DO I DO HERE); strcat(arenas, string);
Dialog_Show(playerid, DIALOG_DM, DIALOG_STYLE_TABLIST_HEADERS, "DM Arenas List", arenas, "Enter", "Close");
return 1;
}
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;
}
PlayerCount[0] //players in the sand id 0
PlayerCount[1] //players in the sand id 1
PlayerCount[0] += 1; //when the player enters the arena "0"
PlayerCount[1] += 1; //when the player enters the arena "1"
PlayerCount[0] -= 1; //when the player leaves the arena "0"
PlayerCount[1] -= 1; /when the player leaves the arena "1"
CMD:lobby(playerid, params[])
{
if(InDM[playerid])
{
SpawnUser(playerid);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have returned to the lobby.");
InDM[playerid] = false;
CountInDM[0] -= 1;
CountInDM[1] -= 1;
}
else
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You are not inside any DM area.");
}
return 1;
}
new var; //Global variable
var++
var--;
Код:
new var; Код:
var++ Код:
var--; |
Are you blind or what? Undef1ned already posted a better code but i have an issue, you can check that if you want, thanks.
|
enum
{
Game_None,
Game_LV,
Game_BS
};
new
PlayerCount[2],
InDM[MAX_PLAYERS];
CMD:lobby(playerid, params[])
{
if(InDM[playerid] == Game_None) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "You are not inside any DM area.");
switch(InDM[playerid])
{
case Game_LV: CountInDM[0] -= 1;
case Game_BS: CountInDM[1] -= 1;
}
SpawnUser(playerid);
InDM[playerid] = Game_None;
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have returned to the lobby.");
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid)
{
case DIALOG_DM:
{
if(response)
{
switch(listitem)
{
case 0:
{
CountInDM[0] += 1;
//code
}
case 1:
{
CountInDM[1] += 1;
//code
}
}
}
return 1;
}
}
return 1;
}
InDM[playerid] = Game_LV;
InDM[playerid] = Game_BS;
if(InDM[playerid] != Game_None) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "You are already in a DM arena, do /lobby first.");
CountDMPlayers()
{
new cdmplayers;
for(new i; i<MAX_PLAYERS;i++)
{
if(InDM[i] ==1)
{
cdmplayers++;
}
}
return cdmplayers;
}