PHP код:
else if(strcmp(cmd, "/call", true) == 0)
{
if(PlayerInfo[playerid][pBank] <= 0)
{
format(stringer, sizeof(stringer), "[0] Сумма на вашем счету не достаточна для совершения звонка");
if(PlayerInfo[playerid][pPayDayHad] < 4) return SCM(playerid, COLOR_STANDART, "{BBBBBB}[Ошибка] Что-бы Позвонить вам нужно отыграть 4 часов как минимум!");
SCM(playerid, COLOR_GREY, stringer);
format(stringer, sizeof(stringer), "%s набирает телефонный номер", PlayerInfo[playerid][pNames]);
ProxDetector(5.0, playerid, stringer, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
return true;
}
if(gag[playerid] == 1) return SCM(playerid, COLOR_LIGHTRED, "У Вас кляп, вы не можете говорить!");
if(takephone[playerid] == 1) return SCM(playerid, COLOR_LIGHTRED, "У Вас нет телефона");
tmp = strcharsplit(cmdtext, idx);
if(PlayerInfo[playerid][pMuted] == 1) return SCM(playerid, 0xff6600AA, "Доступ в чат заблокирован.");
if(!strlen(tmp)) return SCM(playerid, COLOR_WHITE, " Введите: /call [номер]");
format(stringer, sizeof(stringer), "%s достаёт телефон", PlayerInfo[playerid][pNames]);
ProxDetector(30.0, playerid, stringer, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
new phonenumb = strval(tmp);
if(phonenumb == PlayerInfo[playerid][pPnumber])
{
SCM(playerid, COLOR_GRAD2, "Линия занята");
SetPlayerSpecialAction(playerid,13);
return true;
}
foreach(Player,i)
{
if(phonenumb == 11888)
{
if(smsls == 0) return SCM(playerid, COLOR_GREY, "Прямой эфир отключен...");
format(stringer, sizeof(stringer), "[Звонок] В студию звонит %s: Введите /yes [%d], чтобы ответить",PlayerInfo[playerid][pNames], playerid);
SendFamilyMessage(16, COLOR_YELLOW2, stringer);
SCM(playerid, COLOR_WHITE, "Чтобы повесить трубку введите /h");
SetPlayerSpecialAction(playerid,11);
zvonok[playerid] = 1;
PlayerInfo[playerid][pBank] -= smspricels;
FracBank[0][fLsnews] += smspricels;
return true;
}
if(Mobile[playerid] != INVALID_PLAYER_ID) return SCM(playerid, COLOR_GRAD2, "Вы уже разговариваете по телефону ");
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pPnumber] == phonenumb && phonenumb != 0)
{
giveplayerid = i;
Mobile[playerid] = giveplayerid; //caller connecting
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(PhoneOnline[giveplayerid] > 0) return SCM(playerid, COLOR_GREY, "Телефон абонента выключен...");
if (Mobile[giveplayerid] == INVALID_PLAYER_ID)
{
format(stringer, sizeof(stringer), "Входящий звонок от: %s", PlayerInfo[playerid][pNames]);
SCM(giveplayerid, COLOR_YELLOW2, stringer);
SCM(giveplayerid, COLOR_WHITE, " Введите /p, чтобы ответить ");
format(stringer, sizeof(stringer), "У %s звонит мобильник", PlayerInfo[giveplayerid][pNames]);
SCM(playerid, COLOR_WHITE, " Чтобы завершить звонок введите /h ");
ProxDetector(30.0, i, stringer, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SetPlayerSpecialAction(playerid,11);
CellTime[playerid] = 1;
return true;
}
}
}
}
}
}
SCM(playerid, COLOR_GRAD2, "Ошиблись номером");
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_STOPUSECELLPHONE);
return true;
}