Code
MenuPlayer(client)
{
new Handle:menu = CreateMenu(Select_Menu);
SetMenuTitle(menu, "Выберите с кем меняемся:\n \n");
decl String:userid[15], String:name[32]; new team = GetClientTeam(client)
for (new i = 1; i <= MaxClients; i++)
{
new teami = GetClientTeam(i);
if (IsClientInGame(i) && !involved[i] && teami != team && teami > 1)
{
PrintToChatAll("DEBUG"); // Это появляется в чате
IntToString(GetClientUserId(i), userid, 15);
GetClientName(i, name, 32);
AddMenuItem(menu, userid, name);
}
}
DisplayMenu(menu, client, 0);
}
public Select_Menu(Handle:menu, MenuAction:action, client, option)
{
if (action == MenuAction_End)
{
CloseHandle(menu);
return;
}
if (action != MenuAction_Select) return;
decl String:userid[15];
GetMenuItem(menu, option, userid, 15);
new target = GetClientOfUserId(StringToInt(userid));if (involved[target]) { PrintToChat(client, "\x03Игрока уже пригласили"); return; }
if (target > 0)
{
AskForPermission(client, target);
}
else{
PrintToChat(client, "{lightgreen}[{default}Holi-top{lightgreen}]{blue}Игрок вышел");
MenuPlayer(client);
}
}