Advertisement
Guest User

Soldier Equipements V2

a guest
May 21st, 2011
809
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.63 KB | None | 0 0
  1. //////////Includes
  2. #include <a_samp>
  3. #include <zcmd>
  4. /////////Defining
  5. new Float:ap;
  6. #define ARMOUR_INDEX 4
  7. #define COLOR_RED 0xFF0000AA
  8. #define LIGHTGREEN 0x00ff009e
  9.  
  10. /////////////////////////Loaded Script
  11. main()
  12. {
  13. print("\n----------------------------------");
  14. print("Soldier Equipement by Naruto_Emilio Loaded");
  15. print("----------------------------------\n");
  16. }
  17. /////////////////////When the filterscript is on exit mode
  18.  
  19. public OnFilterScriptExit()
  20. {
  21.  
  22. for(new i; i<MAX_PLAYERS; i++)
  23. {
  24. RemovePlayerAttachedObject(i,1);
  25. RemovePlayerAttachedObject(i,2);
  26. RemovePlayerAttachedObject(i,3);
  27. RemovePlayerAttachedObject(i,4);
  28. }
  29. ///////////////////////////////
  30.  
  31.  
  32. return 1;
  33. }
  34. //////////////if a player connects
  35. public OnPlayerConnect(playerid)
  36. {
  37. SendClientMessage(playerid,COLOR_RED,"**Soldier Equipement System By: Naruto_Emilio**");
  38. return 1;
  39.  
  40. }
  41. //////////////////////////ZCMD COMMAND//////////////77
  42. CMD:soldier(playerid, params[])
  43. {
  44. ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "{FFFFFF}Armour Store", "{FFFFFF}Full Armour Pack{6EF83C}(10.000$)\n{FFFFFF}Armour{6EF83C}(4000$)\n{FFFFFF}Armour2{6EF83C}(10.000$)\nWeapons\n{FFFFFF}Extra Items", "{6EF83C}Purchase", "{FF0000}Cancel");
  45.  
  46. return 1;
  47. }
  48. CMD:credits(playerid, params[])
  49. {
  50. SendClientMessage(playerid, COLOR_RED, "Armour System by Naruto_Emilio");
  51. SendClientMessage(playerid, COLOR_RED, "ZCMD Creator");
  52. SendClientMessage(playerid, COLOR_RED, "The dude that made the basic Tutorial");
  53. return 1;
  54. }
  55. CMD:whatsnew(playerid, params[])
  56. {
  57. SendClientMessage(playerid, LIGHTGREEN, "Version 1.5");
  58. SendClientMessage(playerid, COLOR_RED, "1-Money Bugs {FFFFFF}Fixed");
  59. SendClientMessage(playerid, COLOR_RED, "2-0.3c {FFFFFF}Colours");
  60. SendClientMessage(playerid, COLOR_RED, "3-New Armour Attached {FFFFFF}Object");
  61. SendClientMessage(playerid, COLOR_RED, "4-Weapons {FFFFFF}System");
  62. SendClientMessage(playerid, COLOR_RED, "More {FFFFFF}Updates {6EF83C}Soon");
  63. return 1;
  64. }
  65.  
  66.  
  67.  
  68. //////////////////////////////////////////////////////////////////////////////////////////////////////////////7
  69.  
  70. ///////////////PLAYER UPDATES/////////////////
  71. public OnPlayerUpdate(playerid)
  72. {
  73. GetPlayerArmour(playerid,ap);
  74. if(ap<1)
  75. {
  76. RemovePlayerAttachedObject(playerid,1);
  77. }
  78. ///////////////////////////////////////////////
  79.  
  80. //////////////////////////////NEW ARMOUR
  81.  
  82. return 1;
  83. }
  84. /////////////////////////////////dialog Reponse////////////////////////
  85. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  86. {
  87. if(response)
  88. {
  89. switch(dialogid)
  90. {
  91. case 1:
  92. {
  93. switch(listitem)
  94. {
  95. case 0:
  96. {
  97. if(GetPlayerMoney(playerid) < 10000) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
  98. GivePlayerMoney(playerid, -10000);
  99. SetPlayerAttachedObject(playerid,1,19142,1,0.1,0.05,0.0,0.0,0.0,0.0);//Armour
  100. SetPlayerAttachedObject(playerid,2,19141,2,0.11,0.0,0.0,0.0,0.0,0.0);//Cask
  101. SetPlayerAttachedObject(playerid,3,18637,13,0.35,0.0,0.0,0.0,0.0,180.0);//Shield
  102. SetPlayerAttachedObject(playerid,4,18642,7,0.1,0.0,-0.11,0.0,-90.0,90.0);//tazer
  103. SetPlayerArmour(playerid,100.0);
  104. }
  105. case 1:
  106. {
  107. if(GetPlayerMoney(playerid) < 4000) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
  108. GivePlayerMoney(playerid, -4000);
  109. SetPlayerArmour(playerid,50.0);
  110. SetPlayerAttachedObject(playerid,2,19141,2,0.11,0.0,0.0,0.0,0.0,0.0);//Cask
  111. }
  112. case 2:
  113. {
  114. if(GetPlayerMoney(playerid)< 10000) return SendClientMessage(playerid, 0xFFFFFF, "You don't Have Enough Money");
  115. GivePlayerMoney(playerid, -10000);
  116. SetPlayerArmour(playerid, 100.0);
  117. SetPlayerAttachedObject( playerid, ARMOUR_INDEX, 1242, 1, 0.019999, 0.039999, 0.000000, 2.459999, 89.699989, -3.100000, 1.710000, 2.119999, 1.719999);
  118.  
  119.  
  120. }
  121. case 3:
  122. {
  123. ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Choose Your Weapon", "{FF0000}Colt.45{6EF83C}($1000)\n{FF0000}Colt.45 Silenced{6EF83C}($1000)\n{FF0000}Desert Eagle{6EF83C}($1000)\n{FF0000}Mac 10{6EF83C}($2500)\n{FF0000}Tech 9{6EF83C}($2500)\n{FF0000}MP5{6EF83C}($5000)\n{FF0000}Sawn Off's{6EF83C}($5000)\n{FF0000}Combat Shotgun {6EF83C}($5000)\n{FF0000}AK-47 {6EF83C}($7500)\n{FF0000}M4 {6EF83C}($10000)\n{FF0000}Rifle {6EF83C}($7500)\n{FF0000}Sniper{6EF83C}($10000)", "Purchase", "Cancel");
  124. }
  125. case 4:
  126. {
  127. ShowPlayerDialog(playerid, 3, DIALOG_STYLE_LIST, "Choose Your Item", "{FF0000}Refill Health{6EF83C}($1000)", "Purchase", "Cancel");
  128. }
  129. }
  130. }
  131. }
  132. }
  133.  
  134. if(dialogid == 2 && response)
  135. {
  136. switch(listitem)
  137. {
  138. case 0://colt.45f
  139. {
  140. if(GetPlayerMoney(playerid) >=1000)//change price here...
  141. {
  142. GivePlayerMoney(playerid, -1000);//and here
  143. GivePlayerWeapon(playerid,22,500);
  144. SetPlayerChatBubble(playerid, "This player has bought items", COLOR_RED, 100.0, 1000000);
  145.  
  146. SendClientMessage(playerid,LIGHTGREEN,"You've Bought This Item");
  147. }
  148. else
  149. {
  150. SendClientMessage(playerid,LIGHTGREEN,"You don't Have Enough Money");
  151. }
  152. }
  153. case 1://colt.45 silenced
  154. {
  155. if(GetPlayerMoney(playerid) >=1000)//change price here...
  156. {
  157. GivePlayerMoney(playerid, -1000);//and here
  158. GivePlayerWeapon(playerid,23,500);
  159. SetPlayerChatBubble(playerid, "This player has bought items", COLOR_RED, 100.0, 1000000);
  160. SendClientMessage(playerid,LIGHTGREEN,"You've Bought This Item");
  161. }
  162. else
  163. {
  164. SendClientMessage(playerid,LIGHTGREEN,"You don't Have Enough Money");
  165. }
  166. }
  167. case 2://desert eagle
  168. {
  169. if(GetPlayerMoney(playerid) >=1000)//change price here...
  170. {
  171. GivePlayerMoney(playerid, -1000);//and here
  172. GivePlayerWeapon(playerid,24,500);
  173. SetPlayerChatBubble(playerid, "This player has bought items", COLOR_RED, 100.0, 1000000);
  174. SendClientMessage(playerid,LIGHTGREEN,"You've Bought This Item");
  175. }
  176. else
  177. {
  178. SendClientMessage(playerid,LIGHTGREEN,"You don't Have Enough Money");
  179. }
  180. }
  181. case 3://mac 10
  182. {
  183. if(GetPlayerMoney(playerid) >=2500)//change price here...
  184. {
  185. GivePlayerMoney(playerid, -2500);//and here
  186. GivePlayerWeapon(playerid,28,500);
  187. SetPlayerChatBubble(playerid, "This player has bought items", COLOR_RED, 100.0, 1000000);
  188. SendClientMessage(playerid,LIGHTGREEN,"You've Bought This Item");
  189. }
  190. else
  191. {
  192. SendClientMessage(playerid,LIGHTGREEN,"You don't Have Enough Money");
  193. }
  194. }
  195. case 4://tech 9
  196. {
  197. if(GetPlayerMoney(playerid) >=2500)// i think you get the picture of how to change the prices now xD have fun :D.
  198. {
  199. GivePlayerMoney(playerid, -2500);
  200. GivePlayerWeapon(playerid,32,500);
  201. SetPlayerChatBubble(playerid, "This player has bought items", COLOR_RED, 100.0, 1000000);
  202. SendClientMessage(playerid,LIGHTGREEN,"You've Bought This Item");
  203. }
  204. else
  205. {
  206. SendClientMessage(playerid,LIGHTGREEN,"You don't Have Enough Money");
  207. }
  208. }
  209. case 5://mp5
  210. {
  211. if(GetPlayerMoney(playerid) >=5000)
  212. {
  213. GivePlayerMoney(playerid, -5000);
  214. GivePlayerWeapon(playerid,29,500);
  215. SetPlayerChatBubble(playerid, "This player has bought items", COLOR_RED, 100.0, 1000000);
  216. SendClientMessage(playerid,LIGHTGREEN,"You've Bought This Item");
  217. }
  218. else
  219. {
  220. SendClientMessage(playerid,LIGHTGREEN,"You don't Have Enough Money");
  221. }
  222. }
  223. case 6://sawnoffs
  224. {
  225. if(GetPlayerMoney(playerid) >=5000)
  226. {
  227. GivePlayerMoney(playerid, -5000);
  228. GivePlayerWeapon(playerid,26,500);
  229. SetPlayerChatBubble(playerid, "This player has bought items", COLOR_RED, 100.0, 1000000);
  230. SendClientMessage(playerid,LIGHTGREEN,"You've Bought This Item");
  231. }
  232. else
  233. {
  234. SendClientMessage(playerid,LIGHTGREEN,"You don't Have Enough Money");
  235. }
  236. }
  237. case 7://combat shotgun
  238. {
  239. if(GetPlayerMoney(playerid) >=5000)
  240. {
  241. GivePlayerMoney(playerid, -5000);
  242. GivePlayerWeapon(playerid,27,500);
  243. SetPlayerChatBubble(playerid, "This player has bought items", COLOR_RED, 100.0, 1000000);
  244. SendClientMessage(playerid,LIGHTGREEN,"You've Bought This Item");
  245. }
  246. else
  247. {
  248. SendClientMessage(playerid,LIGHTGREEN,"You don't Have Enough Money");
  249. }
  250. }
  251. case 8://AK-47
  252. {
  253. if(GetPlayerMoney(playerid) >=7500)
  254. {
  255. GivePlayerMoney(playerid, -7500);
  256. GivePlayerWeapon(playerid,30,500);
  257. SetPlayerChatBubble(playerid, "This player has bought items", COLOR_RED, 100.0, 1000000);
  258. SendClientMessage(playerid,LIGHTGREEN,"You've Bought This Item");
  259. }
  260. else
  261. {
  262. SendClientMessage(playerid,LIGHTGREEN,"You don't have Enought Money");
  263. }
  264. }
  265. case 9://m4
  266. {
  267. if(GetPlayerMoney(playerid) >=10000)
  268. {
  269. GivePlayerMoney(playerid, -10000);
  270. GivePlayerWeapon(playerid,31,500);
  271. SetPlayerChatBubble(playerid, "This player has bought items", COLOR_RED, 100.0, 1000000);
  272. SendClientMessage(playerid,LIGHTGREEN,"You've Bought This Item");
  273. }
  274. else
  275. {
  276. SendClientMessage(playerid,LIGHTGREEN,"You don't Have Enough Money");
  277. }
  278. }
  279. case 10://rifle
  280. {
  281. if(GetPlayerMoney(playerid) >=75000)
  282. {
  283. GivePlayerMoney(playerid, -75000);
  284. GivePlayerWeapon(playerid,33,500);
  285. SetPlayerChatBubble(playerid, "This player has bought items", COLOR_RED, 100.0, 1000000);
  286. SendClientMessage(playerid,LIGHTGREEN,"You've Bought This Item");
  287. }
  288. else
  289. {
  290. SendClientMessage(playerid,LIGHTGREEN,"You don't Have Enough Money");
  291. }
  292. }
  293. case 11://sniper
  294. {
  295. if(GetPlayerMoney(playerid) >=10000)
  296. {
  297. GivePlayerMoney(playerid, -10000);
  298. GivePlayerWeapon(playerid,34,500);
  299. SetPlayerChatBubble(playerid, "This player has bought items", COLOR_RED, 100.0, 1000000);
  300. SendClientMessage(playerid,LIGHTGREEN,"You don't Have Enough Money Sniper");
  301. }
  302. else
  303. {
  304. SendClientMessage(playerid,LIGHTGREEN,"You don't Have Enough Money");
  305. }
  306. }
  307. }
  308. }
  309. if(dialogid == 4 && response)
  310. {
  311. switch(listitem)
  312. {
  313. case 0://health
  314. {
  315. if(GetPlayerMoney(playerid) >=1500)
  316. {
  317. GivePlayerMoney(playerid,-1500);
  318. SetPlayerHealth(playerid,100.0);
  319. SetPlayerChatBubble(playerid, "This player has bought items", COLOR_RED, 100.0, 1000000);
  320. SendClientMessage(playerid,LIGHTGREEN,"You've Bought This Item!");
  321. }
  322. else
  323. {
  324. SendClientMessage(playerid,LIGHTGREEN,"You Don't Have Enough Money To Buy This");
  325. }
  326. }
  327. }
  328. }
  329. return 1;
  330. } ////////////////////////////////////////////////////////
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement