Guest User

Untitled

a guest
Apr 15th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 61.04 KB | None | 0 0
  1. #include <a_samp>
  2. #include <zcmd>
  3. #include <YSI\y_ini>
  4. #include <streamer>
  5. #include <mGates>
  6. #include <sscanf2>
  7.  
  8. //Colors
  9. #define COLOR_WHITE 0xFFFFFFFF
  10. #define COLOR_BLACK 0x000000FF
  11. #define COLOR_RED 0xFF0000FF
  12. #define COLOR_BROWN 0x800000FF
  13. #define COLOR_LIME 0x00FF00FF
  14. #define COLOR_GREEN 0x008000FF
  15. #define COLOR_CYAN 0x00FFFFFF
  16. #define COLOR_YELLOW 0xFFFF00FF
  17. #define COLOR_BLUE 0x0000FFFF
  18. #define COLOR_ORANGE 0xFF8000FF
  19. #define COLOR_PINK 0xFF00FFFF
  20. #define COLOR_PURPLE 0x8000FFFF
  21.  
  22. //Gay shit
  23. #define PATH "/Users/%s.ini"
  24.  
  25. //Dialogs
  26. #define DIALOG_REGISTER 800
  27. #define DIALOG_LOGIN 801
  28. #define DIALOG_SUCCESS_1 802
  29. #define DIALOG_SUCCESS_2 803
  30.  
  31. #define DIALOG_TEAM_SELECTION 804
  32.  
  33. #define DIALOG_SELECT_WEAPONS_CATEGORY 805
  34. #define DIALOG_ADM_WEAPONS_MELEE 806
  35. #define DIALOG_ADM_WEAPONS_THROWN 807
  36. #define DIALOG_ADM_WEAPONS_PISTOLS 808
  37. #define DIALOG_ADM_WEAPONS_SHOTGUNS 809
  38. #define DIALOG_ADM_WEAPONS_SMGS 810
  39. #define DIALOG_ADM_WEAPONS_ASSAULT_RIFLES 811
  40. #define DIALOG_ADM_WEAPONS_RIFLES 812
  41. #define DIALOG_ADM_WEAPONS_HEAVY 813
  42.  
  43. //Teams
  44. #define TEAM_USA 5000
  45. #define TEAM_CANADA 5001
  46. #define TEAM_BRITAIN 5002
  47. #define TEAM_AUSTRALIA 5003
  48. #define TEAM_RUSSIA 5004
  49. #define TEAM_GERMANY 5005
  50. #define TEAM_ITALY 5006
  51. #define TEAM_FRANCE 5007
  52. #define TEAM_CHINA 5008
  53. #define TEAM_INDIA 5009
  54.  
  55. #define COLOR_USA 0x0000FFFF
  56. #define COLOR_CANADA 0x008000FF
  57. #define COLOR_BRITAIN 0xFF0000FF
  58. #define COLOR_AUSTRALIA 0x0080FFFF
  59. #define COLOR_RUSSIA 0x800000FF
  60. #define COLOR_GERMANY 0xFFFF00FF
  61. #define COLOR_ITALY 0x408080FF
  62. #define COLOR_FRANCE 0x80FF80FF
  63. #define COLOR_CHINA 0xFF8000FF
  64. #define COLOR_INDIA 0x0080C0FF
  65.  
  66. #define COLOR_USA_EMBED "{0000FF}"
  67. #define COLOR_CANADA_EMBED "{008000}"
  68. #define COLOR_BRITAIN_EMBED "{FF0000}"
  69. #define COLOR_AUSTRALIA_EMBED "{0080FF}"
  70. #define COLOR_RUSSIA_EMBED "{800000}"
  71. #define COLOR_GERMANY_EMBED "{408080}"
  72. #define COLOR_ITALY_EMBED "{80FF80}"
  73. #define COLOR_FRANCE_EMBED "{0080C0}"
  74. #define COLOR_CHINA_EMBED "{FFFF00}"
  75. #define COLOR_INDIA_EMBED "{FF8000}"
  76. //Player data
  77. enum pInfo
  78. {
  79. pPass,
  80. pCash,
  81. pAdmin,
  82. pKills,
  83. pDeaths,
  84. pVIP,
  85. pXP,
  86. pLevel,
  87. pLevelName[64],
  88. pTeam
  89. }
  90.  
  91. new PlayerInfo[MAX_PLAYERS][pInfo];
  92.  
  93. //Gates
  94. new GATE_ADMIN_HOUSE1;
  95. new GATE_ADMIN_HOUSE2;
  96.  
  97. new GATE_INDIA1;
  98. new GATE_INDIA2;
  99. new GATE_INDIA3;
  100.  
  101. //Zones
  102. new CP[30];
  103. new Zone[30];
  104. new tCheck[30];
  105. new zDefine[MAX_PLAYERS];
  106. new UnderAttack[30];
  107. new timer[MAX_PLAYERS][30];
  108.  
  109. #define ZONE_BLUEBERRY_FACTORY 0
  110.  
  111.  
  112. main()
  113. {
  114. print("\n----------------------------------");
  115. print(" Maude Team Deathmatch");
  116. print("----------------------------------\n");
  117. }
  118. public OnGameModeInit()
  119. {
  120. SetGameModeText("Maude TDM - Alpha 1.0");
  121. DisableInteriorEnterExits();
  122.  
  123. //Zomes
  124. CP[ZONE_BLUEBERRY_FACTORY] = CreateDynamicCP(-241.4616,-236.2352,2.4297, 10, -1, -1, -1, 100.0);
  125. Zone[ZONE_BLUEBERRY_FACTORY] = GangZoneCreate(-250.0, -397.0, 25.0, -207.0); //blueberry brewery
  126. //Gates
  127. GATE_ADMIN_HOUSE1 = CreateAutomaticGate(980, 1491.3000000,-699.9000200,96.5000000, 0.0000000,0.0000000,180.0000000, 1480.8000488281,-699.9000200,96.5000000, 0.000000, 0.0000000, 180.000000, 1497.3116,-701.8853,94.7500, 5.0, 3, true);
  128. GATE_ADMIN_HOUSE2 = CreateAutomaticGate(980, 1502.8000000,-699.9000200,96.5000000, 0.000000, 0.0000000, 0.0000000, 1514.3000488281,-699.9000200,96.5000000, 0.000000, 0.000000, 0.000000, 1497.3116,-701.8853,94.7500, 5.0, 3, true);
  129.  
  130. //Admin House
  131. AddStaticVehicleEx(520,1465.0996000,-688.0996100,95.7000000,270.0000000,-1,-1,15); //Hydra
  132. AddStaticVehicleEx(425,1523.3000000,-672.7000100,95.6000000,180.0000000,95,10,15); //Hunter
  133. AddStaticVehicleEx(520,1465.0000000,-675.7999900,95.7000000,270.0000000,-1,-1,15); //Hydra
  134. AddStaticVehicleEx(520,1465.1000000,-663.4000200,95.7000000,270.0000000,-1,-1,15); //Hydra
  135. AddStaticVehicleEx(445,1517.1000000,-697.0000000,94.7000000,90.0000000,100,100,15); //Admiral
  136. AddStaticVehicleEx(445,1517.1000000,-694.2000100,94.7000000,90.0000000,100,100,15); //Admiral
  137. AddStaticVehicleEx(445,1517.1000000,-691.2999900,94.7000000,90.0000000,100,100,15); //Admiral
  138. AddStaticVehicleEx(468,1502.7000000,-687.9000200,94.5000000,180.0000000,132,4,15); //Sanchez
  139. AddStaticVehicleEx(468,1504.0000000,-687.9000200,94.5000000,180.0000000,132,4,15); //Sanchez
  140. AddStaticVehicleEx(468,1505.4000000,-687.9000200,94.5000000,180.0000000,132,4,15); //Sanchez
  141. AddStaticVehicleEx(468,1506.9000000,-687.9000200,94.5000000,180.0000000,132,4,15); //Sanchez
  142. AddStaticVehicleEx(521,1491.7000000,-687.7999900,94.4000000,180.0000000,96,26,15); //FCR-900
  143. AddStaticVehicleEx(521,1490.5000000,-687.9000200,94.4000000,180.0000000,96,26,15); //FCR-900
  144. AddStaticVehicleEx(521,1489.0000000,-687.9000200,94.4000000,180.0000000,96,26,15); //FCR-900
  145. AddStaticVehicleEx(521,1487.6000000,-688.0000000,94.4000000,180.0000000,96,26,15); //FCR-900
  146. CreateObject(987,1469.5000000,-694.2000100,93.7000000,0.0000000,0.0000000,0.0000000); //object(elecfence_bar) (1)
  147. CreateObject(987,1457.6000000,-694.2000100,93.7000000,0.0000000,0.0000000,0.0000000); //object(elecfence_bar) (2)
  148. CreateObject(987,1456.7000000,-694.2000100,93.7000000,0.0000000,0.0000000,0.0000000); //object(elecfence_bar) (3)
  149. CreateObject(987,1456.6000000,-682.4000200,93.7000000,0.0000000,0.0000000,270.0000000); //object(elecfence_bar) (4)
  150. CreateObject(987,1456.6000000,-670.4000200,93.7000000,0.0000000,0.0000000,270.0000000); //object(elecfence_bar) (5)
  151. CreateObject(987,1456.6000000,-658.4000200,93.7000000,0.0000000,0.0000000,270.0000000); //object(elecfence_bar) (6)
  152. CreateObject(987,1456.6000000,-657.0000000,93.7000000,0.0000000,0.0000000,270.0000000); //object(elecfence_bar) (7)
  153. CreateObject(987,1468.3000000,-657.2000100,93.7000000,0.0000000,0.0000000,180.0000000); //object(elecfence_bar) (10)
  154. CreateObject(987,1480.3000000,-657.2000100,93.7000000,0.0000000,0.0000000,179.9950000); //object(elecfence_bar) (11)
  155. CreateObject(987,1492.3000000,-657.2000100,93.7000000,0.0000000,0.0000000,179.9950000); //object(elecfence_bar) (12)
  156. CreateObject(987,1504.2000000,-657.2000100,93.7000000,0.0000000,0.0000000,179.9950000); //object(elecfence_bar) (13)
  157. CreateObject(987,1516.1000000,-657.2000100,93.7000000,0.0000000,0.0000000,179.9950000); //object(elecfence_bar) (14)
  158. CreateObject(987,1528.0000000,-657.2000100,93.7000000,0.0000000,0.0000000,179.9950000); //object(elecfence_bar) (15)
  159. CreateObject(987,1531.0000000,-657.2000100,93.7000000,0.0000000,0.0000000,179.9950000); //object(elecfence_bar) (16)
  160. CreateObject(987,1530.9000000,-669.0999800,93.7000000,0.0000000,0.0000000,90.0000000); //object(elecfence_bar) (18)
  161. CreateObject(987,1530.9000000,-681.0000000,93.7000000,0.0000000,0.0000000,90.0000000); //object(elecfence_bar) (19)
  162. CreateObject(987,1530.9000000,-692.9000200,93.7000000,0.0000000,0.0000000,90.0000000); //object(elecfence_bar) (20)
  163. CreateObject(987,1530.9000000,-699.7999900,93.7000000,0.0000000,0.0000000,90.0000000); //object(elecfence_bar) (21)
  164. CreateObject(987,1519.0000000,-699.7999900,93.7000000,0.0000000,0.0000000,0.0000000); //object(elecfence_bar) (22)
  165. CreateObject(987,1508.6000000,-699.7999900,93.7000000,0.0000000,0.0000000,0.0000000); //object(elecfence_bar) (23)
  166. CreateObject(987,1476.3000000,-694.2999900,93.7000000,0.0000000,0.0000000,330.0000000); //object(elecfence_bar) (25)
  167.  
  168. //India base
  169. AddStaticVehicleEx(432,2795.2998000,-2417.7998000,13.7000000,90.0000000,95,10,15); //Rhino
  170. AddStaticVehicleEx(433,2777.2998000,-2403.0000000,14.2000000,88.9950000,95,10,15); //Barracks
  171. AddStaticVehicleEx(433,2777.2998000,-2470.5996000,14.2000000,88.9950000,95,10,15); //Barracks
  172. AddStaticVehicleEx(470,2757.0000000,-2380.8994000,13.7000000,180.0000000,95,10,15); //Patriot
  173. AddStaticVehicleEx(520,2796.1001000,-2340.8000000,14.6000000,180.0000000,-1,-1,15); //Hydra
  174. AddStaticVehicleEx(520,2785.8999000,-2340.8000000,14.6000000,180.0000000,-1,-1,15); //Hydra
  175. AddStaticVehicleEx(520,2775.7000000,-2340.8000000,14.6000000,180.0000000,-1,-1,15); //Hydra
  176. AddStaticVehicleEx(520,2765.5000000,-2340.8000000,14.6000000,180.0000000,-1,-1,15); //Hydra
  177. AddStaticVehicleEx(425,2765.8000000,-2355.2000000,14.5000000,0.0000000,95,10,15); //Hunter
  178. AddStaticVehicleEx(425,2777.3000000,-2355.2000000,14.5000000,0.0000000,95,10,15); //Hunter
  179. AddStaticVehicleEx(425,2788.8000000,-2355.2000000,14.5000000,0.0000000,95,10,15); //Hunter
  180. AddStaticVehicleEx(433,2777.3000000,-2398.5000000,14.2000000,88.9950000,95,10,15); //Barracks
  181. AddStaticVehicleEx(470,2760.3000000,-2380.8999000,13.7000000,180.0000000,95,10,15); //Patriot
  182. AddStaticVehicleEx(432,2795.3000000,-2455.8000000,13.7000000,90.0000000,95,10,15); //Rhino
  183. AddStaticVehicleEx(432,2795.3000000,-2494.5000000,13.7000000,90.0000000,95,10,15); //Rhino
  184. AddStaticVehicleEx(430,2718.5000000,-2572.0996000,0.0000000,180.0000000,157,152,15); //Predator
  185. AddStaticVehicleEx(430,2728.3999000,-2583.8000000,0.0000000,90.0000000,157,152,15); //Predator
  186. AddStaticVehicleEx(473,2736.5000000,-2583.3000000,0.0000000,90.0000000,158,164,15); //Dinghy
  187. AddStaticVehicleEx(473,2742.0000000,-2583.3000000,0.0000000,90.0000000,158,164,15); //Dinghy
  188. AddStaticVehicleEx(473,2747.8000000,-2583.3000000,0.0000000,90.0000000,158,164,15); //Dinghy
  189. AddStaticVehicleEx(473,2753.3000000,-2583.3000000,0.0000000,90.0000000,158,164,15); //Dinghy
  190. AddStaticVehicleEx(493,2760.5000000,-2583.8000500,0.0000000,270.0000000,37,37,15); //Jetmax
  191. AddStaticVehicleEx(447,2777.8000000,-2578.0000000,0.6000000,178.0000000,32,32,15); //Seasparrow
  192. AddStaticVehicleEx(425,2794.8999000,-2553.2000000,14.5000000,0.0000000,95,10,15); //Hunter
  193. AddStaticVehicleEx(425,2782.3999000,-2553.2000000,14.5000000,0.0000000,95,10,15); //Hunter
  194. AddStaticVehicleEx(425,2789.2000000,-2534.2000000,14.5000000,0.0000000,95,10,15); //Hunter
  195. AddStaticVehicleEx(433,2777.3000000,-2479.3999000,14.2000000,89.2450000,95,10,15); //Barracks
  196. AddStaticVehicleEx(433,2777.3000000,-2508.8999000,14.2000000,89.2420000,95,10,15); //Barracks
  197. CreateObject(987,2719.7000000,-2379.6001000,12.6000000,0.0000000,0.0000000,270.0000000); //object(elecfence_bar) (8)
  198. CreateObject(987,2719.5000000,-2389.3000000,12.6000000,0.0000000,0.0000000,270.0000000); //object(elecfence_bar) (9)
  199. CreateObject(987,2719.5000000,-2409.8999000,12.6000000,0.0000000,0.0000000,270.0000000); //object(elecfence_bar) (24)
  200. CreateObject(987,2719.5000000,-2487.2000000,12.6000000,0.0000000,0.0000000,270.0000000); //object(elecfence_bar) (26)
  201. CreateObject(987,2719.5000000,-2487.8999000,12.6000000,0.0000000,0.0000000,270.0000000); //object(elecfence_bar) (27)
  202. CreateObject(987,2719.5000000,-2508.3000000,12.6000000,0.0000000,0.0000000,270.0000000); //object(elecfence_bar) (28)
  203. CreateObject(987,2719.5000000,-2510.7000000,16.2000000,0.0000000,0.0000000,270.0000000); //object(elecfence_bar) (29)
  204. CreateObject(987,2719.5000000,-2341.7000000,12.6000000,0.0000000,0.0000000,270.0000000); //object(elecfence_bar) (30)
  205. CreateObject(987,2719.5000000,-2330.2000000,12.6000000,0.0000000,0.0000000,270.0000000); //object(elecfence_bar) (31)
  206. CreateObject(987,2719.5000000,-2544.7000000,12.6000000,0.0000000,0.0000000,270.0000000); //object(elecfence_bar) (32)
  207. CreateObject(987,2719.5000000,-2556.7000000,12.6000000,0.0000000,0.0000000,270.0000000); //object(elecfence_bar) (33)
  208. CreateObject(987,2719.8000000,-2565.8000000,12.6000000,0.0000000,0.0000000,0.0000000); //object(elecfence_bar) (34)
  209. CreateObject(987,2731.8000000,-2565.8000000,12.6000000,0.0000000,0.0000000,0.0000000); //object(elecfence_bar) (35)
  210. CreateObject(987,2742.2000000,-2565.8000000,12.6000000,0.0000000,0.0000000,0.0000000); //object(elecfence_bar) (36)
  211. CreateObject(987,2762.8999000,-2565.8000000,12.6000000,0.0000000,0.0000000,0.0000000); //object(elecfence_bar) (37)
  212. CreateObject(987,2774.8000000,-2565.8000000,12.6000000,0.0000000,0.0000000,0.0000000); //object(elecfence_bar) (38)
  213. CreateObject(987,2786.7000000,-2565.8000000,12.6000000,0.0000000,0.0000000,0.0000000); //object(elecfence_bar) (39)
  214. CreateObject(987,2798.7000000,-2565.8000000,12.6000000,0.0000000,0.0000000,0.0000000); //object(elecfence_bar) (40)
  215. CreateObject(11095,2820.8999000,-2435.8999000,11.6000000,0.0000000,0.0000000,271.5000000); //object(stadbridge_sfs) (2)
  216. CreateObject(987,2810.7000000,-2565.8999000,12.6000000,0.0000000,0.0000000,90.0000000); //object(elecfence_bar) (41)
  217. CreateObject(987,2810.7000000,-2553.8999000,12.6000000,0.0000000,0.0000000,90.0000000); //object(elecfence_bar) (42)
  218. CreateObject(987,2810.7000000,-2541.8999000,12.6000000,0.0000000,0.0000000,90.0000000); //object(elecfence_bar) (43)
  219. CreateObject(987,2810.7000000,-2529.8999000,12.6000000,0.0000000,0.0000000,90.0000000); //object(elecfence_bar) (44)
  220. CreateObject(987,2810.7000000,-2518.1001000,12.6000000,0.0000000,0.0000000,90.0000000); //object(elecfence_bar) (45)
  221. CreateObject(987,2810.7000000,-2506.1001000,12.6000000,0.0000000,0.0000000,90.0000000); //object(elecfence_bar) (46)
  222. CreateObject(987,2810.7000000,-2494.2000000,12.6000000,0.0000000,0.0000000,90.0000000); //object(elecfence_bar) (47)
  223. CreateObject(987,2810.7000000,-2482.3000000,12.6000000,0.0000000,0.0000000,90.0000000); //object(elecfence_bar) (48)
  224. CreateObject(987,2810.7000000,-2470.3999000,12.6000000,0.0000000,0.0000000,90.0000000); //object(elecfence_bar) (49)
  225. CreateObject(987,2810.7000000,-2458.5000000,12.6000000,0.0000000,0.0000000,90.0000000); //object(elecfence_bar) (50)
  226. CreateObject(987,2810.7000000,-2451.1001000,12.6000000,0.0000000,0.0000000,90.0000000); //object(elecfence_bar) (51)
  227. CreateObject(987,2810.7000000,-2432.7000000,12.6000000,0.0000000,0.0000000,90.0000000); //object(elecfence_bar) (52)
  228. CreateObject(987,2810.7000000,-2420.7000000,12.6000000,0.0000000,0.0000000,90.0000000); //object(elecfence_bar) (53)
  229. CreateObject(987,2810.7000000,-2408.8000000,12.6000000,0.0000000,0.0000000,90.0000000); //object(elecfence_bar) (54)
  230. CreateObject(987,2810.7000000,-2396.8999000,12.6000000,0.0000000,0.0000000,90.0000000); //object(elecfence_bar) (55)
  231. CreateObject(987,2810.7000000,-2385.0000000,12.6000000,0.0000000,0.0000000,90.0000000); //object(elecfence_bar) (56)
  232. CreateObject(987,2810.7000000,-2373.1001000,12.6000000,0.0000000,0.0000000,90.0000000); //object(elecfence_bar) (57)
  233. CreateObject(987,2810.7000000,-2361.2000000,12.6000000,0.0000000,0.0000000,90.0000000); //object(elecfence_bar) (58)
  234. CreateObject(987,2810.7000000,-2349.3000000,12.6000000,0.0000000,0.0000000,90.0000000); //object(elecfence_bar) (59)
  235. CreateObject(987,2810.7000000,-2341.7000000,12.6000000,0.0000000,0.0000000,90.0000000); //object(elecfence_bar) (61)
  236. CreateObject(987,2810.8999000,-2330.0000000,12.6000000,0.0000000,0.0000000,180.5000000); //object(elecfence_bar) (68)
  237. CreateObject(987,2798.8999000,-2330.1001000,12.6000000,0.0000000,0.0000000,180.5000000); //object(elecfence_bar) (69)
  238. CreateObject(987,2786.8999000,-2330.2000000,12.6000000,0.0000000,0.0000000,180.5000000); //object(elecfence_bar) (70)
  239. CreateObject(987,2775.0000000,-2330.3000000,12.6000000,0.0000000,0.0000000,180.5000000); //object(elecfence_bar) (71)
  240. CreateObject(987,2763.0000000,-2330.3999000,12.6000000,0.0000000,0.0000000,180.5000000); //object(elecfence_bar) (72)
  241. CreateObject(987,2751.0000000,-2330.5000000,12.6000000,0.0000000,0.0000000,180.5000000); //object(elecfence_bar) (73)
  242. CreateObject(987,2739.0000000,-2330.6001000,12.6000000,0.0000000,0.0000000,180.5000000); //object(elecfence_bar) (74)
  243. CreateObject(987,2731.3000000,-2330.7000000,12.6000000,0.0000000,0.0000000,180.5000000); //object(elecfence_bar) (75)
  244.  
  245. GATE_INDIA1 = CreateAutomaticGate(971, 2720.1001000,-2405.3999000,16.1000000,0.0000000,0.0000000,270.0000000, 2720.1001000,-2413.8999023438,16.1000000, 0.000000, 0.0000000, 270.000000, 2719.5498,-2405.3574,13.4668, 20.0, 3, true);
  246. GATE_INDIA2 = CreateAutomaticGate(971, 2720.1001000,-2503.8999000,16.1000000,0.0000000,0.0000000,270.0000000, 2720.1001000,-2512.6000976563,16.1000000, 0.000000, 0.000000, 270.000000, 2720.6343,-2503.9419,13.4869, 20.0, 3, true);
  247. GATE_INDIA3 = CreateAutomaticGate(971, 2758.3999000,-2565.8000000,15.9000000,0.0000000,0.0000000,0.0000000, 2767.1999511719,-2565.8000000,15.9000000, 0.000000, 0.0000000, 0.000000, 2758.7979,-2565.1077,13.6328, 20.0, 3, true);
  248.  
  249. /*
  250. Objects converted: 50
  251. Vehicles converted: 28
  252. Vehicle models found: 9
  253. ----------------------
  254. In the time this conversion took to finish light could have travelled around the world 0.07 times!
  255. */
  256.  
  257. return 1;
  258. }
  259.  
  260. public OnGameModeExit()
  261. {
  262. return 1;
  263. }
  264.  
  265. public OnPlayerRequestClass(playerid, classid)
  266. {
  267. TogglePlayerSpectating(playerid, 1);
  268. SpawnPlayerAtTeam(playerid);
  269. return 1;
  270. }
  271.  
  272. public OnPlayerConnect(playerid)
  273. {
  274. new name[MAX_PLAYER_NAME], string[23 + MAX_PLAYER_NAME];
  275. GetPlayerName(playerid, name, sizeof(name));
  276. format(string, sizeof(string), "-| %s has connected to the server |-", name);
  277. SendClientMessageToAll(COLOR_LIME, string);
  278. TogglePlayerSpectating(playerid, true);
  279.  
  280. if(fexist(UserPath(playerid)))
  281. {
  282. INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
  283. ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"Login","Type your password below to login.","Login","Quit");
  284. }
  285. else
  286. {
  287. ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,"Registering...","Type your password below to register a new account.","Register","Quit");
  288. }
  289.  
  290. //ZONES
  291. GangZoneShowForAll(ZONE_BLUEBERRY_FACTORY,0x00800080);
  292. return 1;
  293. }
  294.  
  295. public OnPlayerDisconnect(playerid, reason)
  296. {
  297. new name[MAX_PLAYER_NAME], string[23 + MAX_PLAYER_NAME];
  298. GetPlayerName(playerid, name, sizeof(name));
  299.  
  300. new DisconnectReason[3][] =
  301. {
  302. "Timeout/Crash",
  303. "Quit",
  304. "Kick/Ban"
  305. };
  306.  
  307. format(string, sizeof(string), "-| %s has left the server (%s) |-", name, DisconnectReason[reason]);
  308. SendClientMessageToAll(COLOR_YELLOW, string);
  309.  
  310. new INI:File = INI_Open(UserPath(playerid));
  311. INI_SetTag(File,"data");
  312. INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
  313. INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
  314. INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
  315. INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
  316. INI_WriteInt(File,"VIP",PlayerInfo[playerid][pVIP]);
  317. INI_WriteInt(File,"XP",PlayerInfo[playerid][pXP]);
  318. INI_WriteInt(File,"Score",PlayerInfo[playerid][pLevel]);
  319. INI_WriteInt(File,"Team",PlayerInfo[playerid][pTeam]);
  320. INI_WriteInt(File,"Level",PlayerInfo[playerid][pLevel]);
  321. INI_Close(File);
  322. return 1;
  323. }
  324.  
  325. public OnPlayerSpawn(playerid)
  326. {
  327. TogglePlayerSpectating(playerid, false);
  328. SpawnPlayerAtTeam(playerid);
  329. return 1;
  330. }
  331.  
  332. public OnPlayerDeath(playerid, killerid, reason)
  333. {
  334. SendDeathMessage(killerid, playerid, reason);
  335. PlayerInfo[playerid][pDeaths]++;
  336.  
  337. if(killerid != INVALID_PLAYER_ID)
  338. {
  339. new string1[128];
  340. new string2[128];
  341. new name[24];
  342. new name2[24];
  343. GetPlayerName(playerid, name, sizeof(name));
  344. GetPlayerName(killerid, name, sizeof(name2));
  345. format(string1, sizeof(string1), "You have been killed by %u!", name2);
  346. format(string2, sizeof(string2), "You have killed %u, and received $1000!", name);
  347. SendClientMessage(playerid, COLOR_RED, string1);
  348. SendClientMessage(killerid, COLOR_LIME, string2);
  349. PlayerInfo[killerid][pKills]++;
  350. GivePlayerXP(killerid, 100);
  351. GivePlayerMoney(killerid, 1000);
  352. }
  353. return 1;
  354. }
  355.  
  356. public OnVehicleSpawn(vehicleid)
  357. {
  358. return 1;
  359. }
  360.  
  361. public OnVehicleDeath(vehicleid, killerid)
  362. {
  363. return 1;
  364. }
  365.  
  366. public OnPlayerText(playerid, text[])
  367. {
  368. return 1;
  369. }
  370.  
  371. public OnPlayerCommandText(playerid, cmdtext[])
  372. {
  373. if (strcmp("/mycommand", cmdtext, true, 10) == 0)
  374. {
  375. // Do something here
  376. return 1;
  377. }
  378. return 0;
  379. }
  380.  
  381. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  382. {
  383. return 1;
  384. }
  385.  
  386. public OnPlayerExitVehicle(playerid, vehicleid)
  387. {
  388. return 1;
  389. }
  390.  
  391. public OnPlayerStateChange(playerid, newstate, oldstate)
  392. {
  393. return 1;
  394. }
  395.  
  396. public OnPlayerEnterCheckpoint(playerid)
  397. {
  398. return 1;
  399. }
  400.  
  401. public OnPlayerLeaveCheckpoint(playerid)
  402. {
  403. return 1;
  404. }
  405.  
  406. public OnPlayerEnterRaceCheckpoint(playerid)
  407. {
  408. return 1;
  409. }
  410.  
  411. public OnPlayerLeaveRaceCheckpoint(playerid)
  412. {
  413. return 1;
  414. }
  415.  
  416. public OnRconCommand(cmd[])
  417. {
  418. return 1;
  419. }
  420.  
  421. public OnPlayerRequestSpawn(playerid)
  422. {
  423. return 1;
  424. }
  425.  
  426. public OnObjectMoved(objectid)
  427. {
  428. return 1;
  429. }
  430.  
  431. public OnPlayerObjectMoved(playerid, objectid)
  432. {
  433. return 1;
  434. }
  435.  
  436. public OnPlayerPickUpPickup(playerid, pickupid)
  437. {
  438. return 1;
  439. }
  440.  
  441. public OnVehicleMod(playerid, vehicleid, componentid)
  442. {
  443. return 1;
  444. }
  445.  
  446. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  447. {
  448. return 1;
  449. }
  450.  
  451. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  452. {
  453. return 1;
  454. }
  455.  
  456. public OnPlayerSelectedMenuRow(playerid, row)
  457. {
  458. return 1;
  459. }
  460.  
  461. public OnPlayerExitedMenu(playerid)
  462. {
  463. return 1;
  464. }
  465.  
  466. public OnPlayerEnterDynamicCP(playerid, checkpointid)
  467. {
  468. if(checkpointid == CP[ZONE_BLUEBERRY_FACTORY])
  469. {
  470. if(tCheck[ZONE_BLUEBERRY_FACTORY] == PlayerInfo[playerid][pTeam]) return SendClientMessage(playerid, COLOR_RED,"This zone is already captured by your team");
  471. if(UnderAttack[ZONE_BLUEBERRY_FACTORY] == 1) return SendClientMessage(playerid, COLOR_RED,"This zone is already being taken over!");
  472. if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED,"ERROR: You cannot capture while in vehicle!");
  473. UnderAttack[ZONE_BLUEBERRY_FACTORY] = 1;
  474. timer[playerid][ZONE_BLUEBERRY_FACTORY] = SetTimerEx("SetZone",25000,false,"i", playerid);
  475. GangZoneFlashForAll(Zone[ZONE_BLUEBERRY_FACTORY],COLOR_RED);
  476. SendClientMessageToAll(COLOR_GREEN, "The Blueberry Brewery is being taken over!");
  477. zDefine[playerid] = ZONE_BLUEBERRY_FACTORY;
  478. }
  479. return 1;
  480. }
  481.  
  482. public OnPlayerLeaveDynamicCP(playerid, checkpointid)
  483. {
  484. if(checkpointid == CP[ZONE_BLUEBERRY_FACTORY])
  485. {
  486. UnderAttack[ZONE_BLUEBERRY_FACTORY] = 0;
  487. GangZoneStopFlashForAll(Zone[ZONE_BLUEBERRY_FACTORY]);
  488. KillTimer(timer[playerid][ZONE_BLUEBERRY_FACTORY]);
  489. }
  490. return 1;
  491. }
  492.  
  493. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  494. {
  495. return 1;
  496. }
  497.  
  498. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  499. {
  500. return 1;
  501. }
  502.  
  503. public OnRconLoginAttempt(ip[], password[], success)
  504. {
  505. return 1;
  506. }
  507.  
  508. public OnPlayerUpdate(playerid)
  509. {
  510. return 1;
  511. }
  512.  
  513. public OnPlayerStreamIn(playerid, forplayerid)
  514. {
  515. return 1;
  516. }
  517.  
  518. public OnPlayerStreamOut(playerid, forplayerid)
  519. {
  520. return 1;
  521. }
  522.  
  523. public OnVehicleStreamIn(vehicleid, forplayerid)
  524. {
  525. return 1;
  526. }
  527.  
  528. public OnVehicleStreamOut(vehicleid, forplayerid)
  529. {
  530. return 1;
  531. }
  532.  
  533. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  534. {
  535. switch( dialogid )
  536. {
  537. case DIALOG_REGISTER:
  538. {
  539. if (!response) return Kick(playerid);
  540. if(response)
  541. {
  542. if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Registering...","You have entered an invalid password.\nType your password below to register a new account.","Register","Quit");
  543. new INI:File = INI_Open(UserPath(playerid));
  544. INI_SetTag(File,"data");
  545. INI_WriteInt(File,"Password",udb_hash(inputtext));
  546. INI_WriteInt(File,"Cash",0);
  547. INI_WriteInt(File,"Admin",0);
  548. INI_WriteInt(File,"Kills",0);
  549. INI_WriteInt(File,"Deaths",0);
  550. INI_WriteInt(File,"VIP",0);
  551. INI_WriteInt(File,"XP",0);
  552. INI_WriteInt(File,"Level",0);
  553. INI_Close(File);
  554.  
  555. SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0);
  556. SpawnPlayer(playerid);
  557. ShowPlayerDialog(playerid, DIALOG_TEAM_SELECTION,DIALOG_STYLE_LIST,"You have registered, please select your team.",""COLOR_USA_EMBED"United States\n"COLOR_CANADA_EMBED"Canada\n"COLOR_BRITAIN_EMBED"Britain\n"COLOR_AUSTRALIA_EMBED"Australia\n"COLOR_RUSSIA_EMBED"Russia\n"COLOR_CHINA_EMBED"China\n"COLOR_GERMANY_EMBED"Germany\n"COLOR_ITALY_EMBED"Italy\n"COLOR_INDIA_EMBED"India\n"COLOR_FRANCE_EMBED"France","Select","");
  558. }
  559. }
  560.  
  561. case DIALOG_LOGIN:
  562. {
  563. if ( !response ) return Kick ( playerid );
  564. if( response )
  565. {
  566. if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
  567. {
  568. INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
  569. GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
  570. SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);
  571. ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,"Success!","You have successfully logged in!","Ok","");
  572. SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0);
  573. TogglePlayerSpectating(playerid, 0);
  574. SpawnPlayer(playerid);
  575. SpawnPlayerAtTeam(playerid);
  576. }
  577. else
  578. {
  579. ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"Login","You have entered an incorrect password.\nType your password below to login.","Login","Quit");
  580. }
  581. return 1;
  582. }
  583. }
  584. }
  585.  
  586. if(dialogid == DIALOG_TEAM_SELECTION)
  587. {
  588. if(response)
  589. {
  590. switch(listitem)
  591. {
  592. case 0: TogglePlayerSpectating(playerid, 0), AltSetPlayerTeam(playerid, TEAM_USA);
  593. case 1: TogglePlayerSpectating(playerid, 0), AltSetPlayerTeam(playerid, TEAM_CANADA);
  594. case 2: TogglePlayerSpectating(playerid, 0), AltSetPlayerTeam(playerid, TEAM_BRITAIN);
  595. case 3: TogglePlayerSpectating(playerid, 0), AltSetPlayerTeam(playerid, TEAM_AUSTRALIA);
  596. case 4: TogglePlayerSpectating(playerid, 0), AltSetPlayerTeam(playerid, TEAM_RUSSIA);
  597. case 5: TogglePlayerSpectating(playerid, 0), AltSetPlayerTeam(playerid, TEAM_GERMANY);
  598. case 6: TogglePlayerSpectating(playerid, 0), AltSetPlayerTeam(playerid, TEAM_ITALY);
  599. case 7: TogglePlayerSpectating(playerid, 0), AltSetPlayerTeam(playerid, TEAM_FRANCE);
  600. case 8: TogglePlayerSpectating(playerid, 0), AltSetPlayerTeam(playerid, TEAM_CHINA);
  601. case 9: TogglePlayerSpectating(playerid, 0), AltSetPlayerTeam(playerid, TEAM_INDIA);
  602. }
  603. }
  604. return 1;
  605. }
  606.  
  607. if(dialogid == DIALOG_SELECT_WEAPONS_CATEGORY)
  608. {
  609. if(response)
  610. {
  611. switch(listitem)
  612. {
  613. case 0: ShowPlayerDialog(playerid,DIALOG_ADM_WEAPONS_MELEE,DIALOG_STYLE_LIST,"Select Melee Weapon","Brass Knuckles\nGolf Club\nNightstick\nKnife\nBat\nShovel\nPoolstick\nKatana\nChainsaw\nDildo\nDildo 2\nVibrator\nVibrator 2\nFlowers\nCane\nSpray Can\nFire Extinguisher\nGo Back","Select","Cancel");
  614. case 1: ShowPlayerDialog(playerid,DIALOG_ADM_WEAPONS_THROWN,DIALOG_STYLE_LIST,"Select Thrown Weapon","Grenade\nTear Gas\nMolotov Cocktail\nGo Back","Select","Cancel");
  615. case 2: ShowPlayerDialog(playerid,DIALOG_ADM_WEAPONS_PISTOLS,DIALOG_STYLE_LIST,"Select Pistol","9mm\nSilenced 9mm\nDesert Eagle\nGo Back","Select","Cancel");
  616. case 3: ShowPlayerDialog(playerid,DIALOG_ADM_WEAPONS_SHOTGUNS,DIALOG_STYLE_LIST,"Select Shotgun","Shotgun\nSawnoff Shotgun\nCombat Shotgun\nGo Back","Select","Cancel");
  617. case 4: ShowPlayerDialog(playerid,DIALOG_ADM_WEAPONS_SMGS,DIALOG_STYLE_LIST,"Select SMG","Micro SMG/Uzi\nMP5\nTec-9\nGo Back","Select","Cancel");
  618. case 5: ShowPlayerDialog(playerid,DIALOG_ADM_WEAPONS_ASSAULT_RIFLES,DIALOG_STYLE_LIST,"Select Assault Rifle","AK-47\nM4\nGo Back","Select","Cancel");
  619. case 6: ShowPlayerDialog(playerid,DIALOG_ADM_WEAPONS_RIFLES,DIALOG_STYLE_LIST,"Select Rifle","Country Rifle\nSniper Rifle\nGo Back","Select","Cancel");
  620. case 7: ShowPlayerDialog(playerid,DIALOG_ADM_WEAPONS_HEAVY,DIALOG_STYLE_LIST,"Select Heavy","RPG\nHS Rocket\nFlamethrower\nMinigun\nGo Back","Select","Cancel");
  621. }
  622. }
  623. return 1;
  624. }
  625.  
  626. if(dialogid == DIALOG_ADM_WEAPONS_MELEE)
  627. {
  628. if(response)
  629. {
  630. switch(listitem)
  631. {
  632. case 0: GivePlayerWeapon(playerid,1,9999999);
  633. case 1: GivePlayerWeapon(playerid,2,9999999);
  634. case 2: GivePlayerWeapon(playerid,3,9999999);
  635. case 3: GivePlayerWeapon(playerid,4,9999999);
  636. case 4: GivePlayerWeapon(playerid,5,9999999);
  637. case 5: GivePlayerWeapon(playerid,6,9999999);
  638. case 6: GivePlayerWeapon(playerid,7,9999999);
  639. case 7: GivePlayerWeapon(playerid,8,9999999);
  640. case 8: GivePlayerWeapon(playerid,8,9999999);
  641. case 9: GivePlayerWeapon(playerid,9,9999999);
  642. case 10: GivePlayerWeapon(playerid,10,9999999);
  643. case 11: GivePlayerWeapon(playerid,11,9999999);
  644. case 12: GivePlayerWeapon(playerid,12,9999999);
  645. case 13: GivePlayerWeapon(playerid,13,9999999);
  646. case 14: GivePlayerWeapon(playerid,14,9999999);
  647. case 15: GivePlayerWeapon(playerid,15,9999999);
  648. case 16: GivePlayerWeapon(playerid,41,9999999);
  649. case 17: GivePlayerWeapon(playerid,42,9999999);
  650. case 18: ShowPlayerDialog(playerid,DIALOG_SELECT_WEAPONS_CATEGORY,DIALOG_STYLE_LIST,"Select Weapon Category","Melee\nThrown\nPistols\nShotguns\nSMGs\nAssault Rifles\nRifles\nHeavy","Select","Cancel");
  651. }
  652. }
  653. return 1;
  654. }
  655.  
  656. if(dialogid == DIALOG_ADM_WEAPONS_THROWN)
  657. {
  658. if(response)
  659. {
  660. switch(listitem)
  661. {
  662. case 0: GivePlayerWeapon(playerid,16,9999999);
  663. case 1: GivePlayerWeapon(playerid,17,9999999);
  664. case 2: GivePlayerWeapon(playerid,18,9999999);
  665. case 3: ShowPlayerDialog(playerid,DIALOG_SELECT_WEAPONS_CATEGORY,DIALOG_STYLE_LIST,"Select Weapon Category","Melee\nThrown\nPistols\nShotguns\nSMGs\nAssault Rifles\nRifles\nHeavy","Select","Cancel");
  666. }
  667. }
  668. return 1;
  669. }
  670.  
  671. if(dialogid == DIALOG_ADM_WEAPONS_PISTOLS)
  672. {
  673. if(response)
  674. {
  675. switch(listitem)
  676. {
  677. case 0: GivePlayerWeapon(playerid,22,9999999);
  678. case 1: GivePlayerWeapon(playerid,23,9999999);
  679. case 2: GivePlayerWeapon(playerid,24,9999999);
  680. case 3: ShowPlayerDialog(playerid,DIALOG_SELECT_WEAPONS_CATEGORY,DIALOG_STYLE_LIST,"Select Weapon Category","Melee\nThrown\nPistols\nShotguns\nSMGs\nAssault Rifles\nRifles\nHeavy","Select","Cancel");
  681. }
  682. }
  683. return 1;
  684. }
  685.  
  686. if(dialogid == DIALOG_ADM_WEAPONS_SHOTGUNS)
  687. {
  688. if(response)
  689. {
  690. switch(listitem)
  691. {
  692. case 0: GivePlayerWeapon(playerid,25,9999999);
  693. case 1: GivePlayerWeapon(playerid,26,9999999);
  694. case 2: GivePlayerWeapon(playerid,27,9999999);
  695. case 3: ShowPlayerDialog(playerid,DIALOG_SELECT_WEAPONS_CATEGORY,DIALOG_STYLE_LIST,"Select Weapon Category","Melee\nThrown\nPistols\nShotguns\nSMGs\nAssault Rifles\nRifles\nHeavy","Select","Cancel");
  696. }
  697. }
  698. return 1;
  699. }
  700.  
  701. if(dialogid == DIALOG_ADM_WEAPONS_SMGS)
  702. {
  703. if(response)
  704. {
  705. switch(listitem)
  706. {
  707. case 0: GivePlayerWeapon(playerid,28,9999999);
  708. case 1: GivePlayerWeapon(playerid,29,9999999);
  709. case 2: GivePlayerWeapon(playerid,32,9999999);
  710. case 3: ShowPlayerDialog(playerid,DIALOG_SELECT_WEAPONS_CATEGORY,DIALOG_STYLE_LIST,"Select Weapon Category","Melee\nThrown\nPistols\nShotguns\nSMGs\nAssault Rifles\nRifles\nHeavy","Select","Cancel");
  711. }
  712. }
  713. return 1;
  714. }
  715.  
  716. if(dialogid == DIALOG_ADM_WEAPONS_ASSAULT_RIFLES)
  717. {
  718. if(response)
  719. {
  720. switch(listitem)
  721. {
  722. case 0: GivePlayerWeapon(playerid,30,9999999);
  723. case 1: GivePlayerWeapon(playerid,31,9999999);
  724. case 2: ShowPlayerDialog(playerid,DIALOG_SELECT_WEAPONS_CATEGORY,DIALOG_STYLE_LIST,"Select Weapon Category","Melee\nThrown\nPistols\nShotguns\nSMGs\nAssault Rifles\nRifles\nHeavy","Select","Cancel");
  725. }
  726. }
  727. return 1;
  728. }
  729.  
  730. if(dialogid == DIALOG_ADM_WEAPONS_RIFLES)
  731. {
  732. if(response)
  733. {
  734. switch(listitem)
  735. {
  736. case 0: GivePlayerWeapon(playerid,33,9999999);
  737. case 1: GivePlayerWeapon(playerid,34,9999999);
  738. case 2: ShowPlayerDialog(playerid,DIALOG_SELECT_WEAPONS_CATEGORY,DIALOG_STYLE_LIST,"Select Weapon Category","Melee\nThrown\nPistols\nShotguns\nSMGs\nAssault Rifles\nRifles\nHeavy","Select","Cancel");
  739. }
  740. }
  741. return 1;
  742. }
  743.  
  744. if(dialogid == DIALOG_ADM_WEAPONS_HEAVY)
  745. {
  746. if(response)
  747. {
  748. switch(listitem)
  749. {
  750. case 0: GivePlayerWeapon(playerid,35,9999999);
  751. case 1: GivePlayerWeapon(playerid,36,9999999);
  752. case 2: GivePlayerWeapon(playerid,37,9999999);
  753. case 3: GivePlayerWeapon(playerid,38,9999999);
  754. case 4: ShowPlayerDialog(playerid,DIALOG_SELECT_WEAPONS_CATEGORY,DIALOG_STYLE_LIST,"Select Weapon Category","Melee\nThrown\nPistols\nShotguns\nSMGs\nAssault Rifles\nRifles\nHeavy","Select","Cancel");
  755. }
  756. }
  757. return 1;
  758. }
  759. return 0;
  760. }
  761.  
  762. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  763. {
  764. return 1;
  765. }
  766.  
  767. public OnPlayerRequestGate(playerid, gateid)
  768. {
  769. //return 0 means cannot pass, return 1 means can
  770. if((gateid == GATE_ADMIN_HOUSE1) && (PlayerInfo[playerid][pAdmin] < 1)) return 0;
  771. if((gateid == GATE_ADMIN_HOUSE2) && (PlayerInfo[playerid][pAdmin] < 1)) return 0;
  772.  
  773. if((gateid == GATE_INDIA1) && (PlayerInfo[playerid][pTeam] != TEAM_INDIA)) return 0;
  774. if((gateid == GATE_INDIA2) && (PlayerInfo[playerid][pTeam] != TEAM_INDIA)) return 0;
  775. if((gateid == GATE_INDIA3) && (PlayerInfo[playerid][pTeam] != TEAM_INDIA)) return 0;
  776. return 1;
  777. }
  778.  
  779. public OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ)
  780. {
  781. SetPlayerPosFindZ(playerid, fX, fY, fZ);
  782. return 1;
  783. }
  784.  
  785. /*////////////////////////////////////
  786. COMMANDS
  787. *//////////////////////////////////////
  788. CMD:changeteam(playerid, params[])
  789. {
  790. ShowPlayerDialog(playerid, DIALOG_TEAM_SELECTION,DIALOG_STYLE_LIST,"Please select your team.",""COLOR_USA_EMBED"United States\n"COLOR_CANADA_EMBED"Canada\n"COLOR_BRITAIN_EMBED"Britain\n"COLOR_AUSTRALIA_EMBED"Australia\n"COLOR_RUSSIA_EMBED"Russia\n"COLOR_CHINA_EMBED"China\n"COLOR_GERMANY_EMBED"Germany\n"COLOR_ITALY_EMBED"Italy\n"COLOR_INDIA_EMBED"India\n"COLOR_FRANCE_EMBED"France","Select","");
  791. return 1;
  792. }
  793.  
  794. CMD:setadmin(playerid, params[])
  795. {
  796. if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 4)
  797. {
  798. new log[128];
  799. new id;
  800. new asetlevel;
  801. new name[24];
  802. GetPlayerName(playerid, name, sizeof(name));
  803. if(sscanf(params, "ud", id, asetlevel)) SendClientMessage(playerid, COLOR_RED, "USAGE: /setadmin [playerid] [level]");
  804. else if(id == INVALID_PLAYER_ID) SendClientMessage(playerid, COLOR_RED, "ERROR: Player not found.");
  805. else if((PlayerInfo[id][pAdmin] >= PlayerInfo[playerid][pAdmin]) && !IsPlayerAdmin(playerid)) SendClientMessage(playerid, COLOR_RED, "ERROR: You cannot use this command on admins that are of equal or higher rank than you.");
  806. else if((playerid == id) && !IsPlayerAdmin(playerid)) SendClientMessage(playerid, COLOR_RED, "ERROR: You cannot use this command on yourself.");
  807. else
  808. {
  809. new name2[24];
  810. new string1[128];
  811. new string2[128];
  812. GetPlayerName(id, name2, sizeof(name2));
  813. PlayerInfo[id][pAdmin] = asetlevel;
  814. format(string1, sizeof(string1), "-| You have set %s's admin level to %d |-", name2, asetlevel);
  815. format(string2, sizeof(string2), "-| Your admin level has been set to %d by %s |-", asetlevel, name);
  816. SendClientMessage(playerid, COLOR_GREEN, string1);
  817. SendClientMessage(id, COLOR_GREEN, string2);
  818. format(log, sizeof(log), "[ADMIN LOG] %s(%i) used /setadmin on %s(%i), setting their admin level to %i", name, playerid, name2, id, asetlevel);
  819. SendAdminMessage(COLOR_GREEN, log);
  820. }
  821. }
  822. else
  823. {
  824. SendClientMessage(playerid, COLOR_RED, "ERROR: You must have admin level 4 or higher to use this command.");
  825. }
  826. return 1;
  827. }
  828.  
  829. CMD:adminhouse(playerid, params[])
  830. {
  831. new log[128];
  832. new name[24];
  833. GetPlayerName(playerid, name, sizeof(name));
  834. if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 1)
  835. {
  836. SetPlayerPos(playerid, 1498.8534,-703.7729,94.7439);
  837. SetPlayerFacingAngle(playerid, 7.6887);
  838. SetCameraBehindPlayer(playerid);
  839. format(log, sizeof(log), "[ADMIN LOG] %s(%i) teleported to the admin house", name, playerid);
  840. SendAdminMessage(COLOR_GREEN, log);
  841. }
  842. else
  843. {
  844. SendClientMessage(playerid, COLOR_RED, "ERROR: You must be an admin to use this command.");
  845. }
  846. return 1;
  847. }
  848. CMD:closeadmingate(playerid, params[])
  849. {
  850. if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 1)
  851. {
  852. CloseGate(GATE_ADMIN_HOUSE1);
  853. CloseGate(GATE_ADMIN_HOUSE2);
  854. }
  855. else
  856. {
  857. SendClientMessage(playerid, COLOR_RED, "ERROR: You must be an admin to use this command.");
  858. }
  859. return 1;
  860. }
  861. CMD:openadmingate(playerid, params[])
  862. {
  863. if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 1)
  864. {
  865. OpenGate(GATE_ADMIN_HOUSE1);
  866. OpenGate(GATE_ADMIN_HOUSE2);
  867. }
  868. else
  869. {
  870. SendClientMessage(playerid, COLOR_RED, "ERROR: You must be an admin to use this command.");
  871. }
  872. return 1;
  873. }
  874.  
  875. CMD:stats(playerid, params[])
  876. {
  877. new name[24], string1[128], string2[128], string3[128], year, month, day;
  878. GetPlayerName(playerid, name, sizeof(name));
  879. getdate(year,month,day);
  880. new team[24];
  881. team = GetPlayerTeamName(playerid);
  882. SendClientMessage(playerid, COLOR_YELLOW, "-| Stats |-");
  883. format(string1, sizeof(string1), "Name: %s | Team: %s", name, team);
  884. format(string2, sizeof(string2), "Level: %d (%s) | XP: %d | Cash: $%i | Kills: %d | Deaths: %d", PlayerInfo[playerid][pLevel], GetPlayerLevelName(playerid), PlayerInfo[playerid][pXP], GetPlayerMoney(playerid), PlayerInfo[playerid][pKills], PlayerInfo[playerid][pDeaths]);
  885. format(string3, sizeof(string3), "VIP Level: %d | Admin Level: %d", PlayerInfo[playerid][pVIP], PlayerInfo[playerid][pAdmin]);
  886. SendClientMessage(playerid, COLOR_YELLOW, string1);
  887. SendClientMessage(playerid, COLOR_YELLOW, string2);
  888. SendClientMessage(playerid, COLOR_YELLOW, string3);
  889. return 1;
  890. }
  891.  
  892. CMD:kill(playerid, params[])
  893. {
  894. SetPlayerHealth(playerid, 0);
  895. SendClientMessage(playerid, COLOR_RED, "You have killed yourself!");
  896. return 1;
  897. }
  898.  
  899. CMD:setcash(playerid, params[])
  900. {
  901. if(PlayerInfo[playerid][pAdmin] >= 2)
  902. {
  903. new id;
  904. new cash;
  905. new name[24];
  906. GetPlayerName(playerid, name, sizeof(name));
  907. if(sscanf(params, "ud", id, cash)) SendClientMessage(playerid, COLOR_RED, "USAGE: /setcash [playerid] [amount]");
  908. else if(id == INVALID_PLAYER_ID) SendClientMessage(playerid, COLOR_RED, "ERROR: Player not found.");
  909. else
  910. {
  911. new name2[24];
  912. new string1[128];
  913. new string2[128];
  914. new log[128];
  915. GetPlayerName(id, name2, sizeof(name2));
  916. ResetPlayerMoney(id);
  917. GivePlayerMoney(id, cash);
  918. format(string1, sizeof(string1), "-| You have set %s's cash to $%d |-", name2, cash);
  919. format(string2, sizeof(string2), "-| Your cash has been set to $%d by %s |-", cash, name);
  920. SendClientMessage(playerid, COLOR_GREEN, string1);
  921. SendClientMessage(id, COLOR_YELLOW, string2);
  922. format(log, sizeof(log), "[ADMIN LOG] %s(%i) used /setcash on %s(%i), setting their cash to $%i", name, playerid, name2, id, cash);
  923. SendAdminMessage(COLOR_GREEN, log);
  924. }
  925. }
  926. else
  927. {
  928. SendClientMessage(playerid, COLOR_RED, "ERROR: You must have admin level 2 or higher to use this command.");
  929. }
  930. return 1;
  931. }
  932.  
  933. CMD:givecash(playerid, params[])
  934. {
  935. if(PlayerInfo[playerid][pAdmin] >= 2)
  936. {
  937. new id;
  938. new cash;
  939. new name[24];
  940. GetPlayerName(playerid, name, sizeof(name));
  941. if(sscanf(params, "ud", id, cash)) SendClientMessage(playerid, COLOR_RED, "USAGE: /givecash [playerid] [amount]");
  942. else if(id == INVALID_PLAYER_ID) SendClientMessage(playerid, COLOR_RED, "ERROR: Player not found.");
  943. else
  944. {
  945. new name2[24];
  946. new string1[128];
  947. new string2[128];
  948. new log[64];
  949. GetPlayerName(id, name2, sizeof(name2));
  950. GivePlayerMoney(id, cash);
  951. format(string1, sizeof(string1), "-| You have given %s $%d |-", name2, cash);
  952. format(string2, sizeof(string2), "-| You have been given $%d by %s |-", cash, name);
  953. SendClientMessage(playerid, COLOR_GREEN, string1);
  954. SendClientMessage(id, COLOR_GREEN, string2);
  955. format(log, sizeof(log), "[ADMIN LOG] %s(%i) used /givecash on %s(%i), giving them $%i", name, playerid, name2, id, cash);
  956. SendAdminMessage(COLOR_GREEN, log);
  957. }
  958. }
  959. else
  960. {
  961. SendClientMessage(playerid, COLOR_RED, "ERROR: You must be admin level 2 or higher to use this command.");
  962. }
  963. return 1;
  964. }
  965.  
  966. CMD:pm(playerid, params[])
  967. {
  968. new id;
  969. new message[256];
  970. new name[24];
  971. GetPlayerName(playerid, name, sizeof(name));
  972. if(sscanf(params, "us", id, message)) SendClientMessage(playerid, COLOR_RED, "USAGE: /pm [playerid] [message]");
  973. else if(id == INVALID_PLAYER_ID) SendClientMessage(playerid, COLOR_RED, "ERROR: Player not found.");
  974. else
  975. {
  976. new name2[24];
  977. new string1[128];
  978. new string2[128];
  979. GetPlayerName(id, name2, sizeof(name2));
  980. format(string1, sizeof(string1), "PM from %s: %s", name, message);
  981. format(string2, sizeof(string2), "PM to %s: %s", name2, message);
  982. SendClientMessage(playerid, COLOR_GREEN, string1);
  983. SendClientMessage(id, COLOR_YELLOW, string2);
  984. }
  985. return 1;
  986. }
  987.  
  988. CMD:a(playerid, params[])
  989. {
  990. if(PlayerInfo[playerid][pAdmin] >= 1)
  991. {
  992. new message[256];
  993. new name[24];
  994. GetPlayerName(playerid, name, sizeof(name));
  995. if(sscanf(params, "s[256]", message)) SendClientMessage(playerid, COLOR_RED, "USAGE: /a [message]");
  996. else
  997. {
  998. format(message, sizeof(message), "[ADMIN CHAT] %s(%i): %s", name, playerid, message);
  999. SendAdminMessage(COLOR_GREEN, message);
  1000. }
  1001. }
  1002. else
  1003. {
  1004. SendClientMessage(playerid, COLOR_RED, "ERROR: You must be admin level 2 or higher to use this command.");
  1005. }
  1006. return 1;
  1007. }
  1008.  
  1009. CMD:t(playerid, params[])
  1010. {
  1011. new message[256];
  1012. new name[24];
  1013. new team;
  1014. GetPlayerName(playerid, name, sizeof(name));
  1015. team = GetPlayerTeam(playerid);
  1016. if(sscanf(params, "s[256]", message)) SendClientMessage(playerid, COLOR_RED, "USAGE: /t [message]");
  1017. else
  1018. {
  1019. format(message, sizeof(message), "[TEAM CHAT] %s(%i): %s", name, playerid, message);
  1020. SendTeamMessage(team, message);
  1021. }
  1022. return 1;
  1023. }
  1024.  
  1025. CMD:teleport(playerid, params[])
  1026. {
  1027. if(PlayerInfo[playerid][pAdmin] >= 1)
  1028. {
  1029. new id;
  1030. new name[24];
  1031. if(sscanf(params, "u", id)) SendClientMessage(playerid, COLOR_RED, "USAGE: /teleport [playerid]");
  1032. else if(id == INVALID_PLAYER_ID) SendClientMessage(playerid, COLOR_RED, "ERROR: Player not found.");
  1033. else
  1034. {
  1035. new interior;
  1036. new Float:x, Float:y, Float:z, Float:angle;
  1037. GetPlayerName(playerid, name, sizeof(name));
  1038. GetPlayerPos(id, x, y, z);
  1039. GetPlayerFacingAngle(id, angle);
  1040. interior = GetPlayerInterior(id);
  1041. SetPlayerInterior(playerid, interior);
  1042. SetPlayerPos(playerid, x, y, z);
  1043. SetPlayerFacingAngle(playerid, angle);
  1044. SetCameraBehindPlayer(playerid);
  1045. new name2[24];
  1046. new string1[128];
  1047. new log[64];
  1048. GetPlayerName(id, name2, sizeof(name2));
  1049. format(string1, sizeof(string1), "-| You have teleported to %s |-", name2);
  1050. SendClientMessage(playerid, COLOR_GREEN, string1);
  1051. format(log, sizeof(log), "[ADMIN LOG] %s(%i) used /tp and teleported to %s(%i)", name, playerid, name2, id);
  1052. SendAdminMessage(COLOR_GREEN, log);
  1053. }
  1054. }
  1055. else
  1056. {
  1057. SendClientMessage(playerid, COLOR_RED, "ERROR: You must be admin to use this command.");
  1058. }
  1059. return 1;
  1060. }
  1061.  
  1062. CMD:tp(playerid, params[])
  1063. {
  1064. return cmd_teleport(playerid, params);
  1065. }
  1066.  
  1067. CMD:admingetweapon(playerid, params[])
  1068. {
  1069. if(PlayerInfo[playerid][pAdmin] >= 1)
  1070. {
  1071. new logname[24];
  1072. new string[128];
  1073. GetPlayerName(playerid, logname, sizeof(logname));
  1074. ShowPlayerDialog(playerid,DIALOG_SELECT_WEAPONS_CATEGORY,DIALOG_STYLE_LIST,"Select Weapon Category","Melee\nThrown\nPistols\nShotguns\nSMGs\nAssault Rifles\nRifles\nHeavy","Select","Cancel");
  1075. format(string, sizeof(string), "[ADMIN LOGS] %s(%i) used /admingetweapon", logname, playerid);
  1076. SendAdminMessage(COLOR_GREEN, string);
  1077. }
  1078. else SendClientMessage(playerid, COLOR_RED, "ERROR: You must be an admin to use this command.");
  1079. return 1;
  1080. }
  1081. /*////////////////////////////////////////////////////
  1082. YEET DAB
  1083. *////////////////////////////////////////////////////
  1084. forward LoadUser_data(playerid,name[],value[]);
  1085. public LoadUser_data(playerid,name[],value[])
  1086. {
  1087. INI_Int("Password",PlayerInfo[playerid][pPass]);
  1088. INI_Int("Cash",PlayerInfo[playerid][pCash]);
  1089. INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
  1090. INI_Int("Kills",PlayerInfo[playerid][pKills]);
  1091. INI_Int("Deaths",PlayerInfo[playerid][pDeaths]);
  1092. INI_Int("VIP",PlayerInfo[playerid][pVIP]);
  1093. INI_Int("XP",PlayerInfo[playerid][pXP]);
  1094. INI_Int("Level",PlayerInfo[playerid][pLevel]);
  1095. INI_String("Level Name", PlayerInfo[playerid][pLevelName], 64);
  1096. INI_Int("Team",PlayerInfo[playerid][pTeam]);
  1097. return 1;
  1098. }
  1099.  
  1100. stock UserPath(playerid)
  1101. {
  1102. new string[128],playername[MAX_PLAYER_NAME];
  1103. GetPlayerName(playerid,playername,sizeof(playername));
  1104. format(string,sizeof(string),PATH,playername);
  1105. return string;
  1106. }
  1107.  
  1108. /*Credits to Dracoblue*/
  1109. stock udb_hash(buf[]) {
  1110. new length=strlen(buf);
  1111. new s1 = 1;
  1112. new s2 = 0;
  1113. new n;
  1114. for (n=0; n<length; n++)
  1115. {
  1116. s1 = (s1 + buf[n]) % 65521;
  1117. s2 = (s2 + s1) % 65521;
  1118. }
  1119. return (s2 << 16) + s1;
  1120. }
  1121.  
  1122. stock PlayerLevelUp(playerid)
  1123. {
  1124. PlayerInfo[playerid][pLevel]++;
  1125. }
  1126.  
  1127. stock GivePlayerXP(playerid, xpamount)
  1128. {
  1129. PlayerInfo[playerid][pXP] += xpamount;
  1130. LevelUpCheck(playerid);
  1131. }
  1132.  
  1133. /*//////////////////////////////////////////////////
  1134. LEVELS
  1135. *//////////////////////////////////////////////////
  1136.  
  1137. stock GetPlayerLevel(playerid)
  1138. {
  1139. if(PlayerInfo[playerid][pLevel] == 1) return 1;
  1140. if(PlayerInfo[playerid][pLevel] == 2) return 2;
  1141. if(PlayerInfo[playerid][pLevel] == 3) return 3;
  1142. if(PlayerInfo[playerid][pLevel] == 4) return 4;
  1143. if(PlayerInfo[playerid][pLevel] == 5) return 5;
  1144. if(PlayerInfo[playerid][pLevel] == 6) return 6;
  1145. if(PlayerInfo[playerid][pLevel] == 7) return 7;
  1146. if(PlayerInfo[playerid][pLevel] == 8) return 8;
  1147. if(PlayerInfo[playerid][pLevel] == 9) return 9;
  1148. if(PlayerInfo[playerid][pLevel] == 10) return 10;
  1149. if(PlayerInfo[playerid][pLevel] == 11) return 11;
  1150. if(PlayerInfo[playerid][pLevel] == 12) return 12;
  1151. if(PlayerInfo[playerid][pLevel] == 13) return 13;
  1152. if(PlayerInfo[playerid][pLevel] == 14) return 14;
  1153. if(PlayerInfo[playerid][pLevel] == 15) return 15;
  1154. if(PlayerInfo[playerid][pLevel] == 16) return 16;
  1155. if(PlayerInfo[playerid][pLevel] == 17) return 17;
  1156. if(PlayerInfo[playerid][pLevel] == 18) return 18;
  1157. if(PlayerInfo[playerid][pLevel] == 19) return 19;
  1158. if(PlayerInfo[playerid][pLevel] == 20) return 20;
  1159. if(PlayerInfo[playerid][pLevel] == 21) return 21;
  1160. if(PlayerInfo[playerid][pLevel] == 22) return 22;
  1161. if(PlayerInfo[playerid][pLevel] == 23) return 23;
  1162. if(PlayerInfo[playerid][pLevel] == 24) return 24;
  1163. if(PlayerInfo[playerid][pLevel] == 25) return 25;
  1164. if(PlayerInfo[playerid][pLevel] == 26) return 26;
  1165. if(PlayerInfo[playerid][pLevel] == 27) return 27;
  1166. if(PlayerInfo[playerid][pLevel] == 28) return 28;
  1167. if(PlayerInfo[playerid][pLevel] == 29) return 29;
  1168. if(PlayerInfo[playerid][pLevel] == 30) return 30;
  1169. }
  1170.  
  1171. stock LevelUpCheck(playerid)
  1172. {
  1173. if(PlayerInfo[playerid][pXP] == 100) PlayerLevelUp(playerid); //To level 2
  1174. if(PlayerInfo[playerid][pXP] == 250) PlayerLevelUp(playerid); //To level 3
  1175. if(PlayerInfo[playerid][pXP] == 500) PlayerLevelUp(playerid); //To level 4
  1176. if(PlayerInfo[playerid][pXP] == 750) PlayerLevelUp(playerid); //To level 5
  1177. if(PlayerInfo[playerid][pXP] == 1000) PlayerLevelUp(playerid); //To level 6
  1178. if(PlayerInfo[playerid][pXP] == 1250) PlayerLevelUp(playerid); //To level 7
  1179. if(PlayerInfo[playerid][pXP] == 1500) PlayerLevelUp(playerid); //To level 8
  1180. if(PlayerInfo[playerid][pXP] == 1750) PlayerLevelUp(playerid); //To level 9
  1181. if(PlayerInfo[playerid][pXP] == 2000) PlayerLevelUp(playerid); //To level 10
  1182. if(PlayerInfo[playerid][pXP] == 2500) PlayerLevelUp(playerid); //To level 11
  1183. if(PlayerInfo[playerid][pXP] == 3000) PlayerLevelUp(playerid); //To level 12
  1184. if(PlayerInfo[playerid][pXP] == 3500) PlayerLevelUp(playerid); //To level 13
  1185. if(PlayerInfo[playerid][pXP] == 4000) PlayerLevelUp(playerid); //To level 14
  1186. if(PlayerInfo[playerid][pXP] == 4500) PlayerLevelUp(playerid); //To level 15
  1187. if(PlayerInfo[playerid][pXP] == 5000) PlayerLevelUp(playerid); //To level 16
  1188. if(PlayerInfo[playerid][pXP] == 5500) PlayerLevelUp(playerid); //To level 17
  1189. if(PlayerInfo[playerid][pXP] == 6000) PlayerLevelUp(playerid); //To Level 18
  1190. if(PlayerInfo[playerid][pXP] == 6500) PlayerLevelUp(playerid); //To level 19
  1191. if(PlayerInfo[playerid][pXP] == 7000) PlayerLevelUp(playerid); //To Level 20
  1192. if(PlayerInfo[playerid][pXP] == 7500) PlayerLevelUp(playerid); //To Level 21
  1193. if(PlayerInfo[playerid][pXP] == 8000) PlayerLevelUp(playerid); //To Level 22
  1194. if(PlayerInfo[playerid][pXP] == 8500) PlayerLevelUp(playerid); //To Level 23
  1195. if(PlayerInfo[playerid][pXP] == 9000) PlayerLevelUp(playerid); //To level 24
  1196. if(PlayerInfo[playerid][pXP] == 10000) PlayerLevelUp(playerid); //To level 25
  1197. if(PlayerInfo[playerid][pXP] == 11000) PlayerLevelUp(playerid); //To level 26
  1198. if(PlayerInfo[playerid][pXP] == 12000) PlayerLevelUp(playerid); //To level 27
  1199. if(PlayerInfo[playerid][pXP] == 13000) PlayerLevelUp(playerid); //To level 28
  1200. if(PlayerInfo[playerid][pXP] == 14000) PlayerLevelUp(playerid); //To level 29
  1201. if(PlayerInfo[playerid][pXP] == 15000) PlayerLevelUp(playerid); //To level 30
  1202. }
  1203.  
  1204. SetPlayerLevelName(playerid)
  1205. {
  1206. strdel(PlayerInfo[playerid][pLevelName],0,128);
  1207. switch(PlayerInfo[playerid][pLevel])
  1208. {
  1209. case 1: strins(PlayerInfo[playerid][pLevelName],"Private I",0,128);
  1210. case 2: strins(PlayerInfo[playerid][pLevelName],"Private II",0,128);
  1211. case 3: strins(PlayerInfo[playerid][pLevelName],"Private III",0,128);
  1212. case 4: strins(PlayerInfo[playerid][pLevelName],"Private First Class",0,128);
  1213. case 5: strins(PlayerInfo[playerid][pLevelName],"Specialist",0,128);
  1214. case 6: strins(PlayerInfo[playerid][pLevelName],"Corporal",0,128);
  1215. case 7: strins(PlayerInfo[playerid][pLevelName],"Sergeant",0,128);
  1216. case 8: strins(PlayerInfo[playerid][pLevelName],"Staff Sergeant",0,128);
  1217. case 9: strins(PlayerInfo[playerid][pLevelName],"Sergeant First Class",0,128);
  1218. case 10: strins(PlayerInfo[playerid][pLevelName],"Master Sergeant",0,128);
  1219. case 11: strins(PlayerInfo[playerid][pLevelName],"First Sergeant",0,128);
  1220. case 12: strins(PlayerInfo[playerid][pLevelName],"Sergeant Major",0,128);
  1221. case 13: strins(PlayerInfo[playerid][pLevelName],"Command Sergeant Major",0,128);
  1222. case 14: strins(PlayerInfo[playerid][pLevelName],"Sergeant Major of the Army",0,128);
  1223. case 15: strins(PlayerInfo[playerid][pLevelName],"Warrant Officer",0,128);
  1224. case 16: strins(PlayerInfo[playerid][pLevelName],"Chief Warrant Officer II",0,128);
  1225. case 17: strins(PlayerInfo[playerid][pLevelName],"Chief Warrant Officer III",0,128);
  1226. case 18: strins(PlayerInfo[playerid][pLevelName],"Chief Warrant Officer IV",0,128);
  1227. case 19: strins(PlayerInfo[playerid][pLevelName],"Chief Warrant Officer V",0,128);
  1228. case 20: strins(PlayerInfo[playerid][pLevelName],"Second Lieutenant",0,128);
  1229. case 21: strins(PlayerInfo[playerid][pLevelName],"First Lieutenant",0,128);
  1230. case 22: strins(PlayerInfo[playerid][pLevelName],"Captain",0,128);
  1231. case 23: strins(PlayerInfo[playerid][pLevelName],"Major",0,128);
  1232. case 24: strins(PlayerInfo[playerid][pLevelName],"Lieutenant Colonel",0,128);
  1233. case 25: strins(PlayerInfo[playerid][pLevelName],"Colonel",0,128);
  1234. case 26: strins(PlayerInfo[playerid][pLevelName],"Brigadier General",0,128);
  1235. case 27: strins(PlayerInfo[playerid][pLevelName],"Major General",0,128);
  1236. case 28: strins(PlayerInfo[playerid][pLevelName],"Lieutenant General",0,128);
  1237. case 29: strins(PlayerInfo[playerid][pLevelName],"General",0,128);
  1238. case 30: strins(PlayerInfo[playerid][pLevelName],"General of the Army",0,128);
  1239. }
  1240. return 1;
  1241. }
  1242.  
  1243. stock GetPlayerLevelName(playerid)
  1244. {
  1245. SetPlayerLevelName(playerid);
  1246. return PlayerInfo[playerid][pLevelName];
  1247. }
  1248.  
  1249. /*/////////////////////////////////////////
  1250. TEAMS
  1251. *///////////////////////////////////////////
  1252. AltSetPlayerTeam(playerid, team)
  1253. {
  1254. SetPlayerTeam(playerid, team);
  1255. printf("Former Team ID is %d", PlayerInfo[playerid][pTeam]);
  1256. PlayerInfo[playerid][pTeam] = team;
  1257. printf("New team ID is %d", GetPlayerTeam(playerid));
  1258. SpawnPlayerAtTeam(playerid);
  1259. if(team == TEAM_USA) SetPlayerColor(playerid, COLOR_USA);
  1260. if(team == TEAM_CANADA) SetPlayerColor(playerid, COLOR_CANADA);
  1261. if(team == TEAM_BRITAIN) SetPlayerColor(playerid, COLOR_BRITAIN);
  1262. if(team == TEAM_AUSTRALIA) SetPlayerColor(playerid, COLOR_AUSTRALIA);
  1263. if(team == TEAM_RUSSIA) SetPlayerColor(playerid, COLOR_RUSSIA);
  1264. if(team == TEAM_GERMANY) SetPlayerColor(playerid, COLOR_GERMANY);
  1265. if(team == TEAM_ITALY) SetPlayerColor(playerid, COLOR_ITALY);
  1266. if(team == TEAM_FRANCE) SetPlayerColor(playerid, COLOR_FRANCE);
  1267. if(team == TEAM_CHINA) SetPlayerColor(playerid, COLOR_CHINA);
  1268. if(team == TEAM_INDIA) SetPlayerColor(playerid, COLOR_INDIA);
  1269. }
  1270.  
  1271. SpawnPlayerAtTeam(playerid)
  1272. {
  1273. new Float:USASpawns[3][4] =
  1274. {
  1275. {154.0558,1912.6029,18.8228,4.6064},
  1276. {213.6994,1874.9786,17.6406,3.0163},
  1277. {153.7363,1847.5313,17.6406,356.7496}
  1278. };
  1279. new Float:CanadaSpawns[3][4] =
  1280. {
  1281. {-472.4701,-194.1285,78.0881,20.1248},
  1282. {-541.7864,-151.8316,77.0442,359.2529},
  1283. {-536.2971,-98.5008,63.2969,273.6887}
  1284. };
  1285. new Float:BritainSpawns[3][4] =
  1286. {
  1287. {-1521.9277,481.4308,7.1875,180.5736},
  1288. {-1348.7789,500.1924,18.2344,348.6155},
  1289. {-1563.8306,316.6201,7.1875,131.1303}
  1290. };
  1291. new Float:AustraliaSpawns[3][4] =
  1292. {
  1293. {-688.0345,944.7898,13.6328,0.0469},
  1294. {-686.2051,979.6094,12.1262,87.5167},
  1295. {-687.8675,929.7429,13.6293,181.1319}
  1296. };
  1297. new Float:RussiaSpawns[3][4] =
  1298. {
  1299. {-2520.4351,-624.5309,132.7848,0.8743},
  1300. {-2487.4331,-621.0484,132.5872,87.1375},
  1301. {-2374.1062,-583.5718,132.1172,118.5435}
  1302. };
  1303. new Float:GermanySpawns[3][4] =
  1304. {
  1305. {1106.4036,-299.6010,74.5391,99.9817},
  1306. {1073.4133,-345.0207,73.9922,356.5807},
  1307. {1023.7352,-316.0926,73.9889,175.7202}
  1308. };
  1309. new Float:ItalySpawns[3][4] =
  1310. {
  1311. {-1070.8738,-1170.6907,129.6406,234.3037},
  1312. {-1060.0549,-1205.3832,129.2188,267.3490},
  1313. {-1067.8376,-1299.5409,129.2188,276.0990}
  1314. };
  1315. new Float:FranceSpawns[3][4] =
  1316. {
  1317. {-2237.7219,2353.6807,4.9803,132.8337},
  1318. {-2241.0059,2333.7966,4.9918,99.6200},
  1319. {-2281.6807,2288.4836,4.9704,271.9083}
  1320. };
  1321. new Float:ChinaSpawns[3][4] =
  1322. {
  1323. {2735.4065,-2452.2302,17.5938,359.3937},
  1324. {2721.3025,-2386.2537,17.3403,266.3329},
  1325. {2752.5508,-2513.4436,13.6402,19.0380}
  1326. };
  1327. new Float:IndiaSpawns[3][4] =
  1328. {
  1329. {2841.2942,1285.7273,11.3906,88.5804},
  1330. {2794.3298,1256.1736,11.0299,4.2696},
  1331. {2837.1394,1337.4557,11.0877,82.9403}
  1332. };
  1333.  
  1334. new rnd;
  1335. TogglePlayerSpectating(playerid, 0);
  1336. if(PlayerInfo[playerid][pTeam] == TEAM_USA) rnd = random(sizeof(USASpawns)), SetPlayerPos(playerid,USASpawns[rnd][0],USASpawns[rnd][1],USASpawns[rnd][2]), SetPlayerFacingAngle(playerid, USASpawns[rnd][3]), SetPlayerColor(playerid, COLOR_USA);
  1337. if(PlayerInfo[playerid][pTeam] == TEAM_CANADA) rnd = random(sizeof(CanadaSpawns)), SetPlayerPos(playerid,CanadaSpawns[rnd][0],CanadaSpawns[rnd][1],CanadaSpawns[rnd][2]), SetPlayerFacingAngle(playerid, CanadaSpawns[rnd][3]), SetPlayerColor(playerid, COLOR_CANADA);
  1338. if(PlayerInfo[playerid][pTeam] == TEAM_BRITAIN) rnd = random(sizeof(BritainSpawns)), SetPlayerPos(playerid,BritainSpawns[rnd][0],BritainSpawns[rnd][1],BritainSpawns[rnd][2]), SetPlayerFacingAngle(playerid, BritainSpawns[rnd][3]), SetPlayerColor(playerid, COLOR_BRITAIN);
  1339. if(PlayerInfo[playerid][pTeam] == TEAM_AUSTRALIA) rnd = random(sizeof(AustraliaSpawns)), SetPlayerPos(playerid,AustraliaSpawns[rnd][0],AustraliaSpawns[rnd][1],AustraliaSpawns[rnd][2]), SetPlayerFacingAngle(playerid, AustraliaSpawns[rnd][3]), SetPlayerColor(playerid, COLOR_AUSTRALIA);
  1340. if(PlayerInfo[playerid][pTeam] == TEAM_RUSSIA) rnd = random(sizeof(RussiaSpawns)), SetPlayerPos(playerid,RussiaSpawns[rnd][0],RussiaSpawns[rnd][1],RussiaSpawns[rnd][2]), SetPlayerFacingAngle(playerid,RussiaSpawns[rnd][3]), SetPlayerColor(playerid, COLOR_RUSSIA);
  1341. if(PlayerInfo[playerid][pTeam] == TEAM_GERMANY) rnd = random(sizeof(GermanySpawns)), SetPlayerPos(playerid,GermanySpawns[rnd][0],GermanySpawns[rnd][1],GermanySpawns[rnd][2]), SetPlayerFacingAngle(playerid, GermanySpawns[rnd][3]), SetPlayerColor(playerid, COLOR_GERMANY);
  1342. if(PlayerInfo[playerid][pTeam] == TEAM_ITALY) rnd = random(sizeof(ItalySpawns)), SetPlayerPos(playerid,ItalySpawns[rnd][0],ItalySpawns[rnd][1],ItalySpawns[rnd][2]), SetPlayerFacingAngle(playerid, ItalySpawns[rnd][3]), SetPlayerColor(playerid, COLOR_ITALY);
  1343. if(PlayerInfo[playerid][pTeam] == TEAM_FRANCE) rnd = random(sizeof(FranceSpawns)), SetPlayerPos(playerid,FranceSpawns[rnd][0],FranceSpawns[rnd][1],FranceSpawns[rnd][2]), SetPlayerFacingAngle(playerid, FranceSpawns[rnd][3]), SetPlayerColor(playerid, COLOR_FRANCE);
  1344. if(PlayerInfo[playerid][pTeam] == TEAM_CHINA) rnd = random(sizeof(ChinaSpawns)), SetPlayerPos(playerid,ChinaSpawns[rnd][0],ChinaSpawns[rnd][1],ChinaSpawns[rnd][2]), SetPlayerFacingAngle(playerid, ChinaSpawns[rnd][3]), SetPlayerColor(playerid, COLOR_CHINA);
  1345. if(PlayerInfo[playerid][pTeam] == TEAM_INDIA) rnd = random(sizeof(IndiaSpawns)), SetPlayerPos(playerid,IndiaSpawns[rnd][0],IndiaSpawns[rnd][1],IndiaSpawns[rnd][2]), SetPlayerFacingAngle(playerid, IndiaSpawns[rnd][3]), SetPlayerColor(playerid, COLOR_INDIA);
  1346. SetCameraBehindPlayer(playerid);
  1347. SetPlayerSkin(playerid, 287);
  1348. }
  1349.  
  1350. GetPlayerTeamName(playerid)
  1351. {
  1352. new szString[24];
  1353. new team;
  1354. team = GetPlayerTeam(playerid);
  1355.  
  1356. switch(team)
  1357. {
  1358. case TEAM_USA: szString = "United States";
  1359. case TEAM_CANADA: szString = "Canada";
  1360. case TEAM_BRITAIN: szString = "Britain";
  1361. case TEAM_AUSTRALIA: szString = "Australia";
  1362. case TEAM_RUSSIA: szString = "Russia";
  1363. case TEAM_GERMANY: szString = "Germany";
  1364. case TEAM_ITALY: szString = "Italy";
  1365. case TEAM_FRANCE: szString = "France";
  1366. case TEAM_CHINA: szString = "China";
  1367. case TEAM_INDIA: szString = "India";
  1368. default: valstr(szString, team);
  1369. }
  1370. printf("Team name is %s", szString);
  1371. return szString;
  1372. }
  1373.  
  1374.  
  1375. ////////////////////////////////////////
  1376. ////////////////////////////////////////
  1377. /////////////////////////////////////
  1378. stock SendAdminMessage(color,string[])
  1379. {
  1380. for(new i = 0; i < MAX_PLAYERS; i++)
  1381. {
  1382. if(IsPlayerConnected(i) == 1 && PlayerInfo[i][pAdmin] >= 1)
  1383. {
  1384. SendClientMessage(i, color, string);
  1385. }
  1386. }
  1387. return 1;
  1388. }
  1389.  
  1390. stock SendTeamMessage(team,string[])
  1391. {
  1392. for(new i = 0; i < MAX_PLAYERS; i++)
  1393. {
  1394. if(IsPlayerConnected(i) == 1 && PlayerInfo[i][pTeam] == team)
  1395. {
  1396. switch(GetPlayerTeam(i))
  1397. {
  1398. case TEAM_USA: SendClientMessage(i, COLOR_USA, string);
  1399. case TEAM_CANADA: SendClientMessage(i, COLOR_CANADA, string);
  1400. case TEAM_BRITAIN: SendClientMessage(i, COLOR_BRITAIN, string);
  1401. case TEAM_AUSTRALIA: SendClientMessage(i, COLOR_AUSTRALIA, string);
  1402. case TEAM_RUSSIA: SendClientMessage(i, COLOR_RUSSIA, string);
  1403. case TEAM_GERMANY: SendClientMessage(i, COLOR_GERMANY, string);
  1404. case TEAM_ITALY: SendClientMessage(i, COLOR_ITALY, string);
  1405. case TEAM_FRANCE: SendClientMessage(i, COLOR_FRANCE, string);
  1406. case TEAM_CHINA: SendClientMessage(i, COLOR_CHINA, string);
  1407. case TEAM_INDIA: SendClientMessage(i, COLOR_INDIA, string);
  1408. }
  1409. }
  1410. }
  1411. return 1;
  1412. }
  1413.  
  1414. forward SetZone(playerid);
  1415. public SetZone(playerid)
  1416. {
  1417. GivePlayerXP(playerid, 250);
  1418. GivePlayerMoney(playerid, 3000);
  1419. SendClientMessage(playerid,COLOR_GREEN,"Congratulation! You have been given 250 XP & $3000");
  1420. UnderAttack[ZONE_BLUEBERRY_FACTORY] = 0;
  1421. KillTimer(timer[playerid][ZONE_BLUEBERRY_FACTORY]);
  1422. SetGangZone(playerid);
  1423. return 1;
  1424. }
  1425.  
  1426. forward SetGangZone(playerid);
  1427. public SetGangZone(playerid)
  1428. {
  1429. if(zDefine[playerid] == ZONE_BLUEBERRY_FACTORY)
  1430. {
  1431. GangZoneShowForAll(Zone[ZONE_BLUEBERRY_FACTORY],GetPlayerColor(playerid));
  1432. new string[126], pName5[MAX_PLAYER_NAME];
  1433. GetPlayerName(playerid,pName5,sizeof(pName5));
  1434. format(string,sizeof string,"%s has captured the Blueberry Brewery for %s", pName5, GetPlayerTeamName(playerid));
  1435. GangZoneStopFlashForAll(Zone[ZONE_BLUEBERRY_FACTORY]);
  1436. SendClientMessageToAll(COLOR_GREEN, string);
  1437. tCheck[ZONE_BLUEBERRY_FACTORY] = PlayerInfo[playerid][pTeam];
  1438. }
  1439. return 1;
  1440. }
Add Comment
Please, Sign In to add comment