Advertisement
Guest User

Untitled

a guest
Dec 13th, 2018
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.89 KB | None | 0 0
  1. public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ) {
  2. foreach(new i : Player) {
  3. if(PlayerInfo[i][pJobVehicle] != 0) {
  4. new wep = GetPlayerWeapon(playerid);
  5. if((wep > 0 && wep < 43) && hitid == PlayerInfo[i][pJobVehicle] && !IsACop(playerid) && GetPlayerVirtualWorld(playerid) < 1) {
  6. SetPlayerArmedWeapon(playerid,0);
  7. SendClientMessage(playerid, RED2, "Nu poti folosi armele pe masinile de la job-uri. Poti petrece 30-90 minute in inchisoare pentru DM!");
  8. return 0;
  9. }
  10. }
  11. }
  12. if(hittype == 2) {
  13. foreach(new i : Player) {
  14. if(playerSpectateID[i] == playerid) {
  15. if(PlayerInfo[i][pAdmin] >= 1 && ShowDMG[i] == 1) va_sendLongMessage(i, 0xE7AAA5A5, "DMG: %s did damage to vehicle %d using weapon %s.",GetName(playerid),hitid,GetWName(weaponid));
  16. }
  17. }
  18. }
  19. if(hittype == 1) {
  20. foreach(new i : Player) {
  21. if(playerSpectateID[i] == playerid) DMInfo[playerid][0] = fX, DMInfo[playerid][1] = fY, DMInfo[playerid][2] = fZ;
  22. }
  23. }
  24. if(hittype != BULLET_HIT_TYPE_NONE) {
  25. if(!(-1000.0 <= fX <= 1000.0) || !(-1000.0 <= fY <= 1000.0) || !(-1000.0 <= fZ <= 1000.0)) {
  26. AdmBot(playerid, "possible weapon crash", 1);
  27. return 0;
  28. }
  29. }
  30. return 1;
  31. }
  32.  
  33.  
  34.  
  35. public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid, bodypart)
  36. {
  37. if(damagedid != INVALID_PLAYER_ID) {
  38.  
  39. if(GetPlayerSurfingVehicleID(playerid) != INVALID_VEHICLE_ID) return 1;
  40.  
  41. foreach(new i : Player) {
  42. if(playerSpectateID[i] == playerid) {
  43. if(PlayerInfo[i][pAdmin] >= 1 && ShowDMG[i] == 1) va_sendLongMessage(i, 0xE7AAA5A5, "DMG: %s did %f damage to %s using weapon %s. [hit: %f %f %f] [bodypart: %d]",GetName(playerid),amount,GetName(damagedid),GetWName(weaponid),DMInfo[playerid][0],DMInfo[playerid][1],DMInfo[playerid][2],bodypart);
  44. }
  45. }
  46.  
  47. if(weaponid == WEAPON_PARACHUTE && amount > 10) {
  48. AdmBot(playerid, "Cheats (possible fake damage)", 1);
  49. return 0;
  50. }
  51. if(amount > 10.0 && amount != 54.12 && weaponid == 0) {
  52. AdmBot(playerid, "Cheats (possible fake damage)", 1);
  53. return 0;
  54. }
  55. if(amount < 0) {
  56. AdmBot(playerid, "Cheats (possible fake damage)", 1);
  57. return 0;
  58. }
  59. if(amount > 9.8 && amount < 9.9 && weaponid == WEAPON_M4) {
  60. AdmBot(playerid, "Cheats (possible silent aimbot)", 1);
  61. return 0;
  62. }
  63. if(amount == 46 && weaponid == WEAPON_DEAGLE) {
  64. AdmBot(playerid, "Cheats (possible silent aimbot)", 1);
  65. return 0;
  66. }
  67. if(amount == 24.642856 && weaponid == WEAPON_RIFLE) {
  68. AdmBot(playerid, "Cheats (possible silent aimbot)", 1);
  69. return 0;
  70. }
  71. if(amount == 9.857147 && weaponid == WEAPON_AK47) {
  72. AdmBot(playerid, "Cheats (possible silent aimbot)", 1);
  73. return 0;
  74. }
  75.  
  76.  
  77. new fpm = PlayerInfo[playerid][pGroup];
  78. new fkm = PlayerInfo[damagedid][pGroup];
  79. for(new turf = 1; turf < sizeof(ZoneInfo); turf++) {
  80. if(IsPlayerInTurf(playerid, turf) && IsPlayerInTurf(damagedid, turf)) {
  81. if(IsAMember(playerid) && IsAMember(damagedid)) {
  82. if(WarInfo[turf][wFaction] == fpm && WarInfo[turf][wAttacker] == fkm || WarInfo[turf][wFaction] == fkm && WarInfo[turf][wAttacker] == fpm) PlayerPlaySound(playerid,17802,0.0,0.0,0.0);
  83. }
  84. }
  85. }
  86. new weaponName[526];
  87. GetWeaponName(weaponid, weaponName, sizeof (weaponName));
  88.  
  89. if(TazerON[playerid] == 1 && IsACop(playerid) && weaponid == 23)
  90. new chance = random(10);
  91. if(Tazed[damagedid] != 0) return SendClientMessage(playerid, COLOR_ERROR, "Acest jucator este deja prins.");
  92. if(IsACop(damagedid)) return SendClientMessage(playerid, COLOR_ERROR, "Nu poti prinde coechiperii.");
  93. if(IsPlayerInAnyVehicle(damagedid)) return SendClientMessage(playerid, COLOR_ERROR, "Acest jucator este intr-un vehicul.");
  94. switch(chance) {
  95. case 0,2,4,6,8: {
  96.  
  97. va_SendClientMessage(damagedid, COLOR_SYN2,"Ai fost prins de %s pentru 3 secunde.", GetName(playerid));
  98. va_SendClientMessage(playerid, COLOR_SYN2, "L-ai prins pe %s pentru 3 secunde.", GetName(damagedid));
  99. va_ProxDetector(30.0, playerid, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE, "* %s incearca sa-l prinda pe %s, acesta a fost prins.", GetName(playerid) ,GetName(damagedid));
  100. GameTextForPlayer(damagedid, "~r~Tazed", 2500, 3);
  101. TogglePlayerControllableEx(damagedid, 0);
  102. Tazed[damagedid] = 1;
  103. ApplyAnimation(damagedid,"PED","KO_skid_front",4.1,0,1,1,1,0);
  104. amount = 0;
  105. SetTimerEx("unfr", 3000, false, "i", damagedid);
  106. }
  107. case 1,3,5,7,9: {
  108. va_ProxDetector(30.0, playerid, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE, "* %s incearca sa-l prinda pe %s, dar a scapat.", GetName(playerid) ,GetName(damagedid));
  109. amount = 0;
  110. }
  111. }
  112. }
  113. if(PaintType[playerid] > 0) PlayerPlaySound(playerid,17802,0.0,0.0,0.0);
  114. if(PaintType[damagedid] > 0) {
  115. if(PaintTime[PaintType[damagedid]-1] < 1) SetPlayerHealth(damagedid, 100.0);
  116. }
  117. }
  118. return 1;
  119. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement