Advertisement
Guest User

Маза фака битчс

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