Advertisement
Guest User

Untitled

a guest
Jul 26th, 2015
522
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.37 KB | None | 0 0
  1. #include <a_samp>
  2. #include <zcmd>
  3.  
  4.  
  5. #define COLOR_RED 0xAA3333AA
  6. #define COLOR_GREEN 0x33AA33AA
  7.  
  8. #define SCOPE_PRICE 1000
  9. #define SILENCER_PRICE 1000
  10.  
  11.  
  12. new
  13. p_Silencer[MAX_PLAYERS],
  14. p_Scope[MAX_PLAYERS],
  15. p_ScopeAttached[MAX_PLAYERS],
  16. p_SilencerAttached[MAX_PLAYERS];
  17.  
  18.  
  19. #define FILTERSCRIPT
  20.  
  21. #if defined FILTERSCRIPT
  22.  
  23. public OnFilterScriptInit()
  24. {
  25. print("\n--------------------------------------");
  26. print(" Blank Filterscript by your name here");
  27. print("--------------------------------------\n");
  28. return 1;
  29. }
  30.  
  31. public OnFilterScriptExit()
  32. {
  33. return 1;
  34. }
  35.  
  36. #else
  37.  
  38. main()
  39. {
  40. print("\n----------------------------------");
  41. print(" Blank Gamemode by your name here");
  42. print("----------------------------------\n");
  43. }
  44.  
  45. #endif
  46.  
  47. public OnPlayerSpawn(playerid)
  48. {
  49. PreloadAnimLib(playerid,"BUDDY" );
  50. ApplyAnimation(playerid,"BUDDY","buddy_reload",4.1,1,1,1,1,1000,1);
  51. return true;
  52. }
  53.  
  54. PreloadAnimLib(playerid, animlib[])
  55. {
  56. ApplyAnimation(playerid,animlib,"null",0.0,0,0,0,0,0);
  57. }
  58.  
  59. CMD:buyscope(playerid,params[])
  60. {
  61. #pragma unused params
  62. new string[64];
  63.  
  64. if(GetPlayerMoney(playerid) < SCOPE_PRICE)
  65. return SendClientMessage(playerid,COLOR_RED,"You dont have enough money");
  66.  
  67. if(p_Scope[playerid] >= 1)
  68. return SendClientMessage(playerid,COLOR_RED,"You already have this upgrade!");
  69.  
  70. p_Scope[playerid] = 1;
  71. GivePlayerMoney(playerid,-SCOPE_PRICE);
  72. format(string,sizeof(string),"Notification: Scope purchased for %i$",SCOPE_PRICE);
  73. SendClientMessage(playerid,COLOR_GREEN,string);
  74. return true;
  75. }
  76.  
  77.  
  78.  
  79.  
  80.  
  81. CMD:attachscope(playerid,params[])
  82. {
  83. #pragma unused params
  84. new ammo;
  85. if(p_Scope[playerid] == 0)
  86. return SendClientMessage(playerid,COLOR_RED,"You dont own a scope!");
  87.  
  88. if(GetPlayerWeapon(playerid) != 33)
  89. return SendClientMessage(playerid,COLOR_RED,"You need to hold a rifle in order to do this!");
  90.  
  91. ammo = GetPlayerAmmo(playerid);
  92. GivePlayerWeapon(playerid,34,1);
  93. SetPlayerAmmo(playerid,WEAPON_SNIPER,ammo);
  94. ApplyAnimation(playerid,"BUDDY","buddy_reload",4.1,0,1,1,1,1000,0);
  95. p_ScopeAttached[playerid] = 1;
  96. return true;
  97. }
  98.  
  99. CMD:detachscope(playerid,params[])
  100. {
  101. #pragma unused params
  102. new ammo;
  103. if(p_ScopeAttached[playerid] == 0)
  104. return SendClientMessage(playerid,COLOR_RED,"You dont have a scope attached!");
  105.  
  106. if(GetPlayerWeapon(playerid) != 34)
  107. return SendClientMessage(playerid,COLOR_RED,"You are not holding a sniper rifle!");
  108.  
  109. ammo = GetPlayerAmmo(playerid);
  110. GivePlayerWeapon(playerid,33,1);
  111. SetPlayerAmmo(playerid,WEAPON_RIFLE,ammo);
  112. ApplyAnimation(playerid,"BUDDY","buddy_reload",4.1,0,1,1,1,1000,1);
  113. p_ScopeAttached[playerid] = 0;
  114. return true;
  115. }
  116.  
  117. CMD:detachsilencer(playerid,params[])
  118. {
  119. #pragma unused params
  120. new ammo;
  121. if(p_SilencerAttached[playerid] == 0)
  122. return SendClientMessage(playerid,COLOR_RED,"You dont have a Silencer attached!");
  123.  
  124. if(GetPlayerWeapon(playerid) != 23)
  125. return SendClientMessage(playerid,COLOR_RED,"You are not holding a SD Pistol!");
  126.  
  127. ammo = GetPlayerAmmo(playerid);
  128. GivePlayerWeapon(playerid,22,1);
  129. SetPlayerAmmo(playerid,WEAPON_COLT45,ammo);
  130. ApplyAnimation(playerid,"BUDDY","buddy_reload",4.1,0,1,1,1,1000,1);
  131. p_SilencerAttached[playerid] = 0;
  132. return true;
  133. }
  134.  
  135.  
  136.  
  137. CMD:attachsilencer(playerid,params[])
  138. {
  139. #pragma unused params
  140. new ammo;
  141. if(p_Silencer[playerid] == 0)
  142. return SendClientMessage(playerid,COLOR_RED,"You dont own a silencer!");
  143.  
  144. if(GetPlayerWeapon(playerid) != 22)
  145. return SendClientMessage(playerid,COLOR_RED,"You need to hold a 9MM in order to do this!");
  146.  
  147. ammo = GetPlayerAmmo(playerid);
  148. GivePlayerWeapon(playerid,23,1);
  149. SetPlayerAmmo(playerid,WEAPON_SILENCED,ammo);
  150. ApplyAnimation(playerid,"BUDDY","buddy_reload",4.1,0,1,1,1,1000,0);
  151. p_SilencerAttached[playerid] = 1;
  152. return true;
  153. }
  154.  
  155.  
  156. CMD:buysilencer(playerid,params[])
  157. {
  158. #pragma unused params
  159. new string[64];
  160. if(GetPlayerMoney(playerid) < SILENCER_PRICE)
  161. return SendClientMessage(playerid,COLOR_RED,"You dont have enough money");
  162.  
  163. if(p_Silencer[playerid] >= 1)
  164. return SendClientMessage(playerid,COLOR_RED,"You already have this upgrade!");
  165.  
  166. p_Silencer[playerid] = 1;
  167. GivePlayerMoney(playerid, -SILENCER_PRICE);
  168. format(string,sizeof(string),"Notification: Silencer purchased for %i$",SILENCER_PRICE);
  169. SendClientMessage(playerid,COLOR_GREEN,string);
  170. return true;
  171. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement