Advertisement
Guest User

Untitled

a guest
Aug 29th, 2021
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.46 KB | None | 0 0
  1. public OnPlayerWeaponShot( playerid, weaponid, hittype, hitid, Float: fX, Float: fY, Float:fZ ) {
  2. new bool:cheat = false;
  3. switch(weaponid) {
  4. case 26: cheat = true;
  5. case 35..40: cheat = true;
  6. case 44..46: cheat = true;
  7. }
  8. if(cheat == true && !PlayerInfo[playerid][pAdmin]) {
  9. return AdmBot(playerid, "possible weapon-hack #3");
  10. }
  11. if(hittype != BULLET_HIT_TYPE_NONE) {
  12. if(!(-1000.0 <= fX <= 1000.0) || !(-1000.0 <= fY <= 1000.0) || !(-1000.0 <= fZ <= 1000.0)) {
  13. AdmBot(playerid, "possible weapon crash");
  14. return 0;
  15. }
  16. }
  17.  
  18. if(hittype == BULLET_HIT_TYPE_PLAYER && (isBadFloat(fX) || isBadFloat(fY) || isBadFloat(fZ))) {
  19. AdmBot(playerid, "possible weapon crash #1");
  20. return 0;
  21. }
  22. if((fX == floatstr("-0.009999")) && (fY == floatstr("-0.019999")) && (fZ == floatstr("0.039999"))) {
  23. AdmBot(playerid, "possible weapon crash #2");
  24. return 0;
  25. }
  26. if((((weaponid >= 0 && weaponid <= 15) || weaponid == 40 || weaponid >= 44) || (hitid == 0 && fX == 0 && fY == 0 && fZ == 0))) {
  27. KickEx(playerid);
  28. return 0;
  29. }
  30. if(PlayerInfo[playerid][pGunLic] < 1 && PlayerInfo[playerid][pAdmin] < 1 && PlayerInfo[playerid][pFPS] >= 1) {
  31. SendAdmins(COLOR_RED1, "Kick: %s was kicked by AdmBot, reason: weapon hack (without licence).", 1, GetName(playerid));
  32. Kick(playerid);
  33. return false;
  34. }
  35. if( hittype != BULLET_HIT_TYPE_NONE )
  36. {
  37. if( !( -1000.0 <= fX <= 1000.0 ) || !( -1000.0 <= fY <= 1000.0 ) || !( -1000.0 <= fZ <= 1000.0 ) )
  38. {
  39. SendAdmins(COLOR_RED1, "Kick: %s was kicked by AdmBot, reason: weapon hack #1.", 1, GetName(playerid));
  40. Kick(playerid);
  41. return false;
  42. }
  43. }
  44.  
  45. if(!((22 <= weaponid <= 34) || weaponid == 38) && PlayerInfo[playerid][pAdmin] < 1 && PlayerInfo[playerid][pFPS] >= 1) {
  46. SendAdmins(COLOR_RED1, "Kick: %s was kicked by AdmBot, reason: weapon hack #2.", 1, GetName(playerid));
  47. Kick(playerid);
  48. return false;
  49. }
  50. switch( hittype ) {
  51. case 1: {
  52. foreach( new x : Player ) {
  53. if( Spectate[ x ] == playerid ) DMInfo[ playerid ][ 0 ] = fX, DMInfo[ playerid ][ 1 ] = fY; DMInfo[ playerid ][ 2 ] = fZ;
  54. }
  55. }
  56. case 2: {
  57. foreach( new x : Player ) {
  58. if( Spectate[ x ] == playerid && PlayerInfo[ x ][ pAdmin ] >= 1 && ShowDMG[ x ] ) SCMf( x, COLOR_DARKPINK, "DMG: %s did damage to vehicle %d using a %s.", GetName( playerid ), hitid, weapName( weaponid ) );
  59. }
  60. }
  61. }
  62. return true; }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement