Guest User

Ammunation help

a guest
Feb 26th, 2015
308
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 3.32 KB | None | 0 0
  1. GivePlayerValidWeapon( playerid, WeaponID, Ammo )
  2. {
  3. if((PlayerInfo[playerid][pConnectTime] < 2 || PlayerInfo[playerid][pWRestricted] > 0) && WeaponID != 46 && WeaponID != 43) return 1;
  4. switch( WeaponID )
  5. {
  6. case 0, 1:
  7. {
  8. PlayerInfo[playerid][pGuns][ 0 ] = WeaponID;
  9. GivePlayerWeapon( playerid, WeaponID, Ammo );
  10. }
  11. case 2, 3, 4, 5, 6, 7, 8, 9:
  12. {
  13. PlayerInfo[playerid][pGuns][ 1 ] = WeaponID;
  14. GivePlayerWeapon( playerid, WeaponID, Ammo );
  15. }
  16. case 22, 23, 24:
  17. {
  18. PlayerInfo[playerid][pGuns][ 2 ] = WeaponID;
  19. GivePlayerWeapon( playerid, WeaponID, Ammo );
  20. }
  21. case 25, 26, 27:
  22. {
  23. PlayerInfo[playerid][pGuns][ 3 ] = WeaponID;
  24. GivePlayerWeapon( playerid, WeaponID, Ammo );
  25. }
  26. case 28, 29, 32:
  27. {
  28. PlayerInfo[playerid][pGuns][ 4 ] = WeaponID;
  29. GivePlayerWeapon( playerid, WeaponID, Ammo );
  30. }
  31. case 30, 31:
  32. {
  33. PlayerInfo[playerid][pGuns][ 5 ] = WeaponID;
  34. GivePlayerWeapon( playerid, WeaponID, Ammo );
  35. }
  36. case 33, 34:
  37. {
  38. PlayerInfo[playerid][pGuns][ 6 ] = WeaponID;
  39. GivePlayerWeapon( playerid, WeaponID, Ammo );
  40. }
  41. case 35, 36, 37, 38:
  42. {
  43. PlayerInfo[playerid][pGuns][ 7 ] = WeaponID;
  44. GivePlayerWeapon( playerid, WeaponID, Ammo );
  45. }
  46. case 16, 17, 18, 39, 40:
  47. {
  48. PlayerInfo[playerid][pGuns][ 8 ] = WeaponID;
  49. GivePlayerWeapon( playerid, WeaponID, Ammo );
  50. }
  51. case 41, 42, 43:
  52. {
  53. PlayerInfo[playerid][pGuns][ 9 ] = WeaponID;
  54. GivePlayerWeapon( playerid, WeaponID, Ammo );
  55. }
  56. case 10, 11, 12, 13, 14, 15:
  57. {
  58. PlayerInfo[playerid][pGuns][ 10 ] = WeaponID;
  59. GivePlayerWeapon( playerid, WeaponID, Ammo );
  60. }
  61. case 44, 45, 46:
  62. {
  63. PlayerInfo[playerid][pGuns][ 11 ] = WeaponID;
  64. GivePlayerWeapon( playerid, WeaponID, Ammo );
  65. }
  66. }
  67. return 1;
  68.  
  69.  
  70. // Ammunition Checks
  71.     /*if(PlayerInfo[playerid][pGunAmmo][2] > 45)
  72.     {
  73.         SetPlayerAmmo(playerid, PlayerInfo[playerid][pGuns][2], 45);
  74.         PlayerInfo[playerid][pGunAmmo][2] = 45;
  75.     }
  76.     if(PlayerInfo[playerid][pGuns][3] == 25 && PlayerInfo[playerid][pGunAmmo][3] > 20)
  77.     {
  78.         SetPlayerAmmo(playerid, PlayerInfo[playerid][pGuns][3], 20);
  79.         PlayerInfo[playerid][pGunAmmo][3] = 20;
  80.     }
  81.     if(PlayerInfo[playerid][pGuns][3] == 26 && PlayerInfo[playerid][pGunAmmo][3] > 30)
  82.     {
  83.         SetPlayerAmmo(playerid, PlayerInfo[playerid][pGuns][3], 30);
  84.         PlayerInfo[playerid][pGunAmmo][3] = 30;
  85.     }
  86.     if(PlayerInfo[playerid][pGuns][3] == 27 && PlayerInfo[playerid][pGunAmmo][3] > 25)
  87.     {
  88.         SetPlayerAmmo(playerid, PlayerInfo[playerid][pGuns][3], 25);
  89.         PlayerInfo[playerid][pGunAmmo][3] = 25;
  90.     }
  91.     if(PlayerInfo[playerid][pGunAmmo][4] > 80)
  92.     {
  93.         SetPlayerAmmo(playerid, PlayerInfo[playerid][pGuns][4], 80);
  94.         PlayerInfo[playerid][pGunAmmo][4] = 80;
  95.     }
  96.     if(PlayerInfo[playerid][pGunAmmo][5] > 85)
  97.     {
  98.         SetPlayerAmmo(playerid, PlayerInfo[playerid][pGuns][5], 85);
  99.         PlayerInfo[playerid][pGunAmmo][5] = 85;
  100.     }
  101.     if(PlayerInfo[playerid][pGuns][6] == 33 && PlayerInfo[playerid][pGunAmmo][6] > 30)
  102.     {
  103.         SetPlayerAmmo(playerid, PlayerInfo[playerid][pGuns][6], 30);
  104.         PlayerInfo[playerid][pGunAmmo][6] = 30;
  105.     }
  106.     if(PlayerInfo[playerid][pGuns][6] == 34 && PlayerInfo[playerid][pGunAmmo][6] > 20)
  107.     {
  108.         SetPlayerAmmo(playerid, PlayerInfo[playerid][pGuns][6], 20);
  109.         PlayerInfo[playerid][pGunAmmo][6] = 20;
  110.     }*/
  111.  
  112.  /*new gun,tmp;
  113.         GetPlayerWeaponData(playerid,4,gun,tmp);
  114.         #pragma unused tmp
  115.         if(gun)SetPlayerArmedWeapon(playerid,gun);
  116.         else SetPlayerArmedWeapon(playerid,0);*/
  117.         //SetPlayerArmedWeapon(playerid,0);
Advertisement
Add Comment
Please, Sign In to add comment