Advertisement
Guest User

ё

a guest
Mar 25th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.35 KB | None | 0 0
  1. public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
  2. {
  3. if(PI[issuerid][DzenMardSpanes] == 1)
  4. {
  5. PlayerPlaySound(issuerid,6401,0.0,0.0,0.0);
  6. }
  7. SetPVarInt(playerid, "AntiFloodHEALME", gettime() + 10);
  8. SetPVarInt(issuerid, "AntiFloodHEALME", gettime() + 10);
  9. if(PI[playerid][Health] != 0 && PI[playerid][Health] < 100)
  10. {
  11. new local_str[25];
  12. if(PI[playerid][Armor] != 0) format(local_str, sizeof(local_str), "HP %.0f | AR %.0f", PI[playerid][Health], PI[playerid][Armor]);
  13. else format(local_str, sizeof(local_str), "HP %.0f", PI[playerid][Health]);
  14. SetPlayerChatBubble(playerid, local_str, 0x00FF0050, 20.0, 5000);
  15. }
  16. if(weaponid == 49 && GetPlayerState(playerid) == 1 && GetPlayerState(issuerid) == 2)
  17. {
  18. if(!IsAVelik(OverallCarId[issuerid]))
  19. {
  20. if(PI[playerid][Admin] >= AdmLvl4) return 1;
  21. if(PIcar[issuerid][CarGUID] == OverallCarId[issuerid])
  22. {
  23. if(!PIcar[issuerid][Protipozarni] && Engine[OverallCarId[issuerid]])
  24. {
  25. new Float:x, Float:y, Float:z;
  26. GetPlayerPos(playerid, x, y, z);
  27. if(IsPlayerInRangeOfPoint(issuerid, 100000000.0, x, y, z)) RemovePlayerFromVehicle(issuerid);
  28. Engine[OverallCarId[issuerid]] = true;
  29. ToggleEngine(OverallCarId[issuerid]);
  30. SendClientMessage(issuerid, COLOR_SYSTEM, "Ты повредил транспорт, двигатель выключен");
  31. }
  32. } else {
  33. if(Engine[OverallCarId[issuerid]])
  34. {
  35. new Float:x, Float:y, Float:z;
  36. GetPlayerPos(playerid, x, y, z);
  37. if(IsPlayerInRangeOfPoint(issuerid, 100000000.0, x, y, z)) RemovePlayerFromVehicle(issuerid);
  38. Engine[OverallCarId[issuerid]] = true;
  39. ToggleEngine(OverallCarId[issuerid]);
  40. SendClientMessage(issuerid, COLOR_SYSTEM, "Ты повредил транспорт, двигатель выключен");
  41. }
  42. }
  43. }
  44. }
  45. return true;
  46. }
  47.  
  48.  
  49.  
  50.  
  51. public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid, bodypart)
  52. {
  53. if(damagedid != INVALID_PLAYER_ID && PI[damagedid][Health] > 0)
  54. {
  55. if(IsPlayerInAnyVehicle(playerid) && GetPlayerVehicleSeat(playerid) == 0) ClearAnimations(playerid);
  56. if(!PI[damagedid][GodMode])
  57. {
  58. if(weaponid == 34 || weaponid == 33)
  59. {
  60. if(bodypart == 9)
  61. {
  62. if(PI[damagedid][Armor] > 0.1) setPlayerArmour(damagedid, 0.0);
  63. if(PI[damagedid][Health] > 0.1) setPlayerHealth(damagedid, 0.0);
  64. }
  65. else if(bodypart == 3)
  66. {
  67. if(PI[damagedid][Armor] >= 25.0) setPlayerArmour(damagedid, 0.0);
  68. if(PI[damagedid][Health] >= 25.0) setPlayerHealth(damagedid, 0.0);
  69. }
  70. }
  71. }
  72. if(PI[playerid][Exp] == 0 && PI[playerid][Level] == 1)
  73. {
  74. if(weaponid == 0)
  75. {
  76. ClearAnimations(playerid);
  77. ApplyAnimationEx(playerid, "MISC", "plyr_shkhead", 4.0,0,0,0,0,0);
  78. SendClientMessage(playerid, COLOR_SYSTEM, "Первый час игры ты не можешь драться");
  79. }
  80. }
  81. if(PI[playerid][Faction] > 3 && PI[playerid][Faction] < 7)
  82. {
  83. if(weaponid == 3)
  84. {
  85. ClearAnimations(damagedid);
  86. ApplyAnimationEx(damagedid, "PED", "KO_SKID_BACK", 4.1,0,1,1,1,0);
  87. SetPVarInt(damagedid, "CopAttacked", 1);
  88. SetTimerEx("CopAttackDis", 15000, false, "d", damagedid);
  89. SetTimerEx("ClearAnims", 15000, false, "d", damagedid);
  90. }
  91. }
  92. if(IsNoDM(playerid))
  93. {
  94. ClearAnimations(playerid);
  95. ApplyAnimationEx(playerid, "PED", "IDLE_tired", 4.1,1,0,0,0,4500);
  96. ShowPlayerDialog(playerid,D_NULL,DIALOG_STYLE_MSGBOX,"{FF0000}Внимание","{FFFFFF}В данном месте запрещенно драться!","Ок","");
  97. }
  98. }
  99. return true;
  100. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement