Advertisement
Guest User

Untitled

a guest
Aug 20th, 2019
557
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.54 KB | None | 0 0
  1. /*
  2. *
  3. * Drop FilterScript for SA-MP
  4. * Creator: 002
  5. * Date:20.08.2019
  6. *
  7. *
  8. */
  9.  
  10. //--//
  11. #include <a_samp>
  12. #include <streamer>
  13. //--//
  14.  
  15. enum DropI {
  16. ID,
  17. Oruzije,
  18. Ammo
  19. }
  20.  
  21. new DropInfo[MAX_PICKUPS][DropI];
  22. //>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>//
  23. public OnFilterScriptInit()
  24. {
  25. ReloadPickups();
  26. print("DROP >> Drop system uspesno ucitan!");
  27. return(true);
  28. }
  29. //>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>//
  30. public OnFilterScriptExit()
  31. {
  32. ReloadPickups();
  33. BrisiPikapove();
  34. return(true);
  35. }
  36. //>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>//
  37. public OnPlayerDeath(playerid)
  38. {
  39. Dropgun(playerid);
  40. return(true);
  41. }
  42. //>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>//
  43. public OnPlayerPickUpDynamicPickup(playerid, pickupid) {
  44. new string[117];
  45. new hladokrvooruzije[32];
  46. for(new i = 0; i < MAX_PICKUPS; i++) {
  47. if(pickupid == DropInfo[i][ID] && DropInfo[i][ID] != -1)
  48. {
  49. DestroyDynamicPickup(DropInfo[i][ID]);
  50. GivePlayerWeapon(playerid, DropInfo[i][Oruzije], DropInfo[i][Ammo]);
  51. GetWeaponName(DropInfo[i][Oruzije], hladokrvooruzije, sizeof(hladokrvooruzije));
  52. format(string, sizeof(string), "{6E0A35}DROP >>{FFFFFF} Pokupio si {6E0A35}%s{FFFFFF} ( {6E0A35}%d{FFFFFF} ammo ).", hladokrvooruzije, DropInfo[i][Ammo]);
  53. SendClientMessage(playerid, -1, string);
  54. DropInfo[i][Oruzije] = 0;
  55. DropInfo[i][ID] = -1;
  56. PlayerPlaySound(playerid, 1150, 0.0, 0.0, 10.0);
  57. }
  58. }
  59. return 1;
  60. }
  61. //>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>//
  62. Dropgun(playerid)
  63. {
  64. new Float: Pos[3],
  65. gunid,
  66. ammo,
  67. id;
  68. GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  69.  
  70. for(new i = 0; i < 12; i++) {
  71. GetPlayerWeaponData(playerid, i, gunid, ammo);
  72. if(gunid != 0) {
  73. id = IDCheck();
  74. DropInfo[id][ID] = CreateDynamicPickup(IDPickupa(gunid), 23, Pos[0], Pos[1]+2, Pos[2], -1);
  75. DropInfo[id][Oruzije] = gunid;
  76. DropInfo[id][Ammo] = ammo;
  77. }
  78. }
  79. ResetPlayerWeapons(playerid);
  80. //--//
  81. return(true);
  82. }
  83. //>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>//
  84. IDCheck() {
  85. for(new i = 0; i < MAX_PICKUPS; i++) {
  86. if(DropInfo[i][ID] == -1) return i;
  87. }
  88. return(true);
  89. }
  90. //>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>//
  91. IDPickupa(id)
  92. {
  93. switch(id)
  94. {
  95. case 1: return 331;
  96. case 2: return 332;
  97. case 3: return 333;
  98. case 4: return 335;
  99. case 5: return 334;
  100. case 6: return 335;
  101. case 7: return 336;
  102. case 10: return 321;
  103. case 11: return 322;
  104. case 12: return 323;
  105. case 13: return 324;
  106. case 14: return 325;
  107. case 15: return 326;
  108. case 23: return 347;
  109. case 24: return 348;
  110. case 25: return 349;
  111. case 26: return 350;
  112. case 27: return 351;
  113. case 28: return 352;
  114. case 29: return 353;
  115. case 30: return 355;
  116. case 31: return 356;
  117. case 32: return 372;
  118. case 33: return 357;
  119. case 34: return 358;
  120. case 41: return 365;
  121. case 42: return 366;
  122. case 43: return 367;
  123. }
  124. return(true);
  125. }
  126.  
  127. //>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>//
  128. BrisiPikapove() {
  129. for(new i = 0; i < MAX_PICKUPS; i++)
  130. {
  131. if(DropInfo[i][ID] != -1)
  132. {
  133. DestroyDynamicPickup(DropInfo[i][ID]);
  134. DropInfo[i][ID] = -1;
  135. }
  136. }
  137. return(true);
  138. }
  139. //>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>//
  140. ReloadPickups() {
  141. for(new i = 0; i < MAX_PICKUPS; i++) {
  142. if(DropInfo[i][ID] != -1) DropInfo[i][ID] = -1;
  143. }
  144. return(true);
  145. }
  146.  
  147. /*
  148. *
  149. *
  150. *
  151. * End of filterscript
  152. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement