29.09.2018, 22:06
Your code is wrong. You must have a variable to verify in which game the player is.
Example:
And when you enter a game it would be something like this:
Example:
PHP код:
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;
}
PHP код:
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;
}