Код:
CMD:dir(playerid, params[])
{
if(!AcceptWrite(playerid)) return 1;
if(pData[playerid][TelefonSprav] == 0) return SendClientMessage(playerid, COLOR_GREY, "У вас нету телефонного справочника");
ShowPlayerDialog(playerid, 20, DIALOG_STYLE_LIST, "Телефонный справочник", "Таксисты\nМеханики\nМедики\nЛидеры\nАдвокаты\nРазвозчики продуктов", "Просмотр", "Отмена");
return true;
}
case 20:
{
if(response)
{
switch(listitem)
{
case 0:
{
SendClientMessage(playerid, 0xF10DEB10AA, "Таксисты:");
foreach(new i: Player)
{
if(pData[i][Job] == 1)
{
SendMes(playerid,0xAAF79FFF,"%s [тел: %d]",getName(i),pData[i][pNumber]);
}
}
}
case 1:
{
SendClientMessage(playerid, 0xF10DEB10AA, "Механики:");
foreach(new i: Player)
{
if(pData[i][Job] == 3)
{
SendMes(playerid,0xAAF79FFF,"%s [тел: %d]",getName(i),pData[i][pNumber]);
}
}
}
case 2:
{
SendClientMessage(playerid, 0xF10DEB10AA, "Медики:");
foreach(new i: Player)
{
if(pData[i][Member] == 14)
{
SendMes(playerid,0xAAF79FFF,"%s [тел: %d]",getName(i),pData[i][pNumber]);
}
}
}
case 3:
{
SendClientMessage(playerid, 0xF10DEB10AA, "Лидеры:");
foreach(new i: Player)
{
switch(pData[playerid][Leader])
{
case 1: SendMes(playerid, 0xAAF79FFF," LSPD: %s [тел: %d] ",getName(i), pData[i][pNumber]);
case 2: SendMes(playerid, 0xAAF79FFF," SFPD: %s [тел: %d] ",getName(i), pData[i][pNumber]);
case 3: SendMes(playerid, 0xAAF79FFF," LVPD: %s [тел: %d] ",getName(i), pData[i][pNumber]);
case 4: SendMes(playerid, 0xAAF79FFF," Инструкторы: %s [тел: %d] ",getName(i), pData[i][pNumber]);
case 5: SendMes(playerid, 0xAAF79FFF," Grove: %s [тел: %d] ",getName(i), pData[i][pNumber]);
case 6: SendMes(playerid, 0xAAF79FFF," Ballas: %s [тел: %d] ",getName(i), pData[i][pNumber]);
case 7: SendMes(playerid, 0xAAF79FFF," Rifa: %s [тел: %d] ",getName(i), pData[i][pNumber]);
case 8: SendMes(playerid, 0xAAF79FFF," Vagos: %s [тел: %d] ",getName(i), pData[i][pNumber]);
case 9: SendMes(playerid, 0xAAF79FFF," Aztec: %s [тел: %d] ",getName(i), pData[i][pNumber]);
case 10: SendMes(playerid, 0xAAF79FFF," Army LV: %s [тел: %d] ",getName(i), pData[i][pNumber]);
case 11: SendMes(playerid, 0xAAF79FFF," Army SF: %s [тел: %d] ",getName(i), pData[i][pNumber]);
case 12: SendMes(playerid, 0xAAF79FFF," FBI: %s [тел: %d] ",getName(i), pData[i][pNumber]);
case 13: SendMes(playerid, 0xAAF79FFF," LCN: %s [тел: %d] ",getName(i), pData[i][pNumber]);
case 14: SendMes(playerid, 0xAAF79FFF," Медики: %s [тел: %d] ",getName(i), pData[i][pNumber]);
case 15: SendMes(playerid, 0xAAF79FFF," LS NEWS: %s [тел: %d] ",getName(i), pData[i][pNumber]);
case 16: SendMes(playerid, 0xAAF79FFF," Мэрия: %s [тел: %d] ",getName(i), pData[i][pNumber]);
case 17: SendMes(playerid, 0xAAF79FFF," SF NEWS: %s [тел: %d] ",getName(i), pData[i][pNumber]);
case 18: SendMes(playerid, 0xAAF79FFF," LV NEWS: %s [тел: %d] ",getName(i), pData[i][pNumber]);
}
}
}
case 4:
{
SendClientMessage(playerid, 0xF10DEB10AA, "Адвокаты:");
foreach(new i: Player)
{
if(pData[i][Member] == 16 && pData[i][Rank] == 2)
{
SendMes(playerid,0xAAF79FFF,"%s [тел: %d]",getName(i),pData[i][pNumber]);
}
}
}
case 5:
{
SendClientMessage(playerid, 0xF10DEB10AA, "Развозчики продуктов:");
foreach(new i: Player)
{
if(pData[i][Job] == 6)
{
SendMes(playerid,0xAAF79FFF,"%s [тел: %d]",getName(i),pData[i][pNumber]);
}
}
}
}
}
}