Advertisement
Guest User

Untitled

a guest
May 25th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.94 KB | None | 0 0
  1. if(strcmp(cmd, "/knockout", true) == 0)
  2. {
  3. if(IsPlayerConnected(playerid))
  4. {
  5. if(gPlayerLogged[playerid] == 0)
  6. {
  7. SendClientMessage(playerid, COLOR_GREY, " Для начала войдите в аккаунт ");
  8. return 1;
  9. }
  10. if(PlayerInfo[playerid][pLevel] < 3)
  11. {
  12. SendClientMessage(playerid, COLOR_GREY, " Вам нужен 3 лвл, чтобы использовать эту команду ");
  13. return 1;
  14. }
  15. if(KnockedDown[playerid] == 1)
  16. {
  17. SendClientMessage(playerid, COLOR_GREY, " Игрок уже без сознания ");
  18. return 1;
  19. }
  20. if(PlayerInfo[playerid][pSex] == 2)
  21. {
  22. SendClientMessage(playerid, COLOR_GREY, " У вас не хватит сил, чтобы сбить кого то с ног ");
  23. return 1;
  24. }
  25. if(PlayerBoxing[playerid] != 0)
  26. {
  27. SendClientMessage(playerid, COLOR_GREY, " Это является запрещенным приемом ");
  28. return 1;
  29. }
  30. tmp = strtok(cmdtext, idx);
  31. if(!strlen(tmp))
  32. {
  33. SendClientMessage(playerid, COLOR_WHITE, " /knockout [id игрока] ");
  34. return 1;
  35. }
  36. giveplayerid = ReturnUser(tmp);
  37. if(IsPlayerConnected(giveplayerid))
  38. {
  39. if(giveplayerid != INVALID_PLAYER_ID)
  40. {
  41. if (ProxDetectorS(1.0, playerid, giveplayerid))
  42. {
  43. if(KnockedDown[giveplayerid] != 1)
  44. {
  45. if(giveplayerid == playerid)
  46. {
  47. SendClientMessage(playerid, COLOR_GREY, " Вы не можете повалить себя ");
  48. return 1;
  49. }
  50. if(PlayerInfo[giveplayerid][pSex] == 2)
  51. {
  52. SendClientMessage(playerid, COLOR_GREY, " Н нападать на девушку ");
  53. return 1;
  54. }
  55. if(IsPlayerInAnyVehicle(giveplayerid))
  56. {
  57. return 1;
  58. }
  59. if(PlayerInfo[playerid][pForce] <= PlayerInfo[giveplayerid][pForce])
  60. {
  61. new rnd = random(10);
  62. if(rnd < 5)
  63. {
  64. SendClientMessage(playerid, COLOR_GREY, " У вас не хватило сил, чтобы ударить игрока! ");
  65. return 1;
  66. }
  67. }
  68. new maneyka = GetPlayerMoney(playerid);
  69. new giveplayername[MAX_PLAYER_NAME];
  70. GetPlayerName(playerid, sendername, sizeof(sendername));
  71. GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
  72. new rands = random(2)+1;
  73. format(string, sizeof(string), "* %s ударил в лицо %s и повалил его на землю", sendername, giveplayername);
  74. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  75. ApplyAnimation(playerid,"FIGHT_D","FightD_3",4.0,0,1,1,0,0);
  76. if(rands == 1)
  77. {
  78. TogglePlayerControllable(giveplayerid, 0);
  79. ApplyAnimation(giveplayerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
  80. SetTimerEx("ClearKnock", 20000, false, "i", giveplayerid);
  81. KnockedDown[giveplayerid] = 1;
  82. format(string,sizeof(string), "~g~+%d$",maneyka);
  83. GameTextForPlayer(playerid, string , 7000, 1);
  84. GivePlayerMoneyAnt(giveplayerid,-maneyka);
  85. format(string,sizeof(string), "~r~-%d$",maneyka);
  86. GameTextForPlayer(giveplayerid, string , 7000, 1);
  87. ResetPlayerMoney(giveplayerid);
  88. WantedPoints[playerid]+=1; //розыска при ограблении
  89. SetPlayerCriminal(playerid,255, " Грабеж игрока ");
  90. format(string,sizeof(string), "~g~-%d$",maneyka);
  91. GameTextForPlayer(giveplayerid, string , 7000, 1);
  92. format(string, sizeof(string), "* %s удар прошел удачно", sendername);
  93. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  94. }
  95. else
  96. {
  97. format(string, sizeof(string), "* %s попытался ударить %s, но промахнулся.", sendername, giveplayername);
  98. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  99. }
  100. return 1;
  101. }
  102. else
  103. {
  104. SendClientMessage(playerid, COLOR_GREY, " Игрок уже повален ");
  105. }
  106. }
  107. else
  108. {
  109. SendClientMessage(playerid, COLOR_GREY, " Этот игрок находится далеко от вас ");
  110. }
  111. }
  112. }
  113.  
  114. }
  115. return 1;
  116. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement