Advertisement
Guest User

Twinkis Code

a guest
Feb 5th, 2012
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 52.81 KB | None | 0 0
  1. #include <a_samp>
  2. #include <streamer>
  3. #include <YSI\y_ini>
  4.  
  5. #if defined FILTERSCRIPT
  6. #else
  7.  
  8. main()
  9. {
  10. print("\n----------------------------------");
  11. print(" War Zone");
  12. print("----------------------------------\n");
  13. }
  14. #define MAX_STRING 256
  15. #define PRESSED(%0) \
  16. (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
  17.  
  18. new Cooldown[MAX_PLAYERS];
  19. new gTeam[MAX_PLAYERS];
  20. new Text:ShadowsRandom;
  21. new gateR1; //Russian gate
  22. new elevator1; //Russian elevator
  23. new HPRus;
  24. new RusArmour;
  25. new HPUS;
  26. new USArmour;
  27. //textdraws
  28. new Text:Health[MAX_PLAYERS];
  29. new Text:Armour[MAX_PLAYERS];
  30. new Text:Warzone;
  31. new Text:Russian;
  32. new Text:USA;
  33. new gSeconds = 0; // counts how many seconds server is running
  34. new Text: gText; // global "Text"
  35. new Text:SPEEDOS[MAX_PLAYERS]; //speedometer
  36.  
  37. forward LoadObjectsForPlayer( playerid );
  38. forward ObjectsLoaded( playerid );
  39.  
  40. #define TEAM_RUSSIA 1
  41. #define TEAM_USA 2
  42.  
  43. forward RandomMessage();
  44.  
  45. //colors
  46. #define COLOR_GREY 0xAFAFAFAA
  47. #define COLOR_GREEN 0x33AA33AA
  48. #define COLOR_RED 0xAA3333AA
  49. #define COLOR_YELLOW 0xFFFF00AA
  50. #define COLOR_WHITE 0xFFFFFFAA
  51. #define COLOR_BLUE 0x0000BBAA
  52. #define COLOR_LIGHTBLUE 0x33CCFFAA
  53. #define COLOR_ORANGE 0xFF9900AA
  54. #define COLOR_RED 0xAA3333AA
  55. #define COLOR_LIME 0x10F441AA
  56. #define COLOR_MAGENTA 0xFF00FFFF
  57. #define COLOR_NAVY 0x000080AA
  58. #define COLOR_AQUA 0xF0F8FFAA
  59. #define COLOR_CRIMSON 0xDC143CAA
  60. #define COLOR_FLBLUE 0x6495EDAA
  61. #define COLOR_BISQUE 0xFFE4C4AA
  62. #define COLOR_BLACK 0x000000AA
  63. #define COLOR_CHARTREUSE 0x7FFF00AA
  64. #define COLOR_BROWN 0XA52A2AAA
  65. #define COLOR_CORAL 0xFF7F50AA
  66. #define COLOR_GOLD 0xB8860BAA
  67. #define COLOR_GREENYELLOW 0xADFF2FAA
  68. #define COLOR_INDIGO 0x4B00B0AA
  69. #define COLOR_IVORY 0xFFFF82AA
  70. #define COLOR_LAWNGREEN 0x7CFC00AA
  71. #define COLOR_LIMEGREEN 0x32CD32AA //<--- Dark lime
  72. #define COLOR_MIDNIGHTBLUE 0X191970AA
  73. #define COLOR_MAROON 0x800000AA
  74. #define COLOR_OLIVE 0x808000AA
  75. #define COLOR_ORANGERED 0xFF4500AA
  76. #define COLOR_PINK 0xFFC0CBAA // - Light light pink
  77. #define COLOR_SEAGREEN 0x2E8B57AA
  78. #define COLOR_SPRINGGREEN 0x00FF7FAA
  79. #define COLOR_TOMATO 0xFF6347AA // - Tomato >:/ sounds wrong lol... well... :P
  80. #define COLOR_YELLOWGREEN 0x9ACD32AA //- like military green
  81. #define COLOR_MEDIUMAQUA 0x83BFBFAA
  82. #define COLOR_MEDIUMMAGENTA 0x8B008BAA // dark magenta ^^
  83. #endif
  84.  
  85. public OnGameModeInit()
  86. {
  87. SetGameModeText("WZ 1.0");
  88. AddPlayerClass(287, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  89. AddPlayerClass(287, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  90.  
  91. AddStaticVehicle(520,2095.7041,753.5626,10.5405,268.4791,125,125);
  92.  
  93. SetTimer("ScoreChecker", 1000, true);
  94.  
  95. Warzone = TextDrawCreate(548, 130, "War Zone");
  96. TextDrawFont(Text:Warzone, 0);
  97. TextDrawLetterSize(Text:Warzone , 0.5, 3.5);
  98. TextDrawColor(Text:Warzone , 0xFF8000FF);
  99. TextDrawSetOutline(Text:Warzone , 0);
  100. TextDrawSetProportional(Text:Warzone , 1);
  101. TextDrawSetShadow(Text:Warzone , 1);
  102.  
  103. Russian = TextDrawCreate(48, 173, "<Russia>");
  104. USA = TextDrawCreate(64, 201, "USA");
  105.  
  106.  
  107. for(new i = 0; i < MAX_PLAYERS; i++)
  108. {
  109. Health[i] = TextDrawCreate(566.000000, 67.000000, "100%");
  110. TextDrawBackgroundColor(Health[i], 255);
  111. TextDrawFont(Health[i], 1);
  112. TextDrawLetterSize(Health[i], 0.219999, 0.899999);
  113. TextDrawColor(Health[i], -1);
  114. TextDrawSetOutline(Health[i], 1);
  115. TextDrawSetProportional(Health[i], 1);
  116.  
  117. Armour[i] = TextDrawCreate(566.000000, 44.000000, "100%");
  118. TextDrawBackgroundColor(Armour[i], 255);
  119. TextDrawFont(Armour[i], 1);
  120. TextDrawLetterSize(Armour[i], 0.219999, 0.899999);
  121. TextDrawColor(Armour[i], -1);
  122. TextDrawSetOutline(Armour[i], 1);
  123. TextDrawSetProportional(Armour[i], 1);
  124. }
  125.  
  126. SetTimer("TimeServerRunning", 1000, true);
  127. SetTimer("vitals",1000,1);
  128. //:::::::::::::::::::::::::::::::::::::::::::russia::::::::::::::::::::::::::::::::::::::::::::::::::::
  129. //russian Gates
  130. gateR1 = CreateObject(986, -1530.72, 482.47, 7.85, 0.00, 0.00, 0.00); //closed gater
  131. //elevators
  132. elevator1 = CreateObject(18769, -1426.42, 478.65, 5.61, 0.00, 0.00, 0.00); //Russ elevator
  133. //cd timer
  134. SetTimer("CooldownTimer",1000,true);
  135.  
  136. //russian HQ objects
  137. CreateObject(10830, -1841.97, 67.83, 19.30, 0.00, 0.00, 45.00); //Big hangar
  138. CreateObject(18759, -1541.05, 347.51, 23.54, 90.00, 0.00, 180.00); //skull
  139. CreateObject(18750, -1402.36, 449.20, 48.88, 90.00, 0.00, 180.00); //samp
  140. CreateObject(10829, -1522.75, 484.35, 6.17, 0.00, 0.00, 89.00); //Small house at the gates
  141. CreateObject(18752, -1149.95, 650.24, -5.60, 0.00, 0.00, 0.00); //Volcano
  142.  
  143. //russian cars
  144. AddStaticVehicle(433,-1478.6230,458.4825,7.6245,0.1573,43,0); // Barrack1Rus
  145. AddStaticVehicle(433,-1472.8566,458.2283,7.6175,359.8017,43,0); // Barrack2Rus
  146. AddStaticVehicle(433,-1466.7430,458.9492,7.6178,2.1256,43,0); // Barrack3Rus
  147. AddStaticVehicle(433,-1460.1853,459.5169,7.6209,2.2832,43,0); // Barrack4Rus
  148. AddStaticVehicle(476,-1453.7758,505.0262,18.6973,269.5388,43,0); // RussianAir1
  149. AddStaticVehicle(476,-1408.5402,493.0725,18.6662,270.2772,43,0); // RussianAir2
  150. AddStaticVehicle(476,-1335.7068,507.5463,18.6710,271.2304,43,0); // RussianAir3
  151. AddStaticVehicle(476,-1306.5942,495.2166,18.6709,271.6489,43,0); // RussianAir4
  152. AddStaticVehicle(469,-1454.2009,492.8001,18.9907,270.0278,43,0); //Heli
  153. AddStaticVehicle(469,-1607.7517,283.7738,7.6213,179.9140,43,0); //heli2
  154. AddStaticVehicle(469,-1418.1304,519.1664,18.2561,267.8859,43,0); // Heli3
  155. AddStaticVehicle(470,-1405.4955,457.9366,7.6176,359.9135,43,0); // Patriot1
  156. AddStaticVehicle(470,-1396.0319,457.0566,7.6205,1.3433,43,0); // Patriot2
  157. AddStaticVehicle(470,-1387.2916,457.3072,7.6348,359.6477,43,0); // Patriot3
  158. AddStaticVehicle(470,-1380.5962,458.4571,7.6238,0.4840,43,0); // Patriot4
  159. AddStaticVehicle(430,-1454.2769,492.8647,-0.3180,88.8909,46,26); // BoatSpawn2
  160. AddStaticVehicle(430,-1281.6605,484.8924,-0.1539,273.4125,46,26); // BoatSpawn3
  161. AddStaticVehicle(430,-1471.6229,487.9530,-0.1638,91.7132,46,26); // BoatSpawn4
  162. AddStaticVehicle(471,-1505.4823,480.8822,6.6696,179.4567,103,111); // QuadRus1
  163. AddStaticVehicle(471,-1503.6810,480.8950,6.6683,179.3363,120,114); // QuadRus2
  164. AddStaticVehicle(471,-1501.9218,480.8925,6.6689,178.8771,74,91); // QuadRus3
  165. AddStaticVehicle(471,-1500.1217,481.0065,6.6657,182.1629,120,112); // QuadRus4
  166.  
  167. //::::::::::::::::::::::::::::::::::::::::::USA:::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  168. AddStaticVehicle(432,-1529.5184,417.1947,7.1948,91.6082,43,0); // Rhino1
  169. AddStaticVehicle(432,-1529.6752,410.0621,7.1948,90.1931,43,0); // Rhino2
  170. AddStaticVehicle(432,-1529.5027,426.5029,7.1948,91.3376,43,0); // Rhino3
  171. AddStaticVehicle(432,-1529.4803,435.2108,7.1948,90.4148,43,0); // Rhino4
  172. AddStaticVehicle(476,-2231.9016,2261.7383,5.5296,183.2060,43,0); // USA-Air-1
  173. AddStaticVehicle(476,-2247.2988,2261.7244,5.5238,178.5792,0,0); // USA-Air-2
  174. AddStaticVehicle(476,-2157.4795,2260.4600,5.3791,89.5623,0,0); // USA-Air-3
  175. AddStaticVehicle(476,-2158.5039,2235.1145,5.3764,88.8704,0,0); // USA-Air-4
  176. AddStaticVehicle(476,-2162.1340,2209.0837,5.3768,146.6770,0,0); // USA-Air-5
  177. AddStaticVehicle(469,-2185.8196,2287.6917,6.9349,178.4588,0,0); // USA-Air-6
  178. AddStaticVehicle(469,-2158.6675,2287.7749,7.1559,184.4485,0,0); // USA-Air-7
  179. AddStaticVehicle(469,-2158.7859,2311.7280,7.1395,178.4971,0,0); // USA-Air-8
  180. AddStaticVehicle(469,-2187.3516,2313.7854,7.1370,176.3093,0,0); // USA-Air-9
  181. AddStaticVehicle(469,-2227.4651,2326.3206,7.5620,175.0905,0,0); // USA-Air-10
  182. AddStaticVehicle(433,-2271.0859,2319.7651,5.2569,271.0697,75,10); // Usa-car-1
  183. AddStaticVehicle(433,-2270.1343,2325.6755,5.2529,270.0114,75,10); // Usa-car-2
  184. AddStaticVehicle(433,-2271.2954,2331.7371,5.2549,270.1436,75,10); // Usa-car-3
  185. AddStaticVehicle(433,-2272.1743,2339.0193,5.2490,270.6492,75,10); // Usa-car-4
  186. AddStaticVehicle(470,-2252.4805,2336.1741,4.8040,89.8434,19,2); // Usa-car-5
  187. AddStaticVehicle(470,-2253.2014,2332.9866,4.8074,89.2273,19,2); // Usa-car-6
  188. AddStaticVehicle(470,-2252.3655,2329.9407,4.8039,90.6011,19,2); // Usa-car-7
  189. AddStaticVehicle(470,-2252.8333,2326.8762,4.8080,90.9587,19,2); // Usa-car-8
  190. AddStaticVehicle(470,-2253.2053,2323.9214,4.8063,90.2840,19,2); // Usa-car-9
  191. AddStaticVehicle(470,-2252.7144,2320.8201,4.8074,90.4475,19,2); // Usa-car-10
  192. AddStaticVehicle(432,-2283.8445,2342.0916,5.2333,358.0948,82,59); // Usa-car-11
  193. AddStaticVehicle(432,-2291.6482,2341.3120,5.4555,0.6973,82,59); // Usa-car-12
  194. AddStaticVehicle(432,-2299.2195,2341.3484,5.1503,2.2537,82,59); // Usa-car-13
  195. AddStaticVehicle(432,-2305.1206,2330.4285,4.9919,359.4791,82,59); // Usa-car-14
  196. AddStaticVehicle(432,-2239.1699,2276.4951,4.9975,2.0445,82,59); // Usa-car-15
  197. AddStaticVehicle(432,-2285.1262,2282.7998,4.9779,273.1414,82,59); // Usa-car-16
  198.  
  199. //pickups
  200. HPRus = CreatePickup(1240, 23, -1386.1161,490.2056,21.2500, 0);
  201. RusArmour = CreatePickup(1242, 23, -1385.5709,492.7346,21.2500, 0);
  202. HPUS = CreatePickup(1240, 23, -2280.4575,2291.9885,4.9629, 0);
  203. USArmour = CreatePickup(1242, 23, -2280.3860,2294.5652,4.9631, 0);
  204.  
  205.  
  206.  
  207. //text draw
  208. print("Texdraw by Twinki loading.... ");
  209. print(">>> loading... ");
  210. print("Texdraw's loaded");
  211. SetTimer("RandomMessage",10000,1);
  212. ShadowsRandom = TextDrawCreate(1.000000, 437.000000, "TW: Visit our www.sa-mp.com");
  213. TextDrawBackgroundColor(ShadowsRandom, 65535);
  214. TextDrawFont(ShadowsRandom, 0);
  215. TextDrawLetterSize(ShadowsRandom, 0.500000, 1.000000);
  216. TextDrawColor(ShadowsRandom, -16776961);
  217. TextDrawSetOutline(ShadowsRandom, 1);
  218. TextDrawSetProportional(ShadowsRandom, 1);
  219. TextDrawUseBox(ShadowsRandom, 1);
  220. TextDrawBoxColor(ShadowsRandom, 255);
  221. TextDrawTextSize(ShadowsRandom, 648.000000, 0.000000);
  222. return 1;
  223. }
  224.  
  225. public TimeServerRunning() {
  226. new string[16];
  227. TextDrawDestroy(gText);
  228. gSeconds++;
  229. format(string, sizeof string, "%s", TimeConvert(gSeconds));
  230. gText = TextDrawCreate(79, 323, string);
  231. TextDrawUseBox(gText, true);
  232. TextDrawTextSize(gText, 50.0, 20.0);
  233. TextDrawShowForAll(gText);
  234. }
  235. /*
  236. TimeConvert(time) {
  237. new minutes;
  238. new seconds;
  239. new string[256];
  240. */
  241. TimeConvert(time) {
  242. new minutes;
  243. new seconds;
  244. new string[128];
  245. if(time > 59){
  246. minutes = floatround(time/60);
  247. seconds = floatround(time - minutes*60);
  248. if(seconds>9)format(string,sizeof(string),"%d:%d",minutes,seconds);
  249. else format(string,sizeof(string),"%d:0%d",minutes,seconds);
  250. }
  251. else{
  252. seconds = floatround(time);
  253. if(seconds>9)format(string,sizeof(string),"0:%d",seconds);
  254. else format(string,sizeof(string),"0:0%d",seconds);
  255. }
  256. return string;
  257. }
  258.  
  259. new RandomMessages[][] =
  260. {
  261. "Server: Enjoy the day!",
  262. "Server: If you want to text-to-speech type /language",
  263. "Server: For any help feel free to type /help!",
  264. "Server: You can request a song from the Admin! Type /request!",
  265. "Server: Use @ to speak with team!",
  266. "Server: To send someone private message, double click on their name in the score list!"
  267. };
  268.  
  269. public RandomMessage()
  270. {
  271. TextDrawSetString(ShadowsRandom, RandomMessages[random(sizeof(RandomMessages))]);
  272. return 1;
  273. }
  274.  
  275. public OnGameModeExit()
  276. {
  277. return 1;
  278. }
  279. public OnPlayerRequestClass(playerid, classid)
  280. {
  281. SetPlayerPos(playerid,1541.2833, -1362.4741, 329.6457);
  282. SetPlayerFacingAngle(playerid, 360);
  283. SetPlayerCameraLookAt(playerid,1541.2833, -1362.4741, 329.6457);
  284. SetPlayerCameraPos(playerid,1540.8374,-1358.4910,329.4645);
  285.  
  286. SetPlayerTeamFromClass(playerid, classid);
  287. return 1;
  288. }
  289.  
  290. SetPlayerTeamFromClass(playerid, classid)
  291. {
  292. if(classid == 0)
  293. {
  294. gTeam[playerid] = TEAM_RUSSIA;
  295. SetPlayerTeam(playerid,TEAM_RUSSIA);
  296. GameTextForPlayer(playerid,"~r~Russia",2000,3);
  297. TextDrawShowForPlayer(playerid, Text:Russian);
  298. TextDrawFont(Text:Russian , 0);
  299. TextDrawLetterSize(Text:Russian , 0.5, 3.5);
  300. TextDrawColor(Text:Russian , 0xFF0000FF);
  301. TextDrawSetOutline(Text:Russian , 0);
  302. TextDrawSetProportional(Text:Russian , 1);
  303. TextDrawSetShadow(Text:Russian , 1);
  304. TextDrawShowForPlayer(playerid, Text:Russian);
  305. TextDrawHideForPlayer(playerid, Text:USA);
  306.  
  307. }
  308. else if(classid == 1)
  309. {
  310. gTeam[playerid] = TEAM_USA;
  311. SetPlayerTeam(playerid,TEAM_USA);
  312. GameTextForPlayer(playerid,"~b~USA",2000,3);
  313. TextDrawShowForPlayer(playerid, Text:USA);
  314. TextDrawFont(Text:USA , 0);
  315. TextDrawLetterSize(Text:USA , 0.5, 3.5);
  316. TextDrawColor(Text:USA , 0xFF8040FF);
  317. TextDrawSetOutline(Text:USA , 1);
  318. TextDrawSetProportional(Text:USA , 1);
  319. TextDrawSetShadow(Text:USA , 1);
  320. TextDrawShowForPlayer(playerid, Text:USA);
  321. TextDrawHideForPlayer(playerid, Text:Russian);
  322.  
  323. }
  324. }
  325. new VehicleNames2[][]= {
  326. {"Landstalker"}, {"Bravura"}, {"Buffalo"}, {"Linerunner"}, {"Perrenial"},
  327. {"Sentinel"}, {"Dumper"}, {"Firetruck"}, {"Trashmaster"}, {"Stretch"},
  328. {"Manana"}, {"Infernus"}, {"Voodoo"}, {"Pony"}, {"Mule"}, {"Cheetah"},
  329. {"Ambulance"}, {"Leviathan"}, {"Moonbeam"}, {"Esperanto"}, {"Taxi"},
  330. {"Washington"}, {"Bobcat"}, {"Mr Whoopee"}, {"BF Injection"}, {"Hunter"},
  331. {"Premier"}, {"Enforcer"}, {"Securicar"}, {"Banshee"}, {"Predator"},
  332. {"Bus"}, {"Rhino"}, {"Barracks"}, {"Hotknife"}, {"Trailer 1"}, {"Previon"},
  333. {"Coach"}, {"Cabbie"}, {"Stallion"}, {"Rumpo"}, {"RC Bandit"}, {"Romero"},
  334. {"Packer"}, {"Monster"}, {"Admiral"}, {"Squalo"}, {"Sparrow"},
  335. {"Pizzaboy"}, {"Tram"}, {"Trailer 2"}, {"Turismo"}, {"Speeder"}, {"Reefer"},
  336. {"Tropic"}, {"Flatbed"}, {"Yankee"}, {"Caddy"}, {"Solair"},
  337. {"Berkley's RC Van"}, {"Skimmer"}, {"PCJ-600"}, {"Faggio"}, {"Freeway"},
  338. {"RC Baron"}, {"RC Raider"}, {"Glendale"}, {"Oceanic"}, {"Sanchez"},
  339. {"Seasparrow"}, {"Patriot"}, {"Quad"}, {"Coastguard"}, {"Dinghy"}, {"Hermes"},
  340. {"Sabre"}, {"Rustler"}, {"ZR-350"}, {"Walton"}, {"Regina"}, {"Comet"},
  341. {"BMX"}, {"Burrito"}, {"Camper"}, {"Marquis"}, {"Baggage"}, {"Dozer"},
  342. {"Maverick"}, {"News Maverick"}, {"Rancher"}, {"FBI Rancher"}, {"Virgo"},
  343. {"Greenwood"}, {"Jetmax"}, {"Hotring"}, {"Sandking"}, {"Blista Compact"},
  344. {"Police Maverick"}, {"Boxville"}, {"Benson"}, {"Mesa"},{"RC Goblin"},
  345. {"Hotring Racer A"}, {"Hotring Racer B"}, {"Bloodring Banger"}, {"Rancher"},
  346. {"Super GT"}, {"Elegant"}, {"Journey"}, {"Bike"}, {"Mountain Bike"},
  347. {"Beagle"}, {"Cropdust"}, {"Stunt"}, {"Tanker"}, {"Roadtrain"}, {"Nebula"},
  348. {"Majestic"}, {"Buccaneer"}, {"Shamal"}, {"Hydra"}, {"FCR-900"},
  349. {"NRG-500"}, {"HPV1000"}, {"Cement Truck"}, {"Tow Truck"}, {"Fortune"},
  350. {"Cadrona"}, {"FBI Truck"}, {"Willard"}, {"Forklift"}, {"Tractor"},
  351. {"Combine"}, {"Feltzer"}, {"Remington"}, {"Slamvan"}, {"Blade"},
  352. {"Freight"}, {"Brownstreak"}, {"Vortex"},{"Vincent"}, {"Bullet"}, {"Clover"},
  353. {"Sadler"}, {"Ladder Firetruck"}, {"Hustler"}, {"Intruder"}, {"Primo"},
  354. {"Cargobob"}, {"Tampa"}, {"Sunrise"}, {"Merit"}, {"Utility"}, {"Nevada"},
  355. {"Yosemite"}, {"Windsor"}, {"Monster A"}, {"Monster B"}, {"Uranus"},
  356. {"Jester"}, {"Sultan"}, {"Stratum"}, {"Elegy"}, {"Raindance"}, {"RC Tiger"},
  357. {"Flash"}, {"Tahoma"}, {"Savanna"}, {"Bandito"}, {"Freight Flat"},
  358. {"Streak Carriage"}, {"Kart"}, {"Mower"}, {"Dune"}, {"Sweeper"},
  359. {"Broadway"}, {"Tornado"}, {"AT-400"}, {"DFT-30"}, {"Huntley"},
  360. {"Stafford"}, {"BF-400"}, {"Newsvan"}, {"Tug"}, {"Trailer 3"}, {"Emperor"},
  361. {"Wayfarer"}, {"Euros"}, {"Hotdog"}, {"Club"}, {"Freight Carriage"},
  362. {"Trailer 4"}, {"Andromada"}, {"Dodo"}, {"RC Cam"}, {"Launch"},
  363. {"Police Car (LSPD)"}, {"Police Car (SFPD)"}, {"Police Car (LVPD)"},
  364. {"Police Ranger"}, {"Picador"}, {"S.W.A.T. Van"}, {"Alpha"}, {"Phoenix"},
  365. {"Old Glendale"}, {"Old Sadler"}, {"Luggage Trailer A"}, {"Luggage Trailer B"},
  366. {"Stair Trailer"}, {"Boxville"}, {"Farm Plow"}, {"Utility Trailer"}
  367. };
  368. stock SendTeamMessage( playerid, t_MSG[ ] )
  369. {
  370. for( new i = 0; i < MAX_PLAYERS; i ++ )
  371. {
  372. if( GetPlayerTeam( i ) == GetPlayerTeam( playerid ) )
  373. {
  374. new c_msg[ 128 ], c_name[ MAX_PLAYER_NAME ];
  375. GetPlayerName( playerid, c_name, sizeof c_name );
  376. format( c_msg, ( 128 ), "[Team Chat]%s: {FFFFFF}%s", c_name, t_MSG );
  377. SendClientMessage( i, GetPlayerColor( playerid ), c_msg );
  378. }
  379. else continue;
  380. }
  381. return ( 1 );
  382. }
  383. stock strtok(const string[], &index,seperator=' ')
  384. {
  385. new length = strlen(string);
  386. new offset = index;
  387. new result[MAX_STRING];
  388. while ((index < length) && (string[index] != seperator) && ((index - offset) < (sizeof(result) - 1)))
  389. {
  390. result[index - offset] = string[index];
  391. index++;
  392. }
  393.  
  394. result[index - offset] = EOS;
  395. if ((index < length) && (string[index] == seperator))
  396. {
  397. index++;
  398. }
  399. return result;
  400. }
  401. stock Name(playerid)
  402. {
  403. new name[MAX_PLAYER_NAME];
  404. GetPlayerName(playerid, name, sizeof(name));
  405. return name;
  406. }
  407.  
  408. public OnPlayerConnect(playerid)
  409. {
  410. SPEEDOS[playerid] = TextDrawCreate(498,362 ," ");
  411. TextDrawShowForPlayer(playerid,SPEEDOS[playerid]);
  412. new string[16];
  413. TextDrawDestroy(gText);
  414. gSeconds++;
  415. format(string, sizeof string, "%s", TimeConvert(gSeconds));
  416. gText = TextDrawCreate(79, 323, string);
  417. TextDrawUseBox(gText, true);
  418. TextDrawTextSize(gText, 50.0, 20.0);
  419. TextDrawShowForAll(gText);
  420.  
  421. SendClientMessage(playerid, COLOR_BLUE, "-----------------------------------------------------------------------------");
  422. SendClientMessage(playerid, COLOR_LIGHTBLUE, "Welcome to War zone deathmatch made by Twinki!");
  423. SendClientMessage(playerid, COLOR_LIGHTBLUE, "We hope that you will enjoy your stay here!");
  424. SendClientMessage(playerid, COLOR_LIGHTBLUE, "Feel free to use /report anytime you need help!");
  425. SendClientMessage(playerid, COLOR_LIGHTBLUE, "For any other help use /help");
  426. SendClientMessage(playerid, COLOR_LIGHTBLUE, "For team help use command /th!");
  427. SendClientMessage(playerid, COLOR_LIGHTBLUE, "To chat with team mates use @ text!");
  428. SendClientMessage(playerid, COLOR_LIGHTBLUE, "Have fun!");
  429. SendClientMessage(playerid, COLOR_BLUE, "-----------------------------------------------------------------------------");
  430. //removed buildings (russian spawn building
  431. RemoveBuildingForPlayer(playerid, 10796, -1847.7813, 44.7813, 35.5625, 0.25);
  432. RemoveBuildingForPlayer(playerid, 10797, -1849.6328, -54.3125, 24.9766, 0.25);
  433. RemoveBuildingForPlayer(playerid, 705, -1815.0547, -11.8594, 14.2266, 0.25);
  434. RemoveBuildingForPlayer(playerid, 10776, -1849.6328, -54.3125, 24.9766, 0.25);
  435. RemoveBuildingForPlayer(playerid, 10775, -1847.7813, 44.7813, 35.5625, 0.25);
  436. RemoveBuildingForPlayer(playerid, 968, -1526.4375, 481.3828, 6.9063, 0.25);
  437. RemoveBuildingForPlayer(playerid, 966, -1526.3906, 481.3828, 6.1797, 0.25);
  438. RemoveBuildingForPlayer(playerid, 10829, -1523.2578, 486.7969, 6.1563, 0.25);
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446. //VALHALLA TESTING!
  447. RemoveBuildingForPlayer(playerid, 6188, 836.3125, -1866.7578, -0.5391, 0.25);
  448. RemoveBuildingForPlayer(playerid, 6189, 836.4453, -2003.5234, -2.6406, 0.25);
  449. RemoveBuildingForPlayer(playerid, 6190, 836.3125, -1866.7578, -0.5391, 0.25);
  450. RemoveBuildingForPlayer(playerid, 6191, 836.4453, -2003.5234, -2.6406, 0.25);
  451. RemoveBuildingForPlayer(playerid, 1461, 820.1484, -2061.0625, 12.5391, 0.25);
  452. RemoveBuildingForPlayer(playerid, 1461, 820.1484, -2055.2422, 12.5391, 0.25);
  453. RemoveBuildingForPlayer(playerid, 1280, 820.2813, -2019.0000, 12.2344, 0.25);
  454. RemoveBuildingForPlayer(playerid, 1280, 820.2813, -2015.0625, 12.2344, 0.25);
  455. RemoveBuildingForPlayer(playerid, 1280, 820.2813, -2002.9688, 12.2344, 0.25);
  456. RemoveBuildingForPlayer(playerid, 1280, 820.2813, -1999.0313, 12.2344, 0.25);
  457. RemoveBuildingForPlayer(playerid, 1280, 820.2813, -1968.7891, 12.2344, 0.25);
  458. RemoveBuildingForPlayer(playerid, 1280, 820.2813, -1977.1797, 12.2344, 0.25);
  459. RemoveBuildingForPlayer(playerid, 1280, 820.2813, -1924.5156, 12.2344, 0.25);
  460. RemoveBuildingForPlayer(playerid, 1280, 820.2813, -1932.9063, 12.2344, 0.25);
  461. RemoveBuildingForPlayer(playerid, 1280, 820.2813, -1901.1172, 12.2344, 0.25);
  462. RemoveBuildingForPlayer(playerid, 1280, 820.2813, -1892.7344, 12.2344, 0.25);
  463. RemoveBuildingForPlayer(playerid, 638, 820.3438, -2058.1641, 12.5391, 0.25);
  464. RemoveBuildingForPlayer(playerid, 638, 820.5859, -1928.2734, 12.5391, 0.25);
  465. RemoveBuildingForPlayer(playerid, 1231, 820.3594, -1885.0703, 14.5703, 0.25);
  466. RemoveBuildingForPlayer(playerid, 792, 820.9297, -2066.1797, 12.1719, 0.25);
  467. RemoveBuildingForPlayer(playerid, 792, 820.9297, -2036.6953, 12.1719, 0.25);
  468. RemoveBuildingForPlayer(playerid, 792, 820.9297, -2008.9141, 12.1719, 0.25);
  469. RemoveBuildingForPlayer(playerid, 1461, 820.7891, -2011.7969, 12.5391, 0.25);
  470. RemoveBuildingForPlayer(playerid, 792, 820.9297, -1991.4922, 12.1719, 0.25);
  471. RemoveBuildingForPlayer(playerid, 1461, 820.7891, -2005.9844, 12.5391, 0.25);
  472. RemoveBuildingForPlayer(playerid, 1231, 821.0078, -1986.0938, 14.5703, 0.25);
  473. RemoveBuildingForPlayer(playerid, 792, 820.9297, -1973.4922, 12.1719, 0.25);
  474. RemoveBuildingForPlayer(playerid, 1461, 820.7891, -1980.5625, 12.5391, 0.25);
  475. RemoveBuildingForPlayer(playerid, 1461, 820.7891, -1965.9766, 12.5391, 0.25);
  476. RemoveBuildingForPlayer(playerid, 792, 820.9297, -1950.1719, 12.1719, 0.25);
  477. RemoveBuildingForPlayer(playerid, 1461, 820.7891, -1936.2969, 12.5391, 0.25);
  478. RemoveBuildingForPlayer(playerid, 1231, 820.8359, -1917.7344, 14.5703, 0.25);
  479. RemoveBuildingForPlayer(playerid, 1461, 820.7891, -1921.7031, 12.5391, 0.25);
  480. RemoveBuildingForPlayer(playerid, 1231, 820.8359, -1907.5781, 14.5703, 0.25);
  481. RemoveBuildingForPlayer(playerid, 1461, 820.7891, -1904.5078, 12.5391, 0.25);
  482. RemoveBuildingForPlayer(playerid, 1461, 820.7891, -1889.9219, 12.5391, 0.25);
  483. RemoveBuildingForPlayer(playerid, 1231, 821.5469, -2048.8984, 14.5703, 0.25);
  484. RemoveBuildingForPlayer(playerid, 1281, 821.8125, -2042.2969, 12.6172, 0.25);
  485. RemoveBuildingForPlayer(playerid, 1281, 824.7969, -2036.6797, 12.6172, 0.25);
  486. RemoveBuildingForPlayer(playerid, 1281, 821.8125, -2031.3516, 12.6172, 0.25);
  487. RemoveBuildingForPlayer(playerid, 1231, 821.1094, -2023.7422, 14.5703, 0.25);
  488. RemoveBuildingForPlayer(playerid, 1231, 821.0703, -1996.2500, 14.5703, 0.25);
  489. RemoveBuildingForPlayer(playerid, 1231, 821.1016, -1961.1250, 14.5703, 0.25);
  490. RemoveBuildingForPlayer(playerid, 1281, 821.8125, -1956.0469, 12.6172, 0.25);
  491. RemoveBuildingForPlayer(playerid, 1231, 821.1016, -1940.6797, 14.5703, 0.25);
  492. RemoveBuildingForPlayer(playerid, 1281, 821.8125, -1945.1016, 12.6172, 0.25);
  493. RemoveBuildingForPlayer(playerid, 1281, 824.1563, -1950.4297, 12.6172, 0.25);
  494. RemoveBuildingForPlayer(playerid, 792, 821.0859, -1912.9766, 12.1719, 0.25);
  495. RemoveBuildingForPlayer(playerid, 792, 821.0859, -1897.0234, 12.1719, 0.25);
  496. RemoveBuildingForPlayer(playerid, 1281, 821.8125, -1879.9219, 12.6172, 0.25);
  497. RemoveBuildingForPlayer(playerid, 792, 821.0859, -1874.6250, 12.1719, 0.25);
  498. RemoveBuildingForPlayer(playerid, 1281, 824.1563, -1874.3047, 12.6172, 0.25);
  499. RemoveBuildingForPlayer(playerid, 1281, 821.8125, -1868.9766, 12.6172, 0.25);
  500. RemoveBuildingForPlayer(playerid, 792, 851.7969, -2049.0000, 12.1719, 0.25);
  501. RemoveBuildingForPlayer(playerid, 792, 851.7969, -2066.3594, 12.1719, 0.25);
  502. RemoveBuildingForPlayer(playerid, 1231, 852.4531, -2060.3359, 14.5703, 0.25);
  503. RemoveBuildingForPlayer(playerid, 1461, 852.7344, -2055.2422, 12.5391, 0.25);
  504. RemoveBuildingForPlayer(playerid, 638, 852.5313, -2058.1641, 12.5391, 0.25);
  505. RemoveBuildingForPlayer(playerid, 1280, 852.6094, -2042.5547, 12.2344, 0.25);
  506. RemoveBuildingForPlayer(playerid, 1231, 852.4531, -2039.6875, 14.5703, 0.25);
  507. RemoveBuildingForPlayer(playerid, 638, 852.5313, -2036.3906, 12.5391, 0.25);
  508. RemoveBuildingForPlayer(playerid, 1461, 852.7344, -2033.4688, 12.5391, 0.25);
  509. RemoveBuildingForPlayer(playerid, 1280, 852.6094, -2030.4531, 12.2344, 0.25);
  510. RemoveBuildingForPlayer(playerid, 1231, 851.7578, -2023.7422, 14.5703, 0.25);
  511. RemoveBuildingForPlayer(playerid, 1280, 852.6094, -2026.5234, 12.2344, 0.25);
  512. RemoveBuildingForPlayer(playerid, 792, 851.7969, -2018.0313, 12.1719, 0.25);
  513. RemoveBuildingForPlayer(playerid, 1281, 851.0078, -1992.5781, 12.6172, 0.25);
  514. RemoveBuildingForPlayer(playerid, 1231, 851.7578, -2012.7031, 14.5703, 0.25);
  515. RemoveBuildingForPlayer(playerid, 1231, 851.7578, -1994.9375, 14.5703, 0.25);
  516. RemoveBuildingForPlayer(playerid, 1280, 852.6094, -2008.8906, 12.2344, 0.25);
  517. RemoveBuildingForPlayer(playerid, 1280, 852.6094, -2004.9609, 12.2344, 0.25);
  518. RemoveBuildingForPlayer(playerid, 1461, 852.7344, -1997.3672, 12.5391, 0.25);
  519. RemoveBuildingForPlayer(playerid, 638, 852.5313, -2000.6406, 12.5391, 0.25);
  520. RemoveBuildingForPlayer(playerid, 1281, 848.5625, -1986.6719, 12.6172, 0.25);
  521. RemoveBuildingForPlayer(playerid, 792, 851.9766, -1986.8828, 12.1719, 0.25);
  522. RemoveBuildingForPlayer(playerid, 1281, 851.0078, -1981.6328, 12.6172, 0.25);
  523. RemoveBuildingForPlayer(playerid, 1231, 851.7578, -1978.5313, 14.5703, 0.25);
  524. RemoveBuildingForPlayer(playerid, 1280, 852.6094, -1974.2734, 12.2344, 0.25);
  525. RemoveBuildingForPlayer(playerid, 1280, 852.6094, -1970.3359, 12.2344, 0.25);
  526. RemoveBuildingForPlayer(playerid, 792, 851.7969, -1955.9297, 12.1719, 0.25);
  527. RemoveBuildingForPlayer(playerid, 1231, 852.2109, -1961.1250, 14.5703, 0.25);
  528. RemoveBuildingForPlayer(playerid, 1231, 852.2109, -1950.5938, 14.5703, 0.25);
  529. RemoveBuildingForPlayer(playerid, 638, 852.5313, -1965.3203, 12.5391, 0.25);
  530. RemoveBuildingForPlayer(playerid, 1280, 852.6094, -1942.2891, 12.2344, 0.25);
  531. RemoveBuildingForPlayer(playerid, 1280, 852.6094, -1946.2188, 12.2344, 0.25);
  532. RemoveBuildingForPlayer(playerid, 792, 851.7969, -1937.1875, 12.1719, 0.25);
  533. RemoveBuildingForPlayer(playerid, 1461, 852.7344, -1935.3750, 12.5391, 0.25);
  534. RemoveBuildingForPlayer(playerid, 1461, 852.7344, -1929.8125, 12.5391, 0.25);
  535. RemoveBuildingForPlayer(playerid, 638, 852.5313, -1932.3281, 12.5391, 0.25);
  536. RemoveBuildingForPlayer(playerid, 1280, 852.6094, -1926.6875, 12.2344, 0.25);
  537. RemoveBuildingForPlayer(playerid, 1280, 852.6094, -1922.7500, 12.2344, 0.25);
  538. RemoveBuildingForPlayer(playerid, 1231, 852.2109, -1918.7422, 14.5703, 0.25);
  539. RemoveBuildingForPlayer(playerid, 1281, 848.3281, -1909.3828, 12.6172, 0.25);
  540. RemoveBuildingForPlayer(playerid, 1281, 851.0078, -1904.3359, 12.6172, 0.25);
  541. RemoveBuildingForPlayer(playerid, 1281, 851.0078, -1915.2813, 12.6172, 0.25);
  542. RemoveBuildingForPlayer(playerid, 792, 851.7969, -1909.9063, 12.1719, 0.25);
  543. RemoveBuildingForPlayer(playerid, 1231, 852.2109, -1901.2422, 14.5703, 0.25);
  544. RemoveBuildingForPlayer(playerid, 1280, 852.6094, -1897.0234, 12.2344, 0.25);
  545. RemoveBuildingForPlayer(playerid, 638, 852.5313, -1886.8594, 12.5391, 0.25);
  546. RemoveBuildingForPlayer(playerid, 1280, 852.6094, -1893.0859, 12.2344, 0.25);
  547. RemoveBuildingForPlayer(playerid, 1461, 852.7344, -1883.3516, 12.5391, 0.25);
  548. RemoveBuildingForPlayer(playerid, 1461, 852.7344, -1889.8359, 12.5391, 0.25);
  549. RemoveBuildingForPlayer(playerid, 1231, 851.6250, -1879.7813, 14.5703, 0.25);
  550. RemoveBuildingForPlayer(playerid, 792, 851.7969, -1874.5859, 12.1719, 0.25);
  551. RemoveBuildingForPlayer(playerid, 1231, 851.6250, -1869.2500, 14.5703, 0.25);
  552. RemoveBuildingForPlayer(playerid, 1231, 820.3594, -1864.5547, 14.5703, 0.25);
  553. RemoveBuildingForPlayer(playerid, 1280, 820.2813, -1850.2109, 12.2344, 0.25);
  554. RemoveBuildingForPlayer(playerid, 1280, 820.2813, -1854.1484, 12.2344, 0.25);
  555. RemoveBuildingForPlayer(playerid, 1461, 820.7891, -1857.1641, 12.5391, 0.25);
  556. RemoveBuildingForPlayer(playerid, 638, 820.5859, -1860.0859, 12.5391, 0.25);
  557. RemoveBuildingForPlayer(playerid, 1231, 820.2656, -1839.8750, 14.5703, 0.25);
  558. RemoveBuildingForPlayer(playerid, 792, 820.5156, -1846.9375, 12.0469, 0.25);
  559. RemoveBuildingForPlayer(playerid, 1231, 819.1953, -1828.6875, 14.1016, 0.25);
  560. RemoveBuildingForPlayer(playerid, 1231, 852.2109, -1843.9766, 14.5391, 0.25);
  561. RemoveBuildingForPlayer(playerid, 792, 851.7969, -1848.8984, 12.1719, 0.25);
  562. RemoveBuildingForPlayer(playerid, 1461, 852.7344, -1851.8672, 12.5391, 0.25);
  563. RemoveBuildingForPlayer(playerid, 638, 852.5313, -1855.1094, 12.5391, 0.25);
  564. RemoveBuildingForPlayer(playerid, 1280, 852.6094, -1864.8828, 12.2344, 0.25);
  565. RemoveBuildingForPlayer(playerid, 1280, 852.6094, -1860.9531, 12.2344, 0.25);
  566. RemoveBuildingForPlayer(playerid, 1231, 853.9063, -1828.4531, 13.8516, 0.25);
  567. return 1;
  568. }
  569.  
  570. public OnPlayerDisconnect(playerid, reason)
  571. {
  572. new name[MAX_PLAYER_NAME], string[24+MAX_PLAYER_NAME];
  573. GetPlayerName(playerid, name, sizeof(name));
  574. format(string, sizeof(string), "<!>%s have just left the server!", name);
  575. SendClientMessageToAll(COLOR_WHITE, string);
  576. return 1;
  577. }
  578.  
  579. public OnPlayerSpawn(playerid)
  580. {
  581. SendClientMessage(playerid, COLOR_LIGHTBLUE, "<!>Checking your connection. Please wait.");
  582. LoadObjectsForPlayer( playerid );
  583. TextDrawShowForPlayer(playerid, Health[playerid]);
  584. GivePlayerWeapon(playerid, 24, 100);
  585. GivePlayerWeapon(playerid, 30, 100);
  586. SetPlayerSkillLevel(playerid, 24, 100);
  587. GameTextForPlayer(playerid, "Welcome", 5, 1);
  588. TextDrawShowForPlayer(playerid, ShadowsRandom);
  589. if(GetPlayerTeam(playerid) == TEAM_USA)
  590. {
  591. SetPlayerPos(playerid,-2281.3494,2288.4031,4.9661);//USA Spawn
  592. SetPlayerHealth(playerid,100);
  593. SetPlayerArmour(playerid,100);
  594. SendClientMessage(playerid, COLOR_LIGHTBLUE, "<!>You've made decision. You are now part of Team USA. Use /teamhelp to see commands! Enjoy!");
  595. }
  596. else if(GetPlayerTeam(playerid) == TEAM_RUSSIA)
  597. {
  598. SetPlayerHealth(playerid,100);
  599. SetPlayerArmour(playerid,100);
  600. SetPlayerPos(playerid,-1391.1643,496.9996,18.2344);//Russia spawn
  601. SendClientMessage(playerid, COLOR_LIGHTBLUE, "<!>You've made decision. You are now part of Team Russia. Use /teamhelp to see commands! Enjoy!");
  602. }
  603. TextDrawHideForPlayer(playerid, Text:Russian);
  604. TextDrawHideForPlayer(playerid, Text:USA);
  605. TextDrawShowForPlayer(playerid, Text:Warzone);
  606. return 1;
  607. }
  608. public LoadObjectsForPlayer( playerid )
  609. {
  610. if( IsPlayerConnected ( playerid ) )
  611. {
  612. TogglePlayerControllable( playerid, false );
  613.  
  614. if( GetPlayerPing ( playerid ) < 100 ) { SetTimerEx( "ObjectsLoaded", 3000, 0, "e", playerid ); SendClientMessage(playerid, COLOR_LIGHTBLUE, "<!>Your connection is checked and accepted! Enjoy your stay!"); }
  615. else if( GetPlayerPing ( playerid ) > 100 ) { SetTimerEx( "ObjectsLoaded", 3000, 0, "e", playerid ); SendClientMessage(playerid, COLOR_LIGHTBLUE, "<!>Your connection is checked and accepted! Enjoy your stay!"); }
  616. else if( GetPlayerPing ( playerid ) > 200 ) { SetTimerEx( "ObjectsLoaded", 3200, 0, "e", playerid ); SendClientMessage(playerid, COLOR_LIGHTBLUE, "<!>Your connection is checked and accepted! Enjoy your stay!"); }
  617. else if( GetPlayerPing ( playerid ) > 300 ) { SetTimerEx( "ObjectsLoaded", 3700, 0, "e", playerid ); SendClientMessage(playerid, COLOR_LIGHTBLUE, "<!>Your connection is checked and accepted! Enjoy your stay!"); }
  618. else if( GetPlayerPing ( playerid ) > 500 ) { SetTimerEx( "ObjectsLoaded", 4000, 0, "e", playerid ); SendClientMessage(playerid, COLOR_LIGHTBLUE, "<!>Your connection is checked and accepted! Enjoy your stay!"); }
  619. else { SetTimerEx( "ObjectsLoaded", 5000, 0, "e", playerid ); SendClientMessage(playerid, COLOR_LIGHTBLUE, "<!>Your connection is checked and accepted! Enjoy your stay!"); }
  620.  
  621. }
  622. return ( 1 );
  623. }
  624.  
  625. public ObjectsLoaded(playerid)
  626. {
  627. if( IsPlayerConnected ( playerid ) ) return TogglePlayerControllable( playerid, true ), PlayerPlaySound( playerid, 1056, 0.0, 0.0, 0.0 );
  628. return ( 1 );
  629. }
  630. public OnPlayerDeath(playerid, killerid, reason)
  631. {
  632. if(killerid != INVALID_PLAYER_ID)
  633. {
  634. SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
  635. GivePlayerMoney(killerid, 100);
  636. return 1;
  637. }
  638. ForceClassSelection(playerid);
  639. SendDeathMessage(playerid,killerid,reason);
  640. ResetPlayerWeapons(playerid);
  641. return 1;
  642. }
  643.  
  644. public OnVehicleSpawn(vehicleid)
  645. {
  646. return 1;
  647. }
  648.  
  649. public OnVehicleDeath(vehicleid, killerid)
  650. {
  651. return 1;
  652. }
  653. public OnPlayerText(playerid, text[])
  654. {
  655. new
  656. badWords[][] =
  657. {
  658. "bitch",
  659. "ass",
  660. "fuck",
  661. "nigger",
  662. "nigga",
  663. "jew",
  664. "retard",
  665. "whore",
  666. "hoe",
  667. "negro",
  668. "chongo",
  669. "nazzi",
  670. "noob"
  671. }
  672. ;
  673. for(new i; i != sizeof(badWords); ++i)
  674. {
  675. replaceSwear(text, badWords[i]);
  676. }
  677.  
  678.  
  679.  
  680. if(text[0] == '@')
  681. {
  682. new name[MAX_PLAYER_NAME], msg[128];
  683. GetPlayerName(playerid, name, sizeof(name));
  684.  
  685. format(msg, sizeof(msg), "[Team Chat] %s[%d]: %s", name, playerid, text[1]);
  686.  
  687. for(new i; i<=MAX_PLAYERS; i++)
  688. {
  689. if(GetPlayerTeam(playerid) == GetPlayerTeam(i))
  690. {
  691. SendClientMessage(i, COLOR_LIGHTBLUE, msg);
  692. }
  693. }
  694. return 0;
  695. }
  696. new Rank[20];
  697. switch(GetPlayerScore(playerid))
  698. {
  699. case 0 .. 10: format(Rank, sizeof(Rank),"[Private]");
  700. case 11 .. 20: format(Rank, sizeof(Rank),"[Private 2]");
  701. case 21 .. 30: format(Rank, sizeof(Rank), "[Private First Class]");
  702. case 31 .. 40: format(Rank, sizeof(Rank), "[Specialist]");
  703. case 41 .. 50: format(Rank, sizeof(Rank), "[Corporal]");
  704. case 51 .. 60: format(Rank, sizeof(Rank), "[Sergeant]");
  705. case 61 .. 70: format(Rank, sizeof(Rank), "[Serg. First Class]");
  706. case 71 .. 80: format(Rank, sizeof(Rank), "[Master Sergeant]");
  707. case 81 .. 90: format(Rank, sizeof(Rank), "[Sergeant Major]");
  708. case 91 .. 100: format(Rank, sizeof(Rank), "[General]");
  709. case 101 .. 150: format(Rank, sizeof(Rank), "[Grand Marshal]");
  710. case 151 .. 200: format(Rank, sizeof(Rank), "[God Of War]");
  711. }
  712. new ChatText[128], Nameasd[MAX_PLAYER_NAME];
  713. GetPlayerName(playerid, Nameasd, MAX_PLAYER_NAME);
  714. format(ChatText, sizeof(ChatText),"%s %s: %s", Rank, Nameasd, text);
  715. SendClientMessageToAll(COLOR_GREEN, ChatText);
  716. return 0;
  717. }
  718.  
  719. stock replaceSwear(string[], badWord[], replace = '*')
  720. {
  721. new
  722. i
  723. ;
  724. while((i = strfind(string, badWord, true)) != -1)
  725. {
  726. for(new x = (i + strlen(badWord)); i != x; ++i)
  727. {
  728. string[i] = replace;
  729. }
  730. }
  731. return 1;
  732. }
  733.  
  734. public OnPlayerCommandText(playerid, cmdtext[])
  735. {
  736. if (strcmp("/kill", cmdtext, true) == 0)
  737. {
  738. if(Cooldown[playerid] == 1) return SendClientMessage(playerid,COLOR_RED,"<!>Please Wait Before Using This Command Again!");
  739. {
  740. SetPlayerHealth(playerid, 0);
  741. SendClientMessage(playerid, COLOR_RED, "<!>You have just killed yourself, and lost 50$!");
  742. new name[MAX_PLAYER_NAME], string[24+MAX_PLAYER_NAME];
  743. GetPlayerName(playerid, name, sizeof(name));
  744. format(string, sizeof(string), "<!>%s have just used command /kill!", name);
  745. SendClientMessageToAll(COLOR_WHITE, string);
  746. GivePlayerMoney(playerid, -50);
  747. ResetPlayerWeapons(playerid);
  748. }
  749. return 1;
  750. }
  751. if (strcmp("/signal", cmdtext, true) == 0 || strcmp("/s", cmdtext, true) == 0)
  752. {
  753. if(Cooldown[playerid] == 1) return SendClientMessage(playerid,COLOR_RED,"<!>Please Wait Before Using This Command Again!");
  754. {
  755. new Float:x, Float:y, Float:z, SignalObj;
  756. GetPlayerPos(playerid, x, y, z);
  757. SetTimerEx( "Signal", 5000, false, "i", SignalObj );
  758. SignalObj = CreateObject(18714,x,y,z, 0.0, 0.0, 96.0);
  759. GameTextForPlayer(playerid, "Signal started", 1, 1);
  760. }
  761. return 1;
  762. }
  763. if (strcmp("/help", cmdtext, true) == 0 || strcmp("/h", cmdtext, true) == 0)
  764. {
  765. SendClientMessage(playerid, COLOR_WHITE, "|---------------------------------------------------------------------------------------------|");
  766. SendClientMessage(playerid, COLOR_LIGHTBLUE, "|<!> Commands: /(s)ignal, /kill, /(h)elp, /language, /teamhelp");
  767. SendClientMessage(playerid, COLOR_LIGHTBLUE, "|<!> Commands: /register, /login, /changepass, /stats, /resetstats, /time, /report");
  768. SendClientMessage(playerid, COLOR_LIGHTBLUE, "|<!> Commands: /getid, ");
  769. SendClientMessage(playerid, COLOR_LIGHTBLUE, "|---------------------------------------------------------------------------------------------|");
  770. return 1;
  771. }
  772. if (strcmp("/base", cmdtext, true) == 0)
  773. {
  774. if(!IsPlayerAdmin(playerid))
  775. {
  776. SendClientMessage(playerid, COLOR_RED, "<!>You must be an admin to use this command!");
  777. return 1;
  778. }
  779. SetPlayerPos(playerid, 396.7123,-3308.4155,7);
  780. return 1;
  781. }
  782. if (strcmp("/adminhelp", cmdtext, true) == 0 || (strcmp("/ah", cmdtext, true) == 0))
  783. {
  784. if(!IsPlayerAdmin(playerid))
  785. {
  786. SendClientMessage(playerid, COLOR_RED, "<!>You are not an admin!");
  787. return 1;
  788. }
  789. SendClientMessage(playerid, COLOR_LIGHTBLUE, "|============================================================================|");
  790. SendClientMessage(playerid, COLOR_WHITE, "Commands: /(a)dmin(h)elp, /base, /youtube");
  791. SendClientMessage(playerid, COLOR_LIGHTBLUE, "|============================================================================|");
  792. return 1;
  793. }
  794. if (strcmp("/Russiangateopen", cmdtext, true) == 0 || (strcmp("/Rgo", cmdtext, true) == 0))
  795. {
  796. if(!IsPlayerInRangeOfPoint(playerid, 20.0, -1530.72, 482.47, 7.85))
  797. {
  798. SendClientMessage(playerid, COLOR_RED, "<!>You are not in range of that gate!");
  799. return 1;
  800. }
  801. SendClientMessage(playerid, COLOR_YELLOW, "<!>You have just opened the gate!");
  802. MoveObject(gateR1, -1530.72, 482.47, -1.85, 2, 0.00, 0.00, 0.00);
  803. return 1;
  804. }
  805. if (strcmp("/russiangateclose", cmdtext, true) == 0 || (strcmp("/RGC", cmdtext, true) == 0))
  806. {
  807. if(!IsPlayerInRangeOfPoint(playerid, 50.0, -1530.72, 482.47, 7.85))
  808. {
  809. SendClientMessage(playerid, COLOR_RED, "<!>You are not in range of that gate!");
  810. return 1;
  811. }
  812. MoveObject(gateR1, -1530.72, 482.47, 7.85, 1, 0.00, 0.00, 0.00);
  813. SendClientMessage(playerid, COLOR_YELLOW, "<!>You have just closed the gate!"); //closed
  814. return 1;
  815. }
  816. if (strcmp("/teamhelp", cmdtext, true) == 0 || (strcmp("/th", cmdtext, true) == 0))
  817. {
  818. if(GetPlayerTeam(playerid) == 1)
  819. {
  820. SendClientMessage(playerid, COLOR_LIGHTBLUE, "|==========================================================|");
  821. SendClientMessage(playerid, COLOR_LIGHTBLUE, "Commands: /(R)ussian(G)ate(O)pen, /(R)ussian(G)ate(C)lose");
  822. SendClientMessage(playerid, COLOR_LIGHTBLUE, "Commands: /ruselevatordown, /ruselevatorup");
  823. SendClientMessage(playerid, COLOR_LIGHTBLUE, "|==========================================================|");
  824. return 1;
  825. }
  826. if(GetPlayerTeam(playerid) == 2)
  827. {
  828. SendClientMessage(playerid, COLOR_LIGHTBLUE, "|==========================================================|");
  829. SendClientMessage(playerid, COLOR_LIGHTBLUE, "Commands:");
  830. SendClientMessage(playerid, COLOR_LIGHTBLUE, "|==========================================================|");
  831. return 1;
  832. }
  833. }
  834. if (strcmp("/ruselevatorup", cmdtext, true) == 0)
  835. {
  836. if(GetPlayerTeam(playerid) == 1) MoveObject(elevator1, -1426.42, 478.65, 16.61, 2, 0.00, 0.00, 0.90);
  837. SendClientMessage(playerid, COLOR_LIGHTBLUE, "<!>Elevator is up now, use /elevatordown to get it down!");
  838. return 1;
  839. }
  840. if (strcmp("/ruselevatordown", cmdtext, true) == 0)
  841. {
  842. if(GetPlayerTeam(playerid) == 1) MoveObject(elevator1, -1426.42, 478.65, 5.61, 5, 0.00, 0.00, 0.90);
  843. SendClientMessage(playerid, COLOR_LIGHTBLUE, "<!>Elevator is down now, use command /elevator up to get it up!");
  844. return 1;
  845. }
  846. if (strcmp("/cc", cmdtext, true) == 0 || (strcmp("/clearchat", cmdtext, true) == 0))
  847. {
  848. for(new i = 0; i < 50; i++) SendClientMessageToAll(COLOR_WHITE," "); return 1;
  849. }
  850. if (strcmp("/playmusic", cmdtext, true) == 0)
  851. {
  852. ShowPlayerDialog(playerid,1,DIALOG_STYLE_LIST,"MyDialog","1. Hip Hop\n2. Tehno\n3. Reggae","Play", "Close");
  853. return 1;
  854. }
  855. if (strcmp("/netstats", cmdtext, true) == 0)
  856. {
  857. new stats[400+1];
  858. GetPlayerNetworkStats(playerid, stats, sizeof(stats));
  859. ShowPlayerDialog(playerid, 2, DIALOG_STYLE_MSGBOX, "Your network stats", stats, "Close", "");
  860. return 1;
  861. }
  862. if (strcmp("/serverstats", cmdtext, true) == 0)
  863. {
  864. new stats[400+1];
  865. GetNetworkStats(stats, sizeof(stats)); // get the servers networkstats
  866. ShowPlayerDialog(playerid, 3, DIALOG_STYLE_MSGBOX, "Server Network Stats", stats, "Close", "");
  867. return 1;
  868. }
  869. if (strcmp("/guns", cmdtext, true) == 0)
  870. {
  871. ShowPlayerDialog(playerid,2,DIALOG_STYLE_LIST,"Guns","1. Deagle (400$)\n2. Ak-47 (600$)\n3. M4 (600$)\n4. MP5 (500$)","Accept", "Close");
  872. return 1;
  873. }
  874. if (strcmp("/myscore", cmdtext, true) == 0)
  875. {
  876. new string[128];
  877. format(string, sizeof(string), "Score: %i",GetPlayerScore(playerid));
  878. SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
  879. return 1;
  880. }
  881. return SendClientMessage(playerid, COLOR_RED, "<!>Server didn't reconise your command! Try again!");
  882. }
  883. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  884. {
  885. return 1;
  886. }
  887.  
  888. public OnPlayerExitVehicle(playerid, vehicleid)
  889. {
  890. return 1;
  891. }
  892.  
  893. public OnPlayerStateChange(playerid, newstate, oldstate)
  894. {
  895. new szString[16];
  896. if(newstate == 2 && oldstate == 1)
  897. {
  898. format(szString, sizeof(szString), "~G~%s", VehicleNames2[GetVehicleModel(GetPlayerVehicleID(playerid))-400]);
  899. GameTextForPlayer(playerid, szString, 1337, 1);
  900. }
  901. return 1;
  902. }
  903.  
  904. public OnPlayerEnterCheckpoint(playerid)
  905. {
  906. return 1;
  907. }
  908.  
  909. public OnPlayerLeaveCheckpoint(playerid)
  910. {
  911. return 1;
  912. }
  913.  
  914. public OnPlayerEnterRaceCheckpoint(playerid)
  915. {
  916. return 1;
  917. }
  918.  
  919. public OnPlayerLeaveRaceCheckpoint(playerid)
  920. {
  921. return 1;
  922. }
  923.  
  924. public OnRconCommand(cmd[])
  925. {
  926. return 1;
  927. }
  928.  
  929. public OnPlayerRequestSpawn(playerid)
  930. {
  931. return 1;
  932. }
  933.  
  934. public OnObjectMoved(objectid)
  935. {
  936. return 1;
  937. }
  938.  
  939. public OnPlayerObjectMoved(playerid, objectid)
  940. {
  941. return 1;
  942. }
  943.  
  944. public OnPlayerPickUpPickup(playerid, pickupid)
  945. {
  946. if(pickupid == HPRus)
  947. {
  948. if(GetPlayerMoney(playerid) < 150) return SendClientMessage(playerid, COLOR_RED, "<!>You don't have enought money for this. (150$)");
  949. SetPlayerHealth(playerid, 100);
  950. GivePlayerMoney(playerid, -150);
  951. SendClientMessage(playerid, COLOR_LIGHTBLUE, "<!>Your health is refilled to it's maximum!");
  952. return 1;
  953. }
  954. if(pickupid == RusArmour)
  955. {
  956. if(GetPlayerMoney(playerid) < 200) return SendClientMessage(playerid, COLOR_RED, "<!>You don't have enought money for this. (200$)");
  957. SetPlayerArmour(playerid, 100);
  958. GivePlayerMoney(playerid, -200);
  959. SendClientMessage(playerid, COLOR_LIGHTBLUE, "<!>Your armour has been refilled to 100 percent!");
  960. return 1;
  961. }
  962. if(pickupid == HPUS)
  963. {
  964. if(GetPlayerMoney(playerid) < 200) return SendClientMessage(playerid, COLOR_RED, "<!>You don't have enought money to buy that!");
  965. SetPlayerHealth(playerid, 100);
  966. GivePlayerMoney(playerid, -150);
  967. SendClientMessage(playerid, COLOR_LIGHTBLUE, "<!>Your health is reffiled to it's maximum!");
  968. return 1;
  969. }
  970. if(pickupid == USArmour)
  971. {
  972. if(GetPlayerMoney(playerid) < 200) return SendClientMessage(playerid, COLOR_RED, "<!>You don't have enought money for this. (200$)");
  973. SetPlayerArmour(playerid, 100);
  974. GivePlayerMoney(playerid, -200);
  975. SendClientMessage(playerid, COLOR_LIGHTBLUE, "<!>Your armour has been refilled to 100 percent!");
  976. return 1;
  977. }
  978. return 1;
  979. }
  980.  
  981. public OnVehicleMod(playerid, vehicleid, componentid)
  982. {
  983. return 1;
  984. }
  985.  
  986. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  987. {
  988. return 1;
  989. }
  990.  
  991. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  992. {
  993. return 1;
  994. }
  995.  
  996. public OnPlayerSelectedMenuRow(playerid, row)
  997. {
  998. return 1;
  999. }
  1000.  
  1001. public OnPlayerExitedMenu(playerid)
  1002. {
  1003. return 1;
  1004. }
  1005.  
  1006. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  1007. {
  1008. return 1;
  1009. }
  1010.  
  1011. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  1012. {
  1013. return 1;
  1014. }
  1015.  
  1016. public OnRconLoginAttempt(ip[], password[], success)
  1017. {
  1018. return 1;
  1019. }
  1020.  
  1021. public OnPlayerUpdate(playerid)
  1022. {
  1023. new vehicleid,Float:speed_x,Float:speed_y,Float:speed_z,Float:final_speed,speed_string[256],final_speed_int;
  1024. vehicleid = GetPlayerVehicleID(playerid);
  1025. if(vehicleid != 0)
  1026. {
  1027. GetVehicleVelocity(vehicleid,speed_x,speed_y,speed_z);
  1028. final_speed = floatsqroot(((speed_x*speed_x)+(speed_y*speed_y))+(speed_z*speed_z))*136.666667;
  1029. final_speed_int = floatround(final_speed,floatround_round);
  1030. format(speed_string,256,"Vehicle Speed: %i",final_speed_int);
  1031. TextDrawSetString(SPEEDOS[playerid], speed_string);
  1032. }
  1033. else
  1034. {
  1035. TextDrawSetString(SPEEDOS[playerid], " ");
  1036. }
  1037. new Float:pArmour;
  1038. GetPlayerArmour(playerid, pArmour);
  1039. if(pArmour == 0){
  1040. TextDrawHideForPlayer(playerid, Armour[playerid]);
  1041. }else{
  1042. TextDrawShowForPlayer(playerid, Armour[playerid]);
  1043. }
  1044. {
  1045. if(GetPlayerPing(playerid) > 1000) Kick(playerid);
  1046. }
  1047.  
  1048. if(GetPlayerScore(playerid) == 11)
  1049. {
  1050. GivePlayerMoney(playerid, 1000);
  1051. SendClientMessage(playerid, COLOR_LIGHTBLUE, "<!>Congradulations! You have reached 10 score and you have became Private 2!");
  1052. SendClientMessage(playerid, COLOR_LIGHTBLUE, "<!>You have been awarded with 1000$!");
  1053. return 1;
  1054. }
  1055. if(GetPlayerScore(playerid) == 21)
  1056. {
  1057. GivePlayerMoney(playerid, 2000);
  1058. SendClientMessage(playerid, COLOR_LIGHTBLUE, "<!>Congradulations! You have reached 20 score and you have became Private 1st Class!");
  1059. SendClientMessage(playerid, COLOR_LIGHTBLUE, "<!>You have been awarded with 2000$!");
  1060. return 1;
  1061. }
  1062. if(GetPlayerScore(playerid) == 31)
  1063. {
  1064. GivePlayerMoney(playerid, 3000);
  1065. SendClientMessage(playerid, COLOR_LIGHTBLUE, "<!>Congradulations! You have reached 30 score and you have became Specialist!");
  1066. SendClientMessage(playerid, COLOR_LIGHTBLUE, "<!>You have been awarded with 3000$!");
  1067. return 1;
  1068. }
  1069. if(GetPlayerScore(playerid) == 41)
  1070. {
  1071. GivePlayerMoney(playerid, 4000);
  1072. SendClientMessage(playerid, COLOR_LIGHTBLUE, "<!>Congradulations! You have reached 40 score and you have became Corporal!");
  1073. SendClientMessage(playerid, COLOR_LIGHTBLUE, "<!>You have been awarded with 4000$!");
  1074. return 1;
  1075. }
  1076. if(GetPlayerScore(playerid) == 51)
  1077. {
  1078. GivePlayerMoney(playerid, 5000);
  1079. SendClientMessage(playerid, COLOR_LIGHTBLUE, "<!>Congradulations! You have reached 50 score and you have became Sargeant!");
  1080. SendClientMessage(playerid, COLOR_LIGHTBLUE, "<!>You have been awarded with 5000$!");
  1081. SendClientMessage(playerid, COLOR_LIGHTBLUE, "<!>Since you have reached 50 score, you can now buy a vehicle! Type /buyvehicle!");
  1082. return 1;
  1083. }
  1084. if(GetPlayerScore(playerid) == 61)
  1085. {
  1086. GivePlayerMoney(playerid, 6000);
  1087. SendClientMessage(playerid, COLOR_LIGHTBLUE, "<!>Congradulations! You have reached 60 score and you have became Sarg. First Class!");
  1088. SendClientMessage(playerid, COLOR_LIGHTBLUE, "<!>You have been awarded with 6000$!");
  1089. return 1;
  1090. }
  1091. if(GetPlayerScore(playerid) == 71)
  1092. {
  1093. GivePlayerMoney(playerid, 7000);
  1094. SendClientMessage(playerid, COLOR_LIGHTBLUE, "<!>Congradulations! You have reached 70 score and you have became Master Sergeant!");
  1095. SendClientMessage(playerid, COLOR_LIGHTBLUE, "<!>You have been awarded with 7000$!");
  1096. return 1;
  1097. }
  1098. if(GetPlayerScore(playerid) == 81)
  1099. {
  1100. GivePlayerMoney(playerid, 8000);
  1101. SendClientMessage(playerid, COLOR_LIGHTBLUE, "<!>Congradulations! You have reached 80 score and you have became Sargeant Major!");
  1102. SendClientMessage(playerid, COLOR_LIGHTBLUE, "<!>You have been awarded with 8000$!");
  1103. return 1;
  1104. }
  1105. if(GetPlayerScore(playerid) == 91)
  1106. {
  1107. GivePlayerMoney(playerid, 9000);
  1108. SendClientMessage(playerid, COLOR_LIGHTBLUE, "<!>Congradulations! You have reached 90 score and you have became General!");
  1109. SendClientMessage(playerid, COLOR_LIGHTBLUE, "<!>You have been awarded with 9000$!");
  1110. SendClientMessage(playerid, COLOR_LIGHTBLUE, "<!>Since you have reached General rank you can now buy your own aircraft! /buyair!");
  1111. return 1;
  1112. }
  1113. if(GetPlayerScore(playerid) == 101)
  1114. {
  1115. GivePlayerMoney(playerid, 10000);
  1116. SendClientMessage(playerid, COLOR_LIGHTBLUE, "<!>Congradulations! You have reached 100 score and you have became Grand Marshal!");
  1117. SendClientMessage(playerid, COLOR_LIGHTBLUE, "<!>You have been awarded with 10 000$!");
  1118. return 1;
  1119. }
  1120. if(GetPlayerScore(playerid) == 151)
  1121. {
  1122. GivePlayerMoney(playerid, 100000);
  1123. SendClientMessage(playerid, COLOR_LIGHTBLUE, "<!>Congradulations! You have became God Of War!");
  1124. SendClientMessage(playerid, COLOR_LIGHTBLUE, "<!>You can now get a free V.I.P!");
  1125. SendClientMessage(playerid, COLOR_LIGHTBLUE, "<!>Type /vip to get it!");
  1126. GameTextForPlayer(playerid, "You are now God of War!", 5, 1);
  1127. new name[MAX_PLAYER_NAME], string[24+MAX_PLAYER_NAME];
  1128. GetPlayerName(playerid, name, sizeof(name));
  1129. format(string, sizeof(string), "<!>%s has just became God Of War. Congradulate him!", name);
  1130. SendClientMessageToAll(COLOR_RED, string);
  1131. return 1;
  1132. }
  1133. return 1;
  1134. }
  1135.  
  1136. public OnPlayerStreamIn(playerid, forplayerid)
  1137. {
  1138. return 1;
  1139. }
  1140.  
  1141. public OnPlayerStreamOut(playerid, forplayerid)
  1142. {
  1143. return 1;
  1144. }
  1145.  
  1146. public OnVehicleStreamIn(vehicleid, forplayerid)
  1147. {
  1148. return 1;
  1149. }
  1150.  
  1151. public OnVehicleStreamOut(vehicleid, forplayerid)
  1152. {
  1153. return 1;
  1154. }
  1155.  
  1156. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  1157. {
  1158. if(dialogid == 2)
  1159. {
  1160. if(response)
  1161. {
  1162. switch(listitem)
  1163. {
  1164. case 0:
  1165. {
  1166. if(GetPlayerMoney(playerid) <400) return SendClientMessage(playerid, COLOR_RED, "<!>You don't have enought money! Required 400$!");
  1167. GivePlayerWeapon(playerid, 24, 100);
  1168. SendClientMessage(playerid, COLOR_LIGHTBLUE, "<!>You have bought a deagle with 100 bullets!");
  1169. return 1;
  1170. }
  1171. case 1:
  1172. {
  1173. if(GetPlayerMoney(playerid) <600) return SendClientMessage(playerid, COLOR_RED, "<!>You don't have enought money! Required 600$!");
  1174. GivePlayerWeapon(playerid, 30, 100);
  1175. SendClientMessage(playerid, COLOR_LIGHTBLUE, "<!>You have bought an AK-47 with 100 bullets!");
  1176. return 1;
  1177. }
  1178. case 2:
  1179. {
  1180. if(GetPlayerMoney(playerid) <600) return SendClientMessage(playerid, COLOR_RED, "<!>You don't have enought money! Required 600$!");
  1181. GivePlayerWeapon(playerid, 31, 100);
  1182. SendClientMessage(playerid, COLOR_LIGHTBLUE, "<!>You have bought an M4 with 100 bullets!");
  1183. return 1;
  1184. }
  1185. case 3:
  1186. {
  1187. if(GetPlayerMoney(playerid) <500) return SendClientMessage(playerid, COLOR_RED, "<!>You don't have enought money! Required 500$!");
  1188. GivePlayerWeapon(playerid, 29, 100);
  1189. SendClientMessage(playerid, COLOR_LIGHTBLUE, "<!>You have bought an MP5 with 100bullets!");
  1190. return 1;
  1191. }
  1192. }
  1193. }
  1194. }
  1195. if(dialogid == 1)
  1196. {
  1197. if(response)
  1198. {
  1199. switch(listitem)
  1200. {
  1201. case 0:
  1202. {
  1203. PlayAudioStreamForPlayer(playerid, "http://www.181.fm/playing.php?station=181-ball&embed=1");
  1204. SendClientMessage(playerid, COLOR_LIGHTBLUE, "<!>You are listening 181 FM!");
  1205. }
  1206. case 1:
  1207. {
  1208. PlayAudioStreamForPlayer(playerid, "http://www.fear.fm/radio/player");
  1209. SendClientMessage(playerid, COLOR_LIGHTBLUE, "<!>You are listening to fear FM!");
  1210. }
  1211. case 2:
  1212. {
  1213. PlayAudioStreamForPlayer(playerid, "http://www.internet-radio.com/tools/playlistgenerator/?u=http://www.internet-radio.com/station/ebonyradio/&t=.pls");
  1214. SendClientMessage(playerid, COLOR_LIGHTBLUE, "<!>You are listening to Ebony Radio!");
  1215. }
  1216. }
  1217. }
  1218. }
  1219. if(dialogid == 0 && response == 1)
  1220. {
  1221. new pName[MAX_PLAYER_NAME],gName[MAX_PLAYER_NAME],string[128];
  1222. new giveplayerid = GetPVarInt(playerid,"ClickedPlayer");
  1223. GetPlayerName(playerid,pName,sizeof pName);
  1224. GetPlayerName(giveplayerid,gName,sizeof gName);
  1225. format(string,sizeof string,"[PM] From %s: %s",pName,inputtext);
  1226. SendClientMessage(giveplayerid,0x00ff00ff,string);
  1227. format(string,sizeof string,"[PM] Send to %s: %s",gName,inputtext);
  1228. SendClientMessage(playerid,0x00ff00ff,string);
  1229. return 1;
  1230. }
  1231. return 1;
  1232. }
  1233.  
  1234. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  1235. {
  1236. SetPVarInt(playerid,"ClickedPlayer",clickedplayerid); // Save clickedplayerid in a PVar.
  1237. ShowPlayerDialog(playerid,0,DIALOG_STYLE_INPUT,"PM","Type a message to send to the clicked player!","Send","Cancel");
  1238. return 1;
  1239. }
  1240.  
  1241. forward vitals(playerid);
  1242. public vitals(playerid)
  1243. {
  1244. new string[5]
  1245. ;new Float:pHealth, Float:pArmour;
  1246. GetPlayerHealth(playerid,pHealth);
  1247. GetPlayerArmour(playerid,pArmour);
  1248. format(string, sizeof(string), "%.0f%", pHealth);
  1249. TextDrawSetString(Health[playerid], string);
  1250. format(string, sizeof(string), "%.0f%", pArmour);
  1251. TextDrawSetString(Armour[playerid], string);
  1252. }
  1253. forward Signal( objectid );
  1254. public Signal( objectid )
  1255. {
  1256. DestroyObject( objectid );
  1257. return 1;
  1258. }
  1259. forward TimeServerRunning();
  1260. forward CooldownTimer();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement