Guest User

Advanced Weapon System

a guest
Jan 5th, 2013
506
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.63 KB | None | 0 0
  1. /*
  2. |~) _ \ /
  3. |~\(_) \/\/
  4. /\ _| _ _ _ _ _|
  5. /~~\(_|\/(_|| |(_(/_(_|
  6.  
  7. \ / _ _ _ _ _
  8. \/\/ (/_(_||_)(_)| |
  9. |
  10. (~ __|_ _ _ _
  11. _)\/_\ | (/_| | |
  12. /
  13. v 1.0
  14. ================================================================================
  15. Include's
  16. ==============================================================================*/
  17. #include <a_samp>
  18. #include <zcmd>
  19. //==============================================================================
  20. // Dialog Zone
  21. //==============================================================================
  22. #define ammo 14204
  23. //==============================================================================
  24. // Culori
  25. //==============================================================================
  26. #define W "{FFFFFF}"
  27. #define R "{FF0000}"
  28. #define O "{FF8000}"
  29. //==============================================================================
  30. // Prescurtari functii
  31. //==============================================================================
  32. #define SCM SendClientMessage
  33. #define SCMToAll SendClientMessageToAll
  34. #define GMT GameTextForPlayer
  35.  
  36.  
  37. public OnFilterScriptInit()
  38. {
  39. print("\n======================================");
  40. print(" RoW Advanced Weapon System Loaded");
  41. print("======================================\n");
  42. return 1;
  43. }
  44.  
  45. public OnFilterScriptExit()
  46. {
  47. print("\n======================================");
  48. print(" RoW Advanced Weapon System UnLoaded");
  49. print("======================================\n");
  50. return 1;
  51. }
  52.  
  53. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  54. {
  55. switch(dialogid)
  56. {
  57. case ammo:
  58. {
  59. if(response)
  60. {
  61. switch(listitem)
  62. {
  63. case 0:{ShowPlayerDialog(playerid,ammo+1,DIALOG_STYLE_INPUT,""O"D"W"eagle",""O"Scrie "W"cate gloante vrei e "R"5$/glont!\n","Ok","Back");}
  64. case 1:{ShowPlayerDialog(playerid,ammo+2,DIALOG_STYLE_INPUT,""O"M"W"4",""O"Scrie "W"cate gloante vrei e "R"15$/glont!\n","Ok","Back");}
  65. case 2:{ShowPlayerDialog(playerid,ammo+3,DIALOG_STYLE_INPUT,""O"A"W"k47",""O"Scrie "W"cate gloante vrei e "R"14$/glont!\n","Ok","Back");}
  66. case 3:{ShowPlayerDialog(playerid,ammo+4,DIALOG_STYLE_INPUT,""O"M"W"P5",""O"Scrie "W"cate gloante vrei e "R"11$/glont!\n","Ok","Back");}
  67. case 4:{ShowPlayerDialog(playerid,ammo+5,DIALOG_STYLE_INPUT,""O"S"W"niper",""O"Scrie "W"cate gloante vrei e "R"20$/glont!\n","Ok","Back");}
  68. case 5:{ShowPlayerDialog(playerid,ammo+6,DIALOG_STYLE_INPUT,""O"S"W"hotGun",""O"Scrie "W"cate gloante vrei e "R"13$/glont!\n","Ok","Back");}
  69. case 6:{ShowPlayerDialog(playerid,ammo+7,DIALOG_STYLE_INPUT,""O"S"W"awnoff ShotGun",""O"Scrie "W"cate gloante vrei e "R"18$/glont!\n","Ok","Back");}
  70. case 7:{ShowPlayerDialog(playerid,ammo+8,DIALOG_STYLE_INPUT,""O"T"W"ec-9",""O"Scrie "W"cate gloante vrei e "R"3$/glont!\n","Ok","Back");}
  71. }
  72. }
  73. }
  74. case ammo + 1:
  75. {
  76. if(!response)
  77. return ShowPlayerDialog(playerid,ammo,DIALOG_STYLE_LIST,"Wdialog",Weapon(),"Ok","Cancel");
  78. if(response)
  79. {
  80. new str[128];
  81. if(GetPlayerMoney(playerid) < strval(inputtext)* 5)
  82. return SendClientMessage(playerid,-1,"Nu ai atatia bani");
  83. if(strval(inputtext) < 10)
  84. return SCM(playerid,-1,"Nu poti cumpara mai putin de 10 gloante!!");
  85. GivePlayerWeapon(playerid,24,strval(inputtext));
  86. GivePlayerMoney(playerid,-strval(inputtext)* 5);
  87. format(str,128,""R"** "O"%s "W"a cumparat un Deagle cu "R"%d "W"gloante "R"**",GetName(playerid),strval(inputtext));
  88. SCMToAll(-1,str);
  89. }
  90. }
  91. case ammo + 2:
  92. {
  93. if(!response)
  94. return ShowPlayerDialog(playerid,ammo,DIALOG_STYLE_LIST,"Wdialog",Weapon(),"Ok","Cancel");
  95. if(response)
  96. {
  97. new str[128];
  98. if(GetPlayerMoney(playerid) < strval(inputtext)* 15)
  99. return SendClientMessage(playerid,-1,""R"Nu ai atatia bani");
  100. if(strval(inputtext) < 10)
  101. return SCM(playerid,-1,""R"Nu poti cumpara mai putin de "O"10 "R"gloante!!");
  102. GivePlayerWeapon(playerid,31,strval(inputtext));
  103. GivePlayerMoney(playerid,-strval(inputtext)* 15);
  104. format(str,128,""R"** "O"%s "W"a cumparat un M4 cu "R"%d "W"gloante "R"**",GetName(playerid),strval(inputtext));
  105. SCMToAll(-1,str);
  106. }
  107. }
  108. case ammo + 3:
  109. {
  110. if(!response)
  111. return ShowPlayerDialog(playerid,ammo,DIALOG_STYLE_LIST,"Wdialog",Weapon(),"Ok","Cancel");
  112. if(response)
  113. {
  114. new str[128];
  115. if(GetPlayerMoney(playerid) < strval(inputtext)* 14)
  116. return SendClientMessage(playerid,-1,""R"Nu ai atatia bani");
  117. if(strval(inputtext) < 10)
  118. return SCM(playerid,-1,""R"Nu poti cumpara mai putin de "O"10 "R"gloante!!");
  119. GivePlayerWeapon(playerid,30,strval(inputtext));
  120. GivePlayerMoney(playerid,-strval(inputtext)* 14);
  121. format(str,128,""R"** "O"%s "W"a cumparat un Ak47 cu "R"%d "W"gloante "R"**",GetName(playerid),strval(inputtext));
  122. SCMToAll(-1,str);
  123.  
  124. }
  125. }
  126. case ammo + 4:
  127. {
  128. if(!response)
  129. return ShowPlayerDialog(playerid,ammo,DIALOG_STYLE_LIST,"Wdialog",Weapon(),"Ok","Cancel");
  130. if(response)
  131. {
  132. new str[128];
  133. if(GetPlayerMoney(playerid) < strval(inputtext)* 11)
  134. return SendClientMessage(playerid,-1,""R"Nu ai atatia bani");
  135. if(strval(inputtext) < 10)
  136. return SCM(playerid,-1,""R"Nu poti cumpara mai putin de "O"10 "R"gloante!!");
  137. GivePlayerWeapon(playerid,29,strval(inputtext));
  138. GivePlayerMoney(playerid,-strval(inputtext)* 11);
  139. format(str,128,""R"** "O"%s "W"a cumparat un MP5 cu "R"%d "W"gloante "R"**",GetName(playerid),strval(inputtext));
  140. SCMToAll(-1,str);
  141.  
  142. }
  143. }
  144. case ammo + 5:
  145. {
  146. if(!response)
  147. return ShowPlayerDialog(playerid,ammo,DIALOG_STYLE_LIST,"Wdialog",Weapon(),"Ok","Cancel");
  148. if(response)
  149. {
  150. new str[128];
  151. if(GetPlayerMoney(playerid) < strval(inputtext)* 20)
  152. return SendClientMessage(playerid,-1,""R"Nu ai atatia bani");
  153. if(strval(inputtext) < 10)
  154. return SCM(playerid,-1,""R"Nu poti cumpara mai putin de "O"10 "R"gloante!!");
  155. GivePlayerWeapon(playerid,34,strval(inputtext));
  156. GivePlayerMoney(playerid,-strval(inputtext)* 20);
  157. format(str,128,""R"** "O"%s "W"a cumparat un Sniper cu "R"%d "W"gloante "R"**",GetName(playerid),strval(inputtext));
  158. SCMToAll(-1,str);
  159.  
  160. }
  161. }
  162. case ammo + 6:
  163. {
  164. if(!response)
  165. return ShowPlayerDialog(playerid,ammo,DIALOG_STYLE_LIST,"Wdialog",Weapon(),"Ok","Cancel");
  166. if(response)
  167. {
  168. new str[128];
  169. if(GetPlayerMoney(playerid) < strval(inputtext)* 13)
  170. return SendClientMessage(playerid,-1,""R"Nu ai atatia bani");
  171. if(strval(inputtext) < 10)
  172. return SCM(playerid,-1,""R"Nu poti cumpara mai putin de "O"10 "R"gloante!!");
  173. GivePlayerWeapon(playerid,25,strval(inputtext));
  174. GivePlayerMoney(playerid,-strval(inputtext)* 13);
  175. format(str,128,""R"** "O"%s "W"a cumparat un ShotGun cu "R"%d "W"gloante "R"**",GetName(playerid),strval(inputtext));
  176. SCMToAll(-1,str);
  177.  
  178. }
  179. }
  180. case ammo + 7:
  181. {
  182. if(!response)
  183. return ShowPlayerDialog(playerid,ammo,DIALOG_STYLE_LIST,"Wdialog",Weapon(),"Ok","Cancel");
  184. if(response)
  185. {
  186. new str[128];
  187. if(GetPlayerMoney(playerid) < strval(inputtext)* 18)
  188. return SendClientMessage(playerid,-1,""R"Nu ai atatia bani");
  189. if(strval(inputtext) < 10)
  190. return SCM(playerid,-1,""R"Nu poti cumpara mai putin de "O"10 "R"gloante!!");
  191. GivePlayerWeapon(playerid,26,strval(inputtext));
  192. GivePlayerMoney(playerid,-strval(inputtext)* 18);
  193. format(str,128,""R"** "O"%s "W"a cumparat un Sawnoff ShotGun cu "R"%d "W"gloante "R"**",GetName(playerid),strval(inputtext));
  194. SCMToAll(-1,str);
  195.  
  196. }
  197. }
  198. case ammo + 8:
  199. {
  200. if(!response)
  201. return ShowPlayerDialog(playerid,ammo,DIALOG_STYLE_LIST,"Wdialog",Weapon(),"Ok","Cancel");
  202. if(response)
  203. {
  204. new str[128];
  205. if(GetPlayerMoney(playerid) < strval(inputtext)* 3)
  206. return SendClientMessage(playerid,-1,""R"Nu ai atatia bani");
  207. if(strval(inputtext) < 10)
  208. return SCM(playerid,-1,""R"Nu poti cumpara mai putin de "O"10 "R"gloante!!");
  209. GivePlayerWeapon(playerid,26,strval(inputtext));
  210. GivePlayerMoney(playerid,-strval(inputtext)* 3);
  211. format(str,128,""R"** "O"%s "W"a cumparat un Tec-9 cu "R"%d "W"gloante "R"**",GetName(playerid),strval(inputtext));
  212. SCMToAll(-1,str);
  213.  
  214. }
  215. }
  216. }
  217. return 1;
  218. }
  219. CMD:arme(playerid,params[])
  220. {
  221. ShowPlayerDialog(playerid,ammo,DIALOG_STYLE_LIST,"Wdialog",Weapon(),"Ok","Cancel");
  222. return 1;
  223. }
  224. //==============================================================================
  225. // Stock's
  226. //==============================================================================
  227. stock Weapon()
  228. {
  229. new Wdialog[1000];
  230. Wdialog[0]='\0';
  231. strcat(Wdialog,""O"D"W"eagle - ( "R"5$/glont"W" )\n"O"M"W"4 - ( "R"15$/glont"W" )\n"O"A"W"k47 - ( "R"14$/glont"W" )\n",1000);
  232. strcat(Wdialog,""O"M"W"P5 - ( "R"11$/glont"W" )\n"O"S"W"niper - ( "R"20$/glont"W" )\n"O"S"W"hotgun - ( "R"13/glont"W" )\n",1000);
  233. strcat(Wdialog,""O"S"W"awnoff Shotgun - ( "R"18/glont"W" )\n"O"T"W"ec-9 - ( "R"3/glont "W" )\n",1000);
  234. strcat(Wdialog,"\n",1000);
  235. strcat(Wdialog,"\n",1000);
  236. return Wdialog;
  237. }
  238.  
  239. stock GetName(playerid)
  240. {
  241. new name[MAX_PLAYER_NAME];
  242. GetPlayerName(playerid, name, MAX_PLAYER_NAME);
  243. return name;
  244. }
Advertisement
Add Comment
Please, Sign In to add comment