Advertisement
Xogos

BlackListWeapons

Nov 7th, 2015
391
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 3.36 KB | None | 0 0
  1. #include a_samp
  2.  
  3. /*
  4. here you adding black list weapons
  5. */
  6.  
  7. new BlackList[2] = {38,35};
  8.  
  9. #define ACTION_BLACKLIST 1
  10.  
  11. /*
  12. 1 = replace weapon.
  13. 2 = reset all weapon.
  14.  
  15. just use only:
  16.  
  17. CheckBlackList(playerid);
  18.  
  19. in public or timer.
  20. */
  21.  
  22. #define FIND_MESSAGE_REMOVE_ALL "Ehm.. we found prohibited weapon! we removed you all weapons. next time dont use: %s"
  23. #define FIND_MESSAGE_REPLACE "We found prohibited weapon! we removed from your inventory this weapon: %s"
  24.  
  25. forward CheckBlackList(i);
  26. public CheckBlackList(i)
  27. {
  28.     for(new j; j < sizeof(BlackList); j ++)
  29.     {
  30.         switch(ACTION_BLACKLIST)
  31.         {
  32.             case 1:
  33.             {
  34.                 if(GetPlayerWeapon(i) == BlackList[j])
  35.                 {
  36.                     new str[256];
  37.                     format(str,sizeof(str),FIND_MESSAGE_REPLACE,WeaponName(GetPlayerWeapon(i)));
  38.                     SendClientMessage(i,-1,str);
  39.                     ReplaceThisWeapon(i);
  40.                 }
  41.             }
  42.             case 2:
  43.             {
  44.                 if(GetPlayerWeapon(i) == BlackList[j])
  45.                 {
  46.                     new str[256];
  47.                     format(str,sizeof(str),FIND_MESSAGE_REMOVE_ALL,WeaponName(GetPlayerWeapon(i)));
  48.                     SendClientMessage(i,-1,str);
  49.                     ResetPlayerWeapons(i);
  50.                 }
  51.             }
  52.         }
  53.     }
  54. }
  55.  
  56. stock ReplaceThisWeapon(playerid)
  57. {
  58.     new weapons[13][2];
  59.     for (new i = 0; i <= 12; i++)
  60.     {
  61.         GetPlayerWeaponData(playerid, i, weapons[i][0], weapons[i][1]);
  62.     }
  63.     ResetPlayerWeapons(playerid);
  64.    
  65.     for (new i = 0; i <= 12; i++)
  66.     {
  67.         for(new j; j < sizeof(BlackList); j ++)
  68.         {
  69.             if(weapons[i][0] != BlackList[j])
  70.             {
  71.                 GivePlayerWeapon(playerid, weapons[i][0], weapons[i][1]);
  72.             }
  73.         }
  74.     }
  75. }
  76.  
  77. stock WeaponName(weapon)
  78. {
  79.     new str[20];
  80.     switch(weapon)
  81.     {
  82.         case 0: strcat(str,"nothing");
  83.         case 1: strcat(str,"Brass Knuckles");
  84.         case 2: strcat(str,"Golf Club");
  85.         case 3: strcat(str,"Nightstick");
  86.         case 4: strcat(str,"knife");
  87.         case 5: strcat(str,"Baseball Bat");
  88.         case 6: strcat(str,"shovel");
  89.         case 7: strcat(str,"Pool Cue");
  90.         case 8: strcat(str,"katana");
  91.         case 9: strcat(str,"Chainsaw");
  92.         case 10: strcat(str,"Purple dildo");
  93.         case 11: strcat(str,"dildo");
  94.         case 12: strcat(str,"vibrator");
  95.         case 13: strcat(str,"silver dildo");
  96.         case 14: strcat(str,"Flowers");
  97.         case 15: strcat(str,"Cane");
  98.         case 16: strcat(str,"Grenade");
  99.         case 17: strcat(str,"Tear Gas");
  100.         case 18: strcat(str,"Molotov Cocktail");
  101.         case 22: strcat(str,"9mm");
  102.         case 23: strcat(str,"Silenced  9mm");
  103.         case 24: strcat(str,"desert eagle");
  104.         case 25: strcat(str,"shotgun");
  105.         case 26: strcat(str,"sawnoff shotgun");
  106.         case 27: strcat(str,"combat shotgun");
  107.         case 28: strcat(str,"Uzi");
  108.         case 29: strcat(str,"mp5");
  109.         case 30: strcat(str,"ak47");
  110.         case 31: strcat(str,"m4a1");
  111.         case 32: strcat(str,"tec 9");
  112.         case 33: strcat(str,"country rifle");
  113.         case 34: strcat(str,"sniper rifle");
  114.         case 35: strcat(str,"RPG");
  115.         case 36: strcat(str,"hs rocket");
  116.         case 37: strcat(str,"flamethrower");
  117.         case 38: strcat(str,"minigun");
  118.         case 39: strcat(str,"satchel charge");
  119.         case 40: strcat(str,"detonator");
  120.         case 41: strcat(str,"Spraycan");
  121.         case 42: strcat(str,"Fire Extinguisher");
  122.         case 43: strcat(str,"Camera");
  123.         case 44: strcat(str,"Night Vis Goggles");
  124.         case 45: strcat(str,"Thermal Goggles");
  125.         case 46: strcat(str,"Parachute");
  126.     }
  127.     return str;
  128. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement