Advertisement
Joker95

Untitled

Jul 9th, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.42 KB | None | 0 0
  1. CMD:call ( playerid, params [ ] )
  2. {
  3. if(PlayerInfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_LIGHTRED, "У вас бан чата!");
  4. if(gag[playerid] == 1) return SendClientMessage(playerid, COLOR_LIGHTRED, "У Вас кляп, вы не можете говорить!");
  5. if(takephone[playerid] == 1) return SendClientMessage(playerid, COLOR_LIGHTRED, "У Вас нет телефона");
  6. static
  7. number
  8. ;
  9. if ( sscanf ( params, "i", number ) ) return SendClientMessage ( playerid, -1, !"/call [номер]" );
  10.  
  11. if(!number) return true;
  12. if(number == PlayerInfo[playerid][pPnumber] )
  13. return SendClientMessage ( playerid, -1, !"Вы указали свой номер");
  14. if ( GetPVarInt ( playerid, !"if_p_CALLED")) return SendClientMessage(playerid, COLOR_GRAD2, "Вы уже разговариваете...");
  15. for(new i = GetMaxPlayers( )-1; i != -1; i--)
  16. {
  17. if ( PlayerInfo[ i ] [pPnumber] == number || 118888 == number)
  18. {
  19. if ( GetPVarInt ( i, !"if_p_CALLED")) return SendClientMessage ( playerid, -1, !"Абонент которуму вы звоните - занят. Перезвоните позже.");
  20. if(number == 11888)
  21. {
  22. if(smsls == 0) return SendClientMessage(playerid, COLOR_GREY, "Прямой эфир отключен...");
  23. format(CommandMas, sizeof(CommandMas), "[Звонок] В студию звонит %s: Введите /yes [%d], чтобы ответить",PlayerInfo[playerid][pNames], playerid);
  24. SendFamilyMessage(16, COLOR_YELLOW2, CommandMas);
  25. SendClientMessage(playerid, COLOR_WHITE, "Чтобы повесить трубку введите /h");
  26. SetPlayerSpecialAction(playerid,11);
  27. zvonok[playerid] = 1;
  28. PlayerInfo[playerid][pBank] -= smspricels;
  29. //DateOther[fLsnews] += smspricels;
  30. return true;
  31. }
  32. static const
  33. fmt_str_call [ ] = "Исходящий звонок | Номер: %i | Ожидание ответа от %s";
  34. static
  35. str_call [ sizeof(fmt_str_call) + 6 + 21 - 4]
  36. ;
  37. format ( str_call, sizeof(str_call), fmt_str_call,PlayerInfo[ i ] [pPnumber],PlayerInfo[ i ] [pNames]);
  38. SendClientMessage ( playerid, -1, str_call );
  39. //
  40. static const
  41. fmt_str_call2 [ ] = "Входящий звонок | Номер: %i";
  42. static
  43. str_call2 [ sizeof(fmt_str_call2) + 6 - 2]
  44. ;
  45. format(str_call2, sizeof(str_call2), fmt_str_call2, PlayerInfo[ playerid ] [pPnumber] );
  46. SendClientMessage ( i, -1, str_call2 );
  47. SendClientMessage ( i, -1, !"Начать разговор - /p, закончить - /h");
  48.  
  49. SetPVarInt ( playerid, !"if_p_CALLED", i + 1 );
  50. SetPVarInt ( i, !"if_p_CALLED", playerid + 1 );
  51.  
  52. SetPlayerChatBubble(playerid, "достал(а) телефон", -1, 5, 7500);
  53. SetPlayerChatBubble(i, "Звонит телефон", -1, 5, 7500);
  54. SetPlayerSpecialAction ( playerid, SPECIAL_ACTION_USECELLPHONE );
  55. return true;
  56. }
  57. }
  58. SendClientMessage ( playerid, -1, !"Номер вне зоны доступа сети");
  59. return true;
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement