Advertisement
Guest User

Ammo.pwn

a guest
Nov 26th, 2016
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 35.83 KB | None | 0 0
  1. /**************************************************************************/
  2. // Ammo Nation
  3. /*************************************************************************/
  4. /**************************************************************************/
  5. // Version 2.0 | Build 2
  6. /*************************************************************************/
  7. /**
  8. * Copyright (c) 2015-2016 San Andreas Playground
  9. *
  10. * This program is free software: you can redistribute it and/or modify it under the terms of the
  11. * GNU General Public License as published by the Free Software Foundation, either version 3 of the
  12. * License, or (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
  15. * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License along with this program.
  19. * If not, see <http://www.gnu.org/licenses/>.
  20. */
  21.  
  22. /*AUTHOR ********************
  23. @Yaa - SA-MP Lead Scripter
  24. ***************************/
  25.  
  26. /*CMDS ********************
  27. /wshop [ Enter / Exit ]
  28. /mycar
  29. ***************************/
  30.  
  31. // Includes ========================================================================================
  32.  
  33. #include <a_samp>
  34. #include <zcmd>
  35. #include <YSI\y_ini>
  36. #include <streamer>
  37.  
  38. // Defines ========================================================================================
  39.  
  40. #define SERVERNAME "San Andreas Playground"
  41.  
  42. #define R "{F81414}"
  43. #define O "{FFAF00}"
  44. #define YE "{FFFF00}"
  45. #define GRI "{C0C0C0}"
  46. #define PATH "/Ammo/Cars/%s.ini"
  47. #define COLOR_GREEN 0x33AA33AA
  48.  
  49. #if !defined isnull
  50. #define isnull(%1) ((!(%1[0])) || (((%1[0]) == '\1') && (!(%1[1]))))
  51. #endif
  52.  
  53. // Variables =======================================================================================
  54.  
  55. new SpawnArmour[MAX_PLAYERS];
  56. new SpawnProtection[MAX_PLAYERS];
  57. new Ammo[MAX_PLAYERS];
  58. new AmmoPick[2];
  59. new SPDuration[MAX_PLAYERS];
  60. new Cars[6];
  61. new Text3D:vehicle3Dtext[MAX_VEHICLES];
  62. new MyCar[MAX_PLAYERS];
  63. new SMyCar[MAX_PLAYERS];
  64. new Gate;
  65. new WSCP[2];
  66. new Material[8];
  67. new PMaterial;
  68.  
  69. // Forwards ========================================================================================
  70.  
  71. forward AntiSpawnkill(playerid);
  72. forward LoadUser_Car(playerid,name[],value[]);
  73. forward GateTimer();
  74.  
  75. // Script =========================================================================================
  76.  
  77. public OnFilterScriptInit()
  78. {
  79. print("****************************************");
  80. print("----------------------------------------");
  81. print(" LV AMMO NATION BY Yaa ");
  82. print("----------------------------------------");
  83. print("****************************************");
  84. print("----------------------------------------");
  85. print(" VERSION : 2.0 ");
  86. print("----------------------------------------");
  87. print("****************************************");
  88. print("----------------------------------------");
  89. print(" LOADED ! ");
  90. print("----------------------------------------");
  91. print("****************************************");
  92.  
  93. WSCP[0] = CreateDynamicCP(2069.5486, 1555.4246, 10.6719, 3.0, -1, -1,-1, 100.0);
  94. WSCP[1] = CreateDynamicCP(2083.6482, 1582.1544, 11.4341, 1.0, -1, -1,-1, 100.0);
  95.  
  96. AmmoPick[0] = CreatePickup(1254, 2, 2111.1143, 1564.0620, 11.4344, -1);
  97. AmmoPick[1] = CreatePickup(1318, 2, 2109.6794, 1553.6306, 11.4344, -1);
  98. Create3DTextLabel(""R""SERVERNAME"\n "O"Ammo Nation v1.0 \n"YE"Use /wshop ", 0xF67E0FF, 2085.0610, 1577.1023, 11.4341, 50.0, 0, 0);
  99. Create3DTextLabel(""R"Weapons", 0xF67E0FF, 2111.1143, 1564.0620, 11.4344 + 0.75, 50.0, 0, 0);
  100. Create3DTextLabel(""O"Refil", 0xF67E0FF, 2109.6794, 1553.6306, 11.4344 + 0.75, 50.0, 0, 0);
  101.  
  102. CreateObject(3337, 2109.59009, 1555.12195, 14.37300, 0.00000, 0.00000, 0.00000);
  103. CreateObject(3749, 2080.23389, 1574.94800, 15.22200, 0.00000, 0.49900, 87.59900);
  104. CreateObject(19128, 2080.35205, 1578.83203, 9.77900, 0.00000, 0.00000, 0.00000);
  105. CreateObject(19128, 2080.35205, 1574.86096, 9.77900, 0.00000, 0.00000, 0.00000);
  106. CreateObject(19128, 2080.35205, 1570.93201, 9.77900, 0.00000, 0.00000, 0.00000);
  107. CreateObject(18769, 2092.41406, 1553.77502, 9.77000, 0.00000, 0.00000, 0.00000);
  108. CreateObject(18769, 2092.41406, 1573.67395, 9.77000, 0.00000, 0.00000, 0.00000);
  109. CreateObject(18769, 2112.38403, 1573.67395, 9.77000, 0.00000, 0.00000, 0.00000);
  110. CreateObject(18769, 2112.38403, 1553.77502, 9.77000, 0.00000, 0.00000, 0.00000);
  111. CreateObject(19313, 2090.39502, 1543.34705, 13.17000, 0.00000, 0.00000, 0.00000);
  112. CreateObject(19313, 2085.06201, 1543.29602, 13.17000, 0.00000, 0.00000, 0.00000);
  113. CreateObject(19313, 2078.03589, 1550.31897, 13.10100, 0.00000, 0.00000, -90.39900);
  114. CreateObject(19313, 2078.11499, 1561.81799, 13.10100, 0.00000, 0.00000, -90.39900);
  115. CreateObject(19313, 2089.60693, 1583.69897, 13.09000, 0.00000, 0.00000, 0.00000);
  116. CreateObject(19313, 2103.59912, 1583.69897, 13.09000, 0.00000, 0.00000, 0.00000);
  117. CreateObject(19313, 2117.58008, 1583.69897, 13.09000, 0.00000, 0.00000, 0.00000);
  118. CreateObject(19313, 2117.58008, 1583.69897, 13.09000, 0.00000, 0.00000, 0.00000);
  119. CreateObject(19313, 2117.58008, 1583.69897, 19.64000, 0.00000, 0.00000, 0.00000);
  120. CreateObject(19313, 2103.57788, 1583.69897, 19.64000, 0.00000, 0.00000, 0.00000);
  121. CreateObject(19313, 2089.58789, 1583.69897, 19.64000, 0.00000, 0.00000, 0.00000);
  122. CreateObject(19313, 2089.58789, 1583.69897, 26.13000, 0.00000, 0.00000, 0.00000);
  123. CreateObject(19313, 2103.64893, 1583.69897, 26.13000, 0.00000, 0.00000, 0.00000);
  124. CreateObject(19313, 2117.70190, 1583.69897, 26.13000, 0.00000, 0.00000, 0.00000);
  125. CreateObject(19313, 2127.18604, 1577.12805, 26.14000, 0.00000, 0.00000, -68.40000);
  126. CreateObject(19313, 2127.18604, 1577.12805, 19.53000, 0.00000, 0.00000, -68.40000);
  127. CreateObject(19313, 2127.09399, 1577.28503, 12.88000, 0.00000, 0.00000, -68.40000);
  128. CreateObject(19313, 2129.44507, 1563.75098, 13.02000, 0.00000, 0.00000, -92.09900);
  129. CreateObject(19313, 2128.96094, 1550.59204, 13.02000, 0.00000, 0.00000, -92.09900);
  130. CreateObject(19313, 2128.96094, 1550.59204, 19.54000, 0.00000, 0.00000, -92.09900);
  131. CreateObject(19313, 2129.48096, 1564.36499, 19.54000, 0.00000, 0.00000, -92.09900);
  132. CreateObject(19313, 2129.48096, 1564.36499, 26.06000, 0.00000, 0.00000, -92.09900);
  133. CreateObject(19313, 2128.97803, 1550.66504, 26.06000, 0.00000, 0.00000, -92.09900);
  134. CreateObject(19313, 2121.67700, 1543.53101, 17.84000, 0.00000, 0.00000, -179.49899);
  135. CreateObject(19313, 2121.67700, 1543.53101, 24.41000, 0.00000, 0.00000, -179.49899);
  136. CreateObject(19313, 2107.59595, 1543.40906, 24.41000, 0.00000, 0.00000, -179.49899);
  137. CreateObject(19313, 2107.59595, 1543.40906, 17.87000, 0.00000, 0.00000, -179.49899);
  138. CreateObject(19313, 2104.49390, 1543.37097, 17.87000, 0.00000, 0.00000, -179.49899);
  139. CreateObject(19313, 2104.49390, 1543.37097, 24.48000, 0.00000, 0.00000, -179.49899);
  140. CreateObject(19313, 2090.47290, 1543.24902, 24.48000, 0.00000, 0.00000, -179.49899);
  141. CreateObject(19313, 2090.47290, 1543.24902, 17.85000, 0.00000, 0.00000, -179.49899);
  142. CreateObject(19313, 2084.87012, 1543.35901, 17.85000, 0.00000, 0.00000, -179.49899);
  143. CreateObject(19313, 2084.87012, 1543.35901, 24.44000, 0.00000, 0.00000, -179.49899);
  144. CreateObject(19313, 2078.12109, 1550.18701, 19.53000, 0.00000, 0.00000, 89.40000);
  145. CreateObject(19313, 2078.18994, 1556.88599, 19.53000, 0.00000, 0.00000, 89.40000);
  146. CreateObject(19313, 2077.90405, 1550.33899, 24.37000, 0.00000, 0.00000, 89.40000);
  147. CreateObject(19313, 2078.17310, 1556.89600, 24.37000, 0.00000, 0.00000, 89.40000);
  148. CreateObject(19313, 2081.47290, 1556.97803, 27.55700, -91.00000, -0.09900, 89.40000);
  149. CreateObject(19313, 2081.21704, 1550.42896, 27.55400, -91.00000, -0.09900, 89.40000);
  150. CreateObject(19313, 2085.64697, 1576.76404, 29.36600, -91.00000, -0.09900, 89.40000);
  151. CreateObject(19313, 2085.59009, 1570.39404, 29.36700, -91.00000, -0.09900, 89.40000);
  152. CreateObject(19313, 2082.87891, 1576.71497, 26.13700, 0.89900, -0.30000, 91.80000);
  153. CreateObject(19313, 2083.05493, 1571.06799, 26.10700, 0.89900, -0.30000, 91.80000);
  154. CreateObject(19313, 2083.05493, 1571.06799, 26.10700, 0.89900, -0.30000, 91.80000);
  155. CreateObject(3624, 2113.56592, 1557.61804, 14.10900, 0.00000, 0.00000, 0.00000);
  156. CreateObject(8967, 2143.15698, 1603.59998, 74.12100, 0.00000, 0.00000, 0.00000);
  157. CreateObject(1824, 2105.79199, 1565.78601, 10.98400, 0.00000, 0.00000, 0.00000);
  158. CreateObject(2592, 2110.51807, 1569.58398, 11.52400, 0.00000, 0.00000, 0.00000);
  159. CreateObject(19786, 2127.32397, 1554.63306, 13.21400, 0.00000, 0.00000, -89.70000);
  160. CreateObject(19786, 2127.20801, 1557.61304, 13.21400, 0.00000, 0.00000, -89.70000);
  161. CreateObject(19786, 2127.18994, 1560.85303, 13.21400, 0.00000, 0.00000, -89.70000);
  162. CreateObject(1271, 2118.57788, 1554.06396, 10.75400, 0.00000, 0.00000, 0.00000);
  163. CreateObject(1271, 2118.57788, 1553.31494, 10.75400, 0.00000, 0.00000, 0.00000);
  164. CreateObject(1271, 2118.57788, 1552.60596, 10.75400, 0.00000, 0.00000, 0.00000);
  165. CreateObject(1271, 2119.24805, 1552.60596, 10.75400, 0.00000, 0.00000, 0.00000);
  166. CreateObject(1271, 2119.24805, 1552.60596, 11.47400, 0.00000, 0.00000, 0.00000);
  167. CreateObject(1271, 2118.51709, 1552.60596, 11.47400, 0.00000, 0.00000, 0.00000);
  168. CreateObject(1271, 2119.00708, 1552.60596, 12.16400, 0.00000, 0.00000, 0.00000);
  169. CreateObject(1271, 2119.10693, 1554.18604, 10.81400, 0.00000, 0.00000, 0.00000);
  170. CreateObject(2040, 2109.42993, 1558.73303, 10.43400, 0.00000, 0.00000, 0.00000);
  171. CreateObject(362, 2123.70703, 1557.74304, 16.25300, 0.00000, 62.59900, 177.19901);
  172. CreateObject(19954, 2075.54346, 1580.54089, 9.86133, 0.00000, 0.00000, 0.00000);
  173. CreateObject(19954, 2071.74854, 1580.56201, 9.86133, 0.00000, 0.00000, 0.00000);
  174. CreateObject(19954, 2068.32813, 1579.77283, 9.86133, 0.00000, 0.00000, 0.00000);
  175. CreateObject(19992, 2072.46118, 1539.98352, 9.28836, 0.00000, 0.00000, 0.00000);
  176. CreateObject(19989, 2072.37720, 1554.67542, 9.85043, 0.00000, 0.00000, 0.00000);
  177. CreateObject(19976, 2082.93994, 1538.48328, 9.66328, 0.00000, 0.00000, 88.14000);
  178. Material[0] = CreateObject(4732, 2066.68481, 1570.42908, 12.71268, 0.00000, 0.00000, -125.04000);
  179. Material[1] = CreateObject(4732, 2066.61182, 1550.26416, 12.71268, 0.00000, 0.00000, -125.04000);
  180. Material[2] = CreateObject(4732, 2066.55322, 1531.61609, 12.71268, 0.00000, 0.00000, -125.04000);
  181. Material[3] = CreateObject(4732, 2066.41357, 1545.38684, 12.71268, 0.00000, 0.00000, 54.90002);
  182. Material[4] = CreateObject(4732, 2066.20654, 1524.10645, 12.78421, 0.00000, 0.00000, -304.85989);
  183. Material[5] = CreateObject(4732, 2066.44019, 1566.66113, 12.71268, 0.00000, 0.00000, 54.90002);
  184. Material[6] = CreateObject(4732, 2074.52759, 1588.23987, 12.71268, 0.00000, 0.00000, -171.95984);
  185. Material[7] = CreateObject(4732, 2074.99438, 1587.61719, 12.71268, 0.00000, 0.00000, -355.19968);
  186.  
  187. PMaterial = CreateObject(4732, 2088.54785, 1543.13245, 24.45524, 0.00000, 0.00000, -214.37979);
  188.  
  189. SetObjectMaterialText(Material[0], "LV Ammo Nation", 0, OBJECT_MATERIAL_SIZE_256x128, "Arial", 28, 0, 0xFFFF8200, 0xFF000000, OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
  190. SetObjectMaterialText(Material[1], "to ", 0, OBJECT_MATERIAL_SIZE_256x128, "Arial", 28, 0, 0xFFFF8200, 0xFF000000, OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
  191. SetObjectMaterialText(Material[2], "Welcome", 0, OBJECT_MATERIAL_SIZE_256x128, "Arial", 28, 0, 0xFFFF8200, 0xFF000000, OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
  192. SetObjectMaterialText(Material[3], "LV Ammo Nation", 0, OBJECT_MATERIAL_SIZE_256x128, "Arial", 28, 0, 0xFFFF8200, 0xFF000000, OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
  193. SetObjectMaterialText(Material[4], "Have Fun !", 0, OBJECT_MATERIAL_SIZE_256x128, "Arial", 28, 0, 0xFFFF8200, 0xFF000000, OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
  194. SetObjectMaterialText(Material[5], "to", 0, OBJECT_MATERIAL_SIZE_256x128, "Arial", 28, 0, 0xFFFF8200, 0xFF000000, OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
  195. SetObjectMaterialText(Material[6], "Have Fun !", 0, OBJECT_MATERIAL_SIZE_256x128, "Arial", 28, 0, 0xFFFF8200, 0xFF000000, OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
  196. SetObjectMaterialText(Material[7], "Welcome", 0, OBJECT_MATERIAL_SIZE_256x128, "Arial", 28, 0, 0xFFFF8200, 0xFF000000, OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
  197.  
  198. SetObjectMaterialText(PMaterial, ""R""SERVERNAME" \n"O"LV Ammo Nation \n"YE" Hunting and Fishing Like a Boss !", 0, OBJECT_MATERIAL_SIZE_512x128, "Arial", 28, 0, 0xFFFF8200, 0xFF000000, OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
  199.  
  200. CreateObject(19273, 2082.60229, 1581.96765, 12.28170, 0.00000, 0.00000, 83.63994);
  201.  
  202. Gate = CreateObject(19912, 2081.8880000,1569.0620000,12.8810000,0.0000000,0.0000000,-92.9000000); //
  203.  
  204. Cars[0] = AddStaticVehicle(411,2117.6343,1580.1884,11.1615,178.1517,64,1);
  205. Cars[1] = AddStaticVehicle(411,2113.3469,1580.1506,11.1620,180.0896,123,1);
  206. Cars[2] = AddStaticVehicle(447,2089.4739,1552.8013,11.4464,35.4359,75,2);
  207. Cars[3] = AddStaticVehicle(490,2106.2280,1572.0549,11.5632,94.8587,0,0);
  208. Cars[4] = AddStaticVehicle(498,2124.2275,1565.0564,10.8888,180.8574,13,120);
  209. Cars[5] = AddStaticVehicle(428,2109.1694,1548.6055,11.5548,2.8408,4,75);
  210.  
  211. vehicle3Dtext[Cars[0]] = Create3DTextLabel( ""R"Infernus \n"YE"For Sale !", 0xFF0000AA, 0.0, 0.0, 0.0, 50.0, 0, 1 );
  212. Attach3DTextLabelToVehicle( vehicle3Dtext[Cars[0]], Cars[0], 0.0, 0.0, 2.0);
  213.  
  214. vehicle3Dtext[Cars[1]] = Create3DTextLabel( ""R"Infernus \n"YE"For Sale !", 0xFF0000AA, 0.0, 0.0, 0.0, 50.0, 0, 1 );
  215. Attach3DTextLabelToVehicle( vehicle3Dtext[Cars[1]], Cars[1], 0.0, 0.0, 2.0);
  216.  
  217. vehicle3Dtext[Cars[2]] = Create3DTextLabel( ""R"Seasparrow \n"YE"For Sale !", 0xFF0000AA, 0.0, 0.0, 0.0, 50.0, 0, 1 );
  218. Attach3DTextLabelToVehicle( vehicle3Dtext[Cars[2]], Cars[2], 0.0, 0.0, 2.0);
  219.  
  220. vehicle3Dtext[Cars[3]] = Create3DTextLabel( ""R"FBI Rancher \n"YE"For Sale !", 0xFF0000AA, 0.0, 0.0, 0.0, 50.0, 0, 1 );
  221. Attach3DTextLabelToVehicle( vehicle3Dtext[Cars[3]], Cars[3], 0.0, 0.0, 2.0);
  222.  
  223. vehicle3Dtext[Cars[4]] = Create3DTextLabel( ""R"BoxVille \n"YE"For Sale !", 0xFF0000AA, 0.0, 0.0, 0.0, 50.0, 0, 1 );
  224. Attach3DTextLabelToVehicle( vehicle3Dtext[Cars[4]], Cars[4], 0.0, 0.0, 2.0);
  225.  
  226. vehicle3Dtext[Cars[5]] = Create3DTextLabel( ""R"Securicar \n"YE"For Sale !", 0xFF0000AA, 0.0, 0.0, 0.0, 50.0, 0, 1 );
  227. Attach3DTextLabelToVehicle( vehicle3Dtext[Cars[5]], Cars[5], 0.0, 0.0, 2.0);
  228. return 1;
  229.  
  230. }
  231.  
  232. public OnPlayerConnect(playerid)
  233. {
  234. if(fexist(UserPath(playerid)))
  235. {
  236. INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
  237. MyCar[playerid] = SMyCar[playerid];
  238. }
  239. else
  240. {
  241. new INI:File = INI_Open(UserPath(playerid));
  242. INI_SetTag(File,"Ammo Nation v2.0");
  243. INI_WriteInt(File,"Car", MyCar[playerid]);
  244. INI_Close(File);
  245. }
  246. SpawnArmour[playerid] = 0;
  247. SpawnProtection[playerid] = 0;
  248. SPDuration[playerid] = 0;
  249. Ammo[playerid] = 0;
  250. MyCar[playerid] = 0;
  251.  
  252. SetPlayerMapIcon(playerid, 6, 2085.0610, 1577.1023, 11.4341, 6, 0, MAPICON_LOCAL);
  253. RemoveBuildingForPlayer(playerid, 3509, 2089.320, 1583.479, 9.726, 0.250);
  254. RemoveBuildingForPlayer(playerid, 3509, 2089.320, 1566.189, 9.726, 0.250);
  255. RemoveBuildingForPlayer(playerid, 3509, 2109.050, 1547.270, 9.773, 0.250);
  256. RemoveBuildingForPlayer(playerid, 8623, 2093.879, 1553.510, 10.570, 0.250);
  257. RemoveBuildingForPlayer(playerid, 8618, 2093.679, 1553.319, 22.828, 0.250);
  258. RemoveBuildingForPlayer(playerid, 8971, 2093.679, 1553.319, 22.828, 0.250);
  259. RemoveBuildingForPlayer(playerid, 1350, 2082.5156, 1538.8125, 9.7891, 0.25);
  260. return 1;
  261. }
  262. public OnPlayerDisconnect(playerid, reason)
  263. {
  264. new INI:File = INI_Open(UserPath(playerid));
  265. INI_SetTag(File,"Ammo Nation V1.0 Loaded!");
  266. INI_WriteInt(File, "Car", MyCar[playerid]);
  267. INI_Close(File);
  268. return 1;
  269. }
  270. public OnPlayerSpawn(playerid)
  271. {
  272. if(SpawnArmour[playerid] == 1)
  273. {
  274. SetPlayerArmour(playerid, 100);
  275. }
  276. if(SpawnProtection[playerid] == 1)
  277. {
  278. SendClientMessage(playerid, COLOR_GREEN,"[SP]: Please Don't Abuse Spawn Protection !");
  279. SetPlayerHealth(playerid, 999999999999999999999999999999999999999.0);
  280. SetTimerEx("AntiSpawnkill", SPDuration[playerid]*1000, 0, "d", playerid);
  281. }
  282. if(SpawnArmour[playerid] == 0 && SpawnProtection[playerid] == 0)
  283. {
  284. SendClientMessage(playerid, COLOR_GREEN,"- Need a S-Armour Protection ? Buy it now at /wshop ");
  285. SendClientMessage(playerid, COLOR_GREEN,"- Need a Spawn Protection ? Buy it now at /wshop ");
  286. }
  287. else if(SpawnArmour[playerid] == 1 && SpawnProtection[playerid] == 0)
  288. {
  289. SendClientMessage(playerid, COLOR_GREEN,"- Need a Spawn Protection ? Buy it now at /wshop ");
  290. }
  291. else if(SpawnArmour[playerid] == 0 && SpawnProtection[playerid] == 1)
  292. {
  293. SendClientMessage(playerid, COLOR_GREEN,"- Need a S-Armour Protection ? Buy it now at /wshop ");
  294. }
  295. return 1;
  296. }
  297.  
  298. public OnFilterScriptExit()
  299. {
  300. print("----------------------------------------");
  301. print(" AMMO NATION BY Yaa ");
  302. print("----------------------------------------");
  303. print("----------------------------------------");
  304. print(" VERSION : 1.0 ");
  305. print("----------------------------------------");
  306. print("----------------------------------------");
  307. print(" UNLOADED ! ");
  308. print("----------------------------------------");
  309. DestroyPickup(AmmoPick[0]);
  310. DestroyPickup(AmmoPick[1]);
  311. return 1;
  312. }
  313.  
  314. CMD:wshop(playerid, params[])
  315. {
  316. if(isnull(params)) return SendClientMessage(playerid, -1,""R"Usage: "GRI"/wshop [enter/exit]");
  317. if(!strcmp(params, "enter", true))
  318. {
  319. if(Ammo[playerid] == 0)
  320. {
  321. SetPlayerPos(playerid, 2085.0610, 1577.1023, 11.4341);
  322. SendClientMessage(playerid, COLOR_GREEN,"Buy Weapons and start kill !");
  323. Ammo[playerid] = 1;
  324. }
  325. else return SendClientMessage(playerid, -1,""R"Error: "GRI"You are already in Ammo Nation Area");
  326. return 1;
  327. }
  328. if(!strcmp(params, "exit", true))
  329. {
  330. if(Ammo[playerid] == 1)
  331. {
  332. SetPlayerPos(playerid, 2078.1628, 1573.6301, 11.4341);
  333. SendClientMessage(playerid, COLOR_GREEN," Enjoy ! ");
  334. Ammo[playerid] = 0;
  335. }
  336. else return SendClientMessage(playerid, -1,""R"Error: "GRI"You are not in Ammo Nation Area");
  337. }
  338. else return SendClientMessage(playerid, -1,""R"Usage: "GRI"/wshop [enter/exit]");
  339. return 1;
  340. }
  341.  
  342. CMD:mycar(playerid, params[])
  343. {
  344. if(MyCar[playerid] == 0) return SendClientMessage(playerid, -1,""R"Error: "GRI"You Need To Buy a car first (/WSHOP)");
  345. new Float:X, Float:Y, Float:Z, Float:Angle, PrivateCar, str[20], str2[50];
  346. GetPlayerPos(playerid, X, Y, Z);
  347. GetPlayerFacingAngle(playerid, Angle);
  348. PrivateCar = CreateVehicle(MyCar[playerid], X, Y, Z, Angle, -1, -1, 30, 1);
  349. format(str, sizeof(str),"%s", GetName(playerid));
  350. SetVehicleNumberPlate(PrivateCar, str);
  351. format(str2, sizeof(str2),""R"%s's Car", GetName(playerid));
  352. vehicle3Dtext[PrivateCar] = Create3DTextLabel(str2, -1, 0.0, 0.0, 0.0, 50.0, 0, 1);
  353. Attach3DTextLabelToVehicle( vehicle3Dtext[PrivateCar], PrivateCar, 0.0, 0.0, 2.0);
  354. PutPlayerInVehicle(playerid, PrivateCar, 0);
  355. SendClientMessage(playerid, -1,""O"Success : "GRI"Enjoy with u car! ");
  356.  
  357. return 1;
  358. }
  359.  
  360. public OnPlayerPickUpPickup(playerid, pickupid)
  361. {
  362. if(AmmoPick[0] == pickupid)
  363. {
  364. ShowPlayerDialog(playerid, 6485, DIALOG_STYLE_LIST, "Weapons", "9mm \nSilenced 9mm \nTec9 \nShotgun \nUzi \nMP5 \nAK-47 \nM4 \nSniper \nMore", "Select", "Cancel");
  365. }
  366. else if(AmmoPick[1] == pickupid)
  367. {
  368. ShowPlayerDialog(playerid, 6458, DIALOG_STYLE_LIST, "Refil", ""R"Spawn Protection \n"O"Spawn Armour(10 000 $) \n"YE"Regular Armour(2000 $) ", "Select", "Cancel");
  369. }
  370. return 1;
  371. }
  372.  
  373. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  374. {
  375. if(dialogid == 6485)
  376. {
  377. if(response)
  378. {
  379. if(listitem == 0)
  380. {
  381. if(GetPlayerMoney(playerid) < 600) return SendClientMessage(playerid, -1, ""R"Error: "GRI"You need 600 $ For buy this weapon");
  382. GivePlayerMoney(playerid, -600);
  383. GivePlayerWeapon(playerid,22, 500);
  384. new name[256];
  385. new string[256];
  386. GetPlayerName(playerid, name, sizeof(name));
  387. format(string, sizeof(string), "Enjoy, Mr %s With using "R"`9mm Pistol`.", name);
  388. SendClientMessage(playerid, COLOR_GREEN, string);
  389. }
  390. if(listitem == 1)
  391. {
  392. if(GetPlayerMoney(playerid) < 900) return SendClientMessage(playerid, -1, ""R"Error: "GRI"You need 900 $ For buy this weapon");
  393. GivePlayerMoney(playerid, -900);
  394. GivePlayerWeapon(playerid,23, 500);
  395. new name[256];
  396. new string[256];
  397. GetPlayerName(playerid, name, sizeof(name));
  398. format(string, sizeof(string), "Enjoy, Mr %s With using "R"`9mm Silenced Pistol`.", name);
  399. SendClientMessage(playerid, COLOR_GREEN, string);
  400. TogglePlayerControllable(playerid,1);
  401. }
  402. if(listitem == 2)
  403. {
  404. if(GetPlayerMoney(playerid) < 1200) return SendClientMessage(playerid, -1, ""R"Error: "GRI"You need 1200 $ For buy this weapon");
  405. GivePlayerWeapon(playerid,32, 500);
  406. GivePlayerMoney(playerid, -1200);
  407. new name[256];
  408. new string[256];
  409. GetPlayerName(playerid, name, sizeof(name));
  410. format(string, sizeof(string), "Enjoy, Mr %s With using "R"`Tec9`.", name);
  411. SendClientMessage(playerid, COLOR_GREEN, string);
  412. }
  413. if(listitem == 3)
  414. {
  415. if(GetPlayerMoney(playerid) < 3300) return SendClientMessage(playerid, -1, ""R"Error: "GRI"You need 3300 $ For buy this weapon");
  416. GivePlayerMoney(playerid, -3300);
  417. GivePlayerWeapon(playerid,25, 500);
  418. new name[256];
  419. new string[256];
  420. GetPlayerName(playerid, name, sizeof(name));
  421. format(string, sizeof(string), "Enjoy, Mr %s With using "R"`Shotgun`.", name);
  422. SendClientMessage(playerid, COLOR_GREEN, string);
  423. }
  424. if(listitem == 4)
  425. {
  426. if(GetPlayerMoney(playerid) < 1900) return SendClientMessage(playerid, -1, ""R"Error: "GRI"You need 1900 $ For buy this weapon");
  427. GivePlayerMoney(playerid, -1900);
  428. GivePlayerWeapon(playerid,28, 500);
  429. new name[256];
  430. new string[256];
  431. GetPlayerName(playerid, name, sizeof(name));
  432. format(string, sizeof(string), "Enjoy, Mr %s With using "R"`Uzi`.", name);
  433. SendClientMessage(playerid, COLOR_GREEN, string);
  434. }
  435. if(listitem == 5)
  436. {
  437. if(GetPlayerMoney(playerid) < 1500) return SendClientMessage(playerid, -1, ""R"Error: "GRI"You need 1500 $ For buy this weapon");
  438. GivePlayerMoney(playerid, -1500);
  439. GivePlayerWeapon(playerid,29, 500);
  440. new name[256];
  441. new string[256];
  442. GetPlayerName(playerid, name, sizeof(name));
  443. format(string, sizeof(string), "Enjoy, Mr %s With using "R"`MP5`.", name);
  444. SendClientMessage(playerid, COLOR_GREEN, string);
  445. }
  446. if(listitem == 6)
  447. {
  448. if(GetPlayerMoney(playerid) < 4900) return SendClientMessage(playerid, -1, ""R"Error: "GRI"You need 4900 $ For buy this weapon");
  449. GivePlayerMoney(playerid, -4900);
  450. GivePlayerWeapon(playerid,30, 500);
  451. new name[256];
  452. new string[256];
  453. GetPlayerName(playerid, name, sizeof(name));
  454. format(string, sizeof(string), "Enjoy, Mr %s With using "R"`AK-47`.", name);
  455. SendClientMessage(playerid, COLOR_GREEN, string);
  456. }
  457. if(listitem == 7)
  458. {
  459. if(GetPlayerMoney(playerid) < 5500) return SendClientMessage(playerid, -1, ""R"Error: "GRI"You need 5500 $ For buy this weapon");
  460. GivePlayerMoney(playerid, -5500);
  461. GivePlayerWeapon(playerid,31, 500);
  462. new name[256];
  463. new string[256];
  464. GetPlayerName(playerid, name, sizeof(name));
  465. format(string, sizeof(string), "Enjoy, Mr %s With using "R"`M4`.", name);
  466. SendClientMessage(playerid, COLOR_GREEN, string);
  467. }
  468. if(listitem == 8)
  469. {
  470. if(GetPlayerMoney(playerid) < 5000) return SendClientMessage(playerid, -1, ""R"Error: "GRI"You need 5000 $ For buy this weapon");
  471. GivePlayerMoney(playerid, -5000);
  472. GivePlayerWeapon(playerid,34, 500);
  473. new name[256];
  474. new string[256];
  475. GetPlayerName(playerid, name, sizeof(name));
  476. format(string, sizeof(string), "Enjoy, Mr %s With using "R"`Sniper`.", name);
  477. SendClientMessage(playerid, COLOR_GREEN, string);
  478. }
  479. if(listitem == 9)
  480. {
  481. ShowPlayerDialog(playerid, 6486, DIALOG_STYLE_LIST, "Weapons", "Sawnoff Shotgun \nDesert Eeagle \nKnife \nCombat Shotgun", "Select", "Cancel");
  482. }
  483. }
  484. else return SendClientMessage(playerid, -1, ""R"You Cancelled !");
  485. }
  486. if(dialogid == 6486)
  487. {
  488. if(response)
  489. {
  490. if(listitem == 0)
  491. {
  492. if(GetPlayerMoney(playerid) < 2500) return SendClientMessage(playerid, -1, ""R"Error: "GRI"You need 2500 $ For buy this weapon");
  493. GivePlayerMoney(playerid, -2500);
  494. GivePlayerWeapon(playerid,26, 500);
  495. new name[256];
  496. new string[256];
  497. GetPlayerName(playerid, name, sizeof(name));
  498. format(string, sizeof(string), "Enjoy, Mr %s With using "R"`Sawnoff Shotgun`.", name);
  499. SendClientMessage(playerid, COLOR_GREEN, string);
  500. }
  501. if(listitem == 1)
  502. {
  503. if(GetPlayerMoney(playerid) < 3000) return SendClientMessage(playerid, -1, ""R"Error: "GRI"You need 3000 $ For buy this weapon");
  504. GivePlayerMoney(playerid, -3000);
  505. GivePlayerWeapon(playerid,24, 500);
  506. new name[256];
  507. new string[256];
  508. GetPlayerName(playerid, name, sizeof(name));
  509. format(string, sizeof(string), "Enjoy, Mr %s With using "R"`Desert Eeagle`.", name);
  510. SendClientMessage(playerid, COLOR_GREEN, string);
  511. TogglePlayerControllable(playerid,1);
  512. }
  513. if(listitem == 2)
  514. {
  515. if(GetPlayerMoney(playerid) < 500) return SendClientMessage(playerid, -1, ""R"Error: "GRI"You need 500 $ For buy this weapon");
  516. GivePlayerMoney(playerid, -500);
  517. GivePlayerWeapon(playerid,4, 500);
  518. new name[256];
  519. new string[256];
  520. GetPlayerName(playerid, name, sizeof(name));
  521. format(string, sizeof(string), "Enjoy, Mr %s With using "R"`Knife`.", name);
  522. SendClientMessage(playerid, COLOR_GREEN, string);
  523. }
  524. if(listitem == 3)
  525. {
  526. if(GetPlayerMoney(playerid) < 4500) return SendClientMessage(playerid, -1, ""R"Error: "GRI"You need 4500 $ For buy this weapon");
  527. GivePlayerMoney(playerid, -4500);
  528. GivePlayerWeapon(playerid,27, 500);
  529. new name[256];
  530. new string[256];
  531. GetPlayerName(playerid, name, sizeof(name));
  532. format(string, sizeof(string), "Enjoy, Mr %s With using "R"`Combat Shotgun`.", name);
  533. SendClientMessage(playerid, COLOR_GREEN, string);
  534. }
  535. }
  536. else return SendClientMessage(playerid, -1, ""R"You Cancelled !");
  537. }
  538. if(dialogid == 6458)
  539. {
  540. if(response)
  541. {
  542. if(listitem == 0)
  543. {
  544. ShowPlayerDialog(playerid, 6459, DIALOG_STYLE_LIST, "Spawn Protection", "SP: 15 sec \nSP: 30 sec \nSP: 60 sec", "Select", "Cancel");
  545. }
  546. if(listitem == 1)
  547. {
  548. if(GetPlayerMoney(playerid) < 10000) return SendClientMessage(playerid, -1, ""R"Error: "GRI"You need 10 000 $ For buy this protection");
  549. SpawnArmour[playerid] = 1;
  550. GivePlayerMoney(playerid, -10000);
  551. SetPlayerArmour(playerid, 100);
  552. new name[256];
  553. new string[256];
  554. GetPlayerName(playerid, name, sizeof(name));
  555. format(string, sizeof(string), "Enjoy, Mr %s With You "R"`Spawn Armour`.", name);
  556. SendClientMessage(playerid, COLOR_GREEN, string);
  557. }
  558. if(listitem == 2)
  559. {
  560. if(GetPlayerMoney(playerid) < 2000) return SendClientMessage(playerid, -1, ""R"Error: "GRI"You need 2000 $ For buy this protection");
  561. GivePlayerMoney(playerid, -2000);
  562. SetPlayerArmour(playerid, 100);
  563. new name[256];
  564. new string[256];
  565. GetPlayerName(playerid, name, sizeof(name));
  566. format(string, sizeof(string), "Enjoy, Mr %s With You "R"`Regular Armour`.", name);
  567. SendClientMessage(playerid, COLOR_GREEN, string);
  568. }
  569. }
  570. else return SendClientMessage(playerid, -1, ""R"You Cancelled !");
  571. }
  572. if(dialogid == 6459)
  573. {
  574. if(response)
  575. {
  576. if(listitem == 0)
  577. {
  578. if(GetPlayerMoney(playerid) < 30000) return SendClientMessage(playerid, -1, ""R"Error: "GRI"You need 30 000 $ For buy this protection");
  579. GivePlayerMoney(playerid, -30000);
  580. SpawnProtection[playerid] = 1;
  581. SPDuration[playerid] = 15;
  582. new name[256];
  583. new string[256];
  584. GetPlayerName(playerid, name, sizeof(name));
  585. format(string, sizeof(string), "Enjoy, Mr %s With You "R"`Spawn Protection (15 sec)`.", name);
  586. SendClientMessage(playerid, COLOR_GREEN, string);
  587. }
  588. if(listitem == 1)
  589. {
  590. if(GetPlayerMoney(playerid) < 60000) return SendClientMessage(playerid, -1, ""R"Error: "GRI"You need 60 000 $ For buy this protection");
  591. GivePlayerMoney(playerid, -60000);
  592. SpawnProtection[playerid] = 1;
  593. SPDuration[playerid] = 30;
  594. new name[256];
  595. new string[256];
  596. GetPlayerName(playerid, name, sizeof(name));
  597. format(string, sizeof(string), "Enjoy, Mr %s With You "R"`Spawn Protection (30 sec)`.", name);
  598. SendClientMessage(playerid, COLOR_GREEN, string);
  599. }
  600. if(listitem == 2)
  601. {
  602. if(GetPlayerMoney(playerid) < 120000) return SendClientMessage(playerid, -1, ""R"Error: "GRI"You need 120 000 $ For buy this protection");
  603. SpawnProtection[playerid] = 1;
  604. GivePlayerMoney(playerid, -120000);
  605. SPDuration[playerid] = 60;
  606. new name[256];
  607. new string[256];
  608. GetPlayerName(playerid, name, sizeof(name));
  609. format(string, sizeof(string), "Enjoy, Mr %s With You "R"`Spawn Protection (1 min)`.", name);
  610. SendClientMessage(playerid, COLOR_GREEN, string);
  611. }
  612. }
  613. else return SendClientMessage(playerid, -1, ""R"You Cancelled !");
  614. }
  615. if(dialogid == 6481)
  616. {
  617. if(response)
  618. {
  619. GivePlayerMoney(playerid, -5000000);
  620. SendClientMessage(playerid, -1, ""R"Success: "GRI" Enjoy With You car ! Now u can use /mycar");
  621. MyCar[playerid] = 411;
  622. }
  623. }
  624. if(dialogid == 6482)
  625. {
  626. if(response)
  627. {
  628. GivePlayerMoney(playerid, -3000000);
  629. SendClientMessage(playerid, -1, ""R"Success: "GRI" Enjoy With You car ! Now u can use /mycar");
  630. MyCar[playerid] = 447;
  631. }
  632. }
  633. if(dialogid == 6473)
  634. {
  635. if(response)
  636. {
  637. GivePlayerMoney(playerid, -8000000);
  638. SendClientMessage(playerid, -1, ""R"Success: "GRI" Enjoy With You car ! Now u can use /mycar");
  639. MyCar[playerid] = 447;
  640. }
  641. }
  642. if(dialogid == 6474)
  643. {
  644. if(response)
  645. {
  646. GivePlayerMoney(playerid, -8000000);
  647. SendClientMessage(playerid, -1, ""R"Success: "GRI" Enjoy With You car ! Now u can use /mycar");
  648. MyCar[playerid] = 447;
  649. }
  650. }
  651. if(dialogid == 6475)
  652. {
  653. if(response)
  654. {
  655. GivePlayerMoney(playerid, -10000000);
  656. SendClientMessage(playerid, -1, ""R"Error: "GRI" Enjoy With You car ! Now u can use /mycar");
  657. MyCar[playerid] = 447;
  658. }
  659. }
  660. return 1;
  661. }
  662.  
  663. public OnPlayerStateChange(playerid, newstate, oldstate)
  664. {
  665. if(GetPlayerVehicleID(playerid) == Cars[0] || GetPlayerVehicleID(playerid) == Cars[1])
  666. {
  667. if(GetPlayerMoney(playerid) < 5000000)
  668. {
  669. SendClientMessage(playerid, -1, ""R"Error: "GRI" You Need 5 000 000 $ For Buy this car !");
  670. RemovePlayerFromVehicle(playerid);
  671. }
  672. else return ShowPlayerDialog(playerid, 6481, DIALOG_STYLE_MSGBOX, "Infernus", "Do You want Buy this Infernus ?", "Yes", "No");
  673. }
  674. else if(GetPlayerVehicleID(playerid) == Cars[2])
  675. {
  676. if(GetPlayerMoney(playerid) < 3000000)
  677. {
  678. SendClientMessage(playerid, -1, ""R"Error: "GRI" You Need 3 000 000 $ For Buy this car !");
  679. RemovePlayerFromVehicle(playerid);
  680. }
  681. else return ShowPlayerDialog(playerid, 6482, DIALOG_STYLE_MSGBOX, "Othes", "Do You want Buy this Car / Heli ?", "Yes", "No");
  682. }
  683. else if(GetPlayerVehicleID(playerid) == Cars[3])
  684. {
  685. if(GetPlayerMoney(playerid) < 8000000)
  686. {
  687. SendClientMessage(playerid, -1, ""R"Error: "GRI" You Need 8 000 000 $ For Buy this car !");
  688. RemovePlayerFromVehicle(playerid);
  689. }
  690. else return ShowPlayerDialog(playerid, 6473, DIALOG_STYLE_MSGBOX, "Othes", "Do You want Buy this Car / Heli ?", "Yes", "No");
  691. }
  692. else if(GetPlayerVehicleID(playerid) == Cars[4])
  693. {
  694. if(GetPlayerMoney(playerid) < 8000000)
  695. {
  696. SendClientMessage(playerid, -1, ""R"Error: "GRI" You Need 8 000 000 $ For Buy this car !");
  697. RemovePlayerFromVehicle(playerid);
  698. }
  699. else return ShowPlayerDialog(playerid, 6474, DIALOG_STYLE_MSGBOX, "Othes", "Do You want Buy this Car / Heli ?", "Yes", "No");
  700. }
  701. else if(GetPlayerVehicleID(playerid) == Cars[5])
  702. {
  703. if(GetPlayerMoney(playerid) < 10000000)
  704. {
  705. SendClientMessage(playerid, -1, ""R"Error: "GRI" You Need 10 000 000 $ For Buy this Heli !");
  706. RemovePlayerFromVehicle(playerid);
  707. }
  708. else return ShowPlayerDialog(playerid, 6475, DIALOG_STYLE_MSGBOX, "Othes", "Do You want Buy this Car / Heli ?", "Yes", "No");
  709. }
  710. return 1;
  711. }
  712.  
  713. public OnPlayerEnterDynamicCP(playerid, checkpointid)
  714. {
  715. if(checkpointid == WSCP[0])
  716. {
  717. if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, -1, ""R"Error: "GRI"We are not able to open gate (You need car or use /wshop)");
  718. MoveObject(Gate, 2081.88794, 1569.06201, 17.23653, 2.00);
  719. SetTimer("GateTimer", 5000, false);
  720. }
  721. else if(checkpointid == WSCP[1])
  722. {
  723. MoveObject(Gate, 2081.88794, 1569.06201, 17.23653, 2.00);
  724. SendClientMessage(playerid, COLOR_GREEN, "Thank You For Visiting our Ammo Nation !");
  725. SetTimer("GateTimer", 10000, false);
  726. }
  727. return 1;
  728. }
  729.  
  730. public AntiSpawnkill(playerid)
  731. {
  732. SetPlayerHealth(playerid, 100.0);
  733. GameTextForPlayer(playerid, "~g~Spawn Protection ~r~Over, ~b~Move !", 3000, 4);
  734. return 1;
  735. }
  736.  
  737. public LoadUser_Car(playerid,name[],value[])
  738. {
  739. INI_Int("Car", SMyCar[playerid]);
  740. return 1;
  741. }
  742.  
  743. public GateTimer()
  744. {
  745. MoveObject(Gate, 2081.8880000, 1569.0620000, 12.8810000, 2.00);
  746. return 1;
  747. }
  748.  
  749. stock UserPath(playerid)
  750. {
  751. new string[100];
  752. format(string,sizeof(string),"/Ammo/%s.ini",GetName(playerid));
  753. return string;
  754. }
  755.  
  756. stock GetName(playerid)
  757. {
  758. new szName[MAX_PLAYER_NAME];
  759. GetPlayerName(playerid, szName, sizeof(szName));
  760. return szName;
  761. }
  762.  
  763. // End of Script ===================================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement