Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 3.22 KB | None | 0 0
  1. -------#include <a_samp>
  2.  
  3. #define COLOR_RED 0xAA3333AA
  4.  
  5. new aWeaponNames[][32] = {
  6.     {"Fist"}, // 0
  7.     {"Brass Knuckles"}, // 1
  8.     {"Golf Club"}, // 2
  9.     {"Night Stick"}, // 3
  10.     {"Knife"}, // 4
  11.     {"Baseball Bat"}, // 5
  12.     {"Shovel"}, // 6
  13.     {"Pool Cue"}, // 7
  14.     {"Katana"}, // 8
  15.     {"Chainsaw"}, // 9
  16.     {"Purple Dildo"}, // 10
  17.     {"Vibrator"}, // 11
  18.     {"Vibrator"}, // 12
  19.     {"Vibrator"}, // 13
  20.     {"Flowers"}, // 14
  21.     {"Cane"}, // 15
  22.     {"Grenade"}, // 16
  23.     {"Teargas"}, // 17
  24.     {"Molotov"}, // 18
  25.     {" "}, // 19
  26.     {" "}, // 20
  27.     {" "}, // 21
  28.     {"Colt 45"}, // 22
  29.     {"Silenced Pistol"}, // 23
  30.     {"Deagle"}, // 24
  31.     {"Shotgun"}, // 25
  32.     {"Sawns"}, // 26
  33.     {"Spas"}, // 27
  34.     {"Uzi"}, // 28
  35.     {"MP5"}, // 29
  36.     {"AK47"}, // 30
  37.     {"M4"}, // 31
  38.     {"Tec9"}, // 32
  39.     {"Country Rifle"}, // 33
  40.     {"Sniper Rifle"}, // 34
  41.     {"Rocket Launcher"}, // 35
  42.     {"Heat-Seeking Rocket Launcher"}, // 36
  43.     {"Flamethrower"}, // 37
  44.     {"Minigun"}, // 38
  45.     {"Satchel Charge"}, // 39
  46.     {"Detonator"}, // 40
  47.     {"Spray Can"}, // 41
  48.     {"Fire Extinguisher"}, // 42
  49.     {"Camera"}, // 43
  50.     {"Night Vision Goggles"}, // 44
  51.     {"Infrared Vision Goggles"}, // 45
  52.     {"Parachute"}, // 46
  53.     {"Fake Pistol"} // 47
  54. };
  55.  
  56. public OnFilterScriptInit()
  57. {
  58.     print("\n--------------------------------------");
  59.     print(" Simple & Accurate Anti-C-Bug by [___]Whitetiger.");
  60.     print("--------------------------------------\n");
  61.     return 1;
  62. }
  63.  
  64. public OnFilterScriptExit()
  65. {
  66.     return 1;
  67. }
  68.  
  69. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  70. {
  71.     if((newkeys & KEY_FIRE) && (newkeys & KEY_HANDBRAKE)) { //handbrake = aim
  72.         SetTimerEx("CrouchCheck", 3000, 0, "d", playerid);
  73.         SetPVarInt(playerid, "CheckCrouch", 1);
  74.         new weaponid = GetPlayerWeapon(playerid);
  75.         SetPVarInt(playerid, "WeaponId", weaponid);
  76.     }
  77.     else if(newkeys == KEY_FIRE) {
  78.         SetTimerEx("CrouchCheck", 3000, 0, "d", playerid);
  79.         SetPVarInt(playerid, "CheckCrouch", 1);
  80.         new weaponid = GetPlayerWeapon(playerid);
  81.         SetPVarInt(playerid, "WeaponId", weaponid);
  82.     }
  83.     return 1;
  84. }
  85.  
  86. public OnPlayerUpdate(playerid)
  87. {
  88.     new checkcbug = GetPVarInt(playerid, "CheckCrouch");
  89.     if(checkcbug == 1) {
  90.         new weaponid = GetPVarInt(playerid, "WeaponId");
  91.         if(weaponid == 24 || weaponid == 25 || weaponid == 27 || weaponid == 29 || weaponid == 23 || weaponid == 29
  92.         || weaponid == 30 || weaponid == 31 || weaponid == 33 || weaponid == 34 || weaponid == 41) {
  93.             new Keys, ud, lr;
  94.             GetPlayerKeys(playerid, Keys, ud, lr);
  95.             if(Keys == KEY_CROUCH) {
  96.                 new name[MAX_PLAYER_NAME];
  97.                 GetPlayerName(playerid, name, sizeof(name));
  98.                 if(strfind(name, "[___]", true) != -1) return 0;
  99.                 OnPlayerCBug(playerid);
  100.                 SetPVarInt(playerid, "CheckCrouch", 0);
  101.             }
  102.         }
  103.     }
  104.     return 1;
  105. }
  106.  
  107. forward OnPlayerCBug(playerid);
  108. public OnPlayerCBug(playerid) {
  109.     new weaponid = GetPVarInt(playerid, "WeaponId");
  110.     new playername[MAX_PLAYER_NAME];
  111.     GetPlayerName(playerid, playername, sizeof(playername));
  112.     new str2[128];
  113.     format(str2, sizeof(str2), "Automatic system has kicked %s for Crouch bugging with weapon (%s!)", playername, aWeaponNames[weaponid]);
  114.     SendClientMessageToAll(COLOR_RED, str2);
  115.     Kick(playerid);
  116.     return 1;
  117. }
  118. forward CrouchCheck(playerid);
  119. public CrouchCheck(playerid) {
  120.     SetPVarInt(playerid, "CheckCrouch", 0);
  121.  
  122. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement