Advertisement
Guest User

Hangon! By [XgT]

a guest
Jun 28th, 2012
389
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.06 KB | None | 0 0
  1. //|Hello! Thank you for downloading!
  2. //|This is my 2nd FS hope you like it!
  3. //|Please dont remove credits! Or will result bad!
  4. //|About this FS : This is a FS Which will allow your all handweapons hanging on your back like In real army.
  5. //******************************By [XgT]******************************
  6. //[X] Generation [T] The world of DeViLz
  7. //We need admin's If you are able to take pledge to be an good admin contact me! NOW
  8. //IP:PORT is on my Samp forum (SIGNATURE)
  9. //******************************[XgT] Stands for [X] Generation [T]******************************
  10.  
  11.  
  12. #include <a_samp>
  13.  
  14. #define ARMEDBODY_USE_HEAVY_WEAPON (false)
  15.  
  16. static
  17. armedbody_pTick[MAX_PLAYERS];
  18. public OnFilterScriptInit(){
  19. printf("=====================================================================");
  20. printf("This is a best FS for Roleplay's, Deathmatch etc... Will suit on all GM.");
  21. printf("FilterScript Name: Hangon!");
  22. printf("Description:Will hang all weapons on your back!");
  23. printf("Author:[xT]Emaratii");
  24. printf("Special thanks:[XgT] Team");
  25. printf("Contact author: emaratiiboii@hotmail.com");
  26. printf("=====================================================================");
  27. return true;
  28. }
  29. public OnFilterScriptExit(){
  30. return true;
  31. }
  32. public OnPlayerUpdate(playerid){
  33. if(GetTickCount() - armedbody_pTick[playerid] > 113){ //prefix check itter
  34. new
  35. weaponid[13],weaponammo[13],pArmedWeapon;
  36. pArmedWeapon = GetPlayerWeapon(playerid);
  37. GetPlayerWeaponData(playerid,1,weaponid[1],weaponammo[1]);
  38. GetPlayerWeaponData(playerid,2,weaponid[2],weaponammo[2]);
  39. GetPlayerWeaponData(playerid,4,weaponid[4],weaponammo[4]);
  40. GetPlayerWeaponData(playerid,5,weaponid[5],weaponammo[5]);
  41. #if ARMEDBODY_USE_HEAVY_WEAPON
  42. GetPlayerWeaponData(playerid,7,weaponid[7],weaponammo[7]);
  43. #endif
  44. if(weaponid[1] && weaponammo[1] > 0){
  45. if(pArmedWeapon != weaponid[1]){
  46. if(!IsPlayerAttachedObjectSlotUsed(playerid,0)){
  47. SetPlayerAttachedObject(playerid,0,GetWeaponModel(weaponid[1]),1, 0.199999, -0.139999, 0.030000, 0.500007, -115.000000, 0.000000, 1.000000, 1.000000, 1.000000);
  48. }
  49. }
  50. else {
  51. if(IsPlayerAttachedObjectSlotUsed(playerid,0)){
  52. RemovePlayerAttachedObject(playerid,0);
  53. }
  54. }
  55. }
  56. else if(IsPlayerAttachedObjectSlotUsed(playerid,0)){
  57. RemovePlayerAttachedObject(playerid,0);
  58. }
  59. if(weaponid[2] && weaponammo[2] > 0){
  60. if(pArmedWeapon != weaponid[2]){
  61. if(!IsPlayerAttachedObjectSlotUsed(playerid,1)){
  62. SetPlayerAttachedObject(playerid,1,GetWeaponModel(weaponid[2]),8, -0.079999, -0.039999, 0.109999, -90.100006, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000);
  63. }
  64. }
  65. else {
  66. if(IsPlayerAttachedObjectSlotUsed(playerid,1)){
  67. RemovePlayerAttachedObject(playerid,1);
  68. }
  69. }
  70. }
  71. else if(IsPlayerAttachedObjectSlotUsed(playerid,1)){
  72. RemovePlayerAttachedObject(playerid,1);
  73. }
  74. if(weaponid[4] && weaponammo[4] > 0){
  75. if(pArmedWeapon != weaponid[4]){
  76. if(!IsPlayerAttachedObjectSlotUsed(playerid,2)){
  77. SetPlayerAttachedObject(playerid,2,GetWeaponModel(weaponid[4]),7, 0.000000, -0.100000, -0.080000, -95.000000, -10.000000, 0.000000, 1.000000, 1.000000, 1.000000);
  78. }
  79. }
  80. else {
  81. if(IsPlayerAttachedObjectSlotUsed(playerid,2)){
  82. RemovePlayerAttachedObject(playerid,2);
  83. }
  84. }
  85. }
  86. else if(IsPlayerAttachedObjectSlotUsed(playerid,2)){
  87. RemovePlayerAttachedObject(playerid,2);
  88. }
  89. if(weaponid[5] && weaponammo[5] > 0){
  90. if(pArmedWeapon != weaponid[5]){
  91. if(!IsPlayerAttachedObjectSlotUsed(playerid,3)){
  92. SetPlayerAttachedObject(playerid,3,GetWeaponModel(weaponid[5]),1, 0.200000, -0.119999, -0.059999, 0.000000, 206.000000, 0.000000, 1.000000, 1.000000, 1.000000);
  93. }
  94. }
  95. else {
  96. if(IsPlayerAttachedObjectSlotUsed(playerid,3)){
  97. RemovePlayerAttachedObject(playerid,3);
  98. }
  99. }
  100. }
  101. else if(IsPlayerAttachedObjectSlotUsed(playerid,3)){
  102. RemovePlayerAttachedObject(playerid,3);
  103. }
  104. #if ARMEDBODY_USE_HEAVY_WEAPON
  105. if(weaponid[7] && weaponammo[7] > 0){
  106. if(pArmedWeapon != weaponid[7]){
  107. if(!IsPlayerAttachedObjectSlotUsed(playerid,4)){
  108. SetPlayerAttachedObject(playerid,4,GetWeaponModel(weaponid[7]),1,-0.100000, 0.000000, -0.100000, 84.399932, 112.000000, 10.000000, 1.099999, 1.000000, 1.000000);
  109. }
  110. }
  111. else {
  112. if(IsPlayerAttachedObjectSlotUsed(playerid,4)){
  113. RemovePlayerAttachedObject(playerid,4);
  114. }
  115. }
  116. }
  117. else if(IsPlayerAttachedObjectSlotUsed(playerid,4)){
  118. RemovePlayerAttachedObject(playerid,4);
  119. }
  120. #endif
  121. armedbody_pTick[playerid] = GetTickCount();
  122. }
  123. return true;
  124. }
  125.  
  126.  
  127.  
  128. //by [XgT]
  129. stock GetWeaponModel(weaponid)
  130. {
  131. switch(weaponid)
  132. {
  133. case 1:
  134. return 331;
  135.  
  136. case 2..8:
  137. return weaponid+331;
  138.  
  139. case 9:
  140. return 341;
  141.  
  142. case 10..15:
  143. return weaponid+311;
  144.  
  145. case 16..18:
  146. return weaponid+326;
  147.  
  148. case 22..29:
  149. return weaponid+324;
  150.  
  151. case 30,31:
  152. return weaponid+325;
  153.  
  154. case 32:
  155. return 372;
  156.  
  157. case 33..45:
  158. return weaponid+324;
  159.  
  160. case 46:
  161. return 371;
  162. }
  163. return 0;
  164. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement