Advertisement
Joker95

Untitled

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