Advertisement
Guest User

Untitled

a guest
Jan 1st, 2012
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 28.90 KB | None | 0 0
  1. // This is a comment
  2. // uncomment the line below if you want to write a filterscript
  3. //#define FILTERSCRIPT
  4. //Scripted by Sufyan & Akhil..
  5. #include <a_samp>
  6.  
  7. new Stats[MAX_PLAYERS];
  8. new Position;
  9. #define purple 0x800080AA
  10. #define COLOR_RED 0xFF0000AA
  11. #define RED "{F81414}"
  12. #define LIGHTBLUE "{00C0FF}"
  13. #define LRED "{FFA1A1}"
  14. #define GREEN "{6EF83C}"
  15. #define GREY "{C3C3C3}"
  16.  
  17. #define GM2 2
  18. new GameMinutes =2;
  19. new GameSeconds =59;
  20. new GameTimer;
  21. new Text:Textdraw0;
  22. new Text:Textdraw5;
  23. forward GameTime(playerid);
  24. forward One(playerid);
  25. forward Two(playerid);
  26. forward Three(playerid);
  27. forward Four(playerid);
  28. forward Five(playerid);
  29. forward GoGoGo(playerid);
  30. //
  31. new iCountdown = 4;
  32. new iStartCountdown;
  33. new bool: iTimeToExit;
  34. new iTimerToExit;
  35. new Text:Textdraw1;new Text:Textdraw2;
  36. forward GameOver(playerid);
  37. forward iTimerToStartCountdown ( ) ;
  38. forward iStartRace ( ) ;
  39. forward iExitGameMode (playerid) ;
  40. forward iStartRace ( ) ;
  41. new bool: iRaceIsStarted ;
  42. #pragma tabsize 0
  43. new B[60];
  44. #define TOP5 false
  45. new
  46. Text: text_Top5[2]
  47. ;
  48.  
  49. enum rankingEnum
  50. {
  51. player_Score,
  52. player_ID
  53. }
  54. main()
  55. {
  56. print("\n----------------------------------");
  57. print(" Alloy Wheels Of Steel \n GM No: 2 \n Date Created: 6/5/2011");
  58. print("----------------------------------\n");
  59. }
  60.  
  61. public OnGameModeInit()
  62. {
  63. SetTimer("BlueTeam",178000,0);
  64. UsePlayerPedAnims();
  65. for(new i;i<15;++i)
  66. {
  67. SendClientMessageToAll(purple," ");
  68. }
  69. // Don't use these lines if it's a filterscript
  70. SetGameModeText("Alloy Wheels Of Steel");
  71. AddPlayerClass(73, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  72.  
  73. //TextDraw
  74. GameTimer = SetTimer("GameTime",1000,1);
  75. // Count1 = SetTimer("Time",1000,1);
  76.  
  77. Textdraw0 = TextDrawCreate(586.000000, 43.000000,"3:00");
  78. TextDrawAlignment(Textdraw0,2);
  79. TextDrawBackgroundColor(Textdraw0,0x000000ff);
  80. TextDrawFont(Textdraw0,3);
  81. TextDrawLetterSize(Textdraw0,0.499999,2.000000);
  82. TextDrawColor(Textdraw0,0xffffffff);
  83. TextDrawSetOutline(Textdraw0,1);
  84. TextDrawSetProportional(Textdraw0,1);
  85. TextDrawSetShadow(Textdraw0,1);
  86.  
  87. Textdraw5 = TextDrawCreate(306.000000, 114.000000, " ");
  88. TextDrawBackgroundColor(Textdraw5, 255);
  89. TextDrawFont(Textdraw5, 2);
  90. TextDrawLetterSize(Textdraw5, 1.290000, 7.700000);
  91. TextDrawColor(Textdraw5, -1);
  92. TextDrawSetOutline(Textdraw5, 0);
  93. TextDrawSetProportional(Textdraw5, 0);
  94. TextDrawSetShadow(Textdraw5, 1);
  95.  
  96. SetTimer("StartGame",1,0);
  97.  
  98. text_Top5[0] = TextDrawCreate(79.000000, 135.000000, "Top 5");
  99. TextDrawAlignment(text_Top5[0], 2);
  100. TextDrawBackgroundColor(text_Top5[0], 255);
  101. TextDrawFont(text_Top5[0], 1);
  102. TextDrawLetterSize(text_Top5[0], 0.280000, 1.499999);
  103. TextDrawColor(text_Top5[0], -1);
  104. TextDrawSetOutline(text_Top5[0], 0);
  105. TextDrawSetProportional(text_Top5[0], 1);
  106. TextDrawSetShadow(text_Top5[0], 0);
  107.  
  108. text_Top5[1] = TextDrawCreate(16.000000, 135.000000, " ");
  109. TextDrawBackgroundColor(text_Top5[1], 255);
  110. TextDrawFont(text_Top5[1], 1);
  111. TextDrawLetterSize(text_Top5[1], 0.200000, 0.999999);
  112. TextDrawColor(text_Top5[1], -1);
  113. TextDrawSetOutline(text_Top5[1], 0);
  114. TextDrawSetProportional(text_Top5[1], 1);
  115. TextDrawSetShadow(text_Top5[1], 0);
  116. TextDrawUseBox(text_Top5[1], 1);
  117. TextDrawBoxColor(text_Top5[1], 150);
  118. TextDrawTextSize(text_Top5[1], 143.000000, 20.000000);
  119. SetTimer("GameOver",180000,false);
  120. //
  121. SetTimer ( "iTimerToStartCountdown" , 10000 , true ) ;
  122.  
  123. if ( iTimeToExit == true ) {
  124. iTimerToExit = SetTimer ( "iExitGameMode" , 180000 , true ) ;
  125. iTimerToExit = false ;
  126. }
  127.  
  128. //Vehicles
  129. B[0] = AddStaticVehicle(463,-1122.76806641,1099.78759766,37.70999527,138.00000000,-1,-1); //Freeway
  130. B[1] = AddStaticVehicle(463,-1123.81933594,1100.51110840,37.70817184,137.99926758,-1,-1); //Freeway
  131. B[2] = AddStaticVehicle(463,-1124.82678223,1101.29309082,37.71192551,137.99926758,-1,-1); //Freeway
  132. B[3] = AddStaticVehicle(463,-1125.68176270,1102.10302734,37.71203613,137.99926758,-1,-1); //Freeway
  133. B[4] = AddStaticVehicle(463,-1126.47692871,1103.00073242,37.71692276,137.99926758,-1,-1); //Freeway
  134. B[5] = AddStaticVehicle(463,-1127.39294434,1103.50695801,37.72463226,137.99926758,-1,-1); //Freeway
  135. B[6] = AddStaticVehicle(463,-1128.12927246,1104.32885742,37.72211838,137.99926758,-1,-1); //Freeway
  136. B[7] = AddStaticVehicle(463,-1128.97009277,1105.03344727,37.72415543,137.99926758,-1,-1); //Freeway
  137. B[8] = AddStaticVehicle(463,-1129.84228516,1105.81628418,37.72518158,137.99926758,-1,-1); //Freeway
  138. B[9] = AddStaticVehicle(463,-1134.35205078,1109.77416992,37.72369766,137.99926758,-1,-1); //Freeway
  139. B[10] = AddStaticVehicle(463,-1135.09960938,1110.30078125,37.72683716,137.99926758,-1,-1); //Freeway
  140. B[11] = AddStaticVehicle(463,-1135.83166504,1111.01599121,37.72648239,137.99926758,-1,-1); //Freeway
  141. B[12] = AddStaticVehicle(463,-1136.56811523,1111.73486328,37.72613525,137.99926758,-1,-1); //Freeway
  142. B[13] = AddStaticVehicle(463,-1137.28076172,1112.46032715,37.72516251,137.99926758,-1,-1); //Freeway
  143. B[14] = AddStaticVehicle(463,-1138.08618164,1113.19995117,37.73755264,137.99926758,-1,-1); //Freeway
  144. B[15] = AddStaticVehicle(463,-1138.97180176,1113.96594238,37.73932266,137.99926758,-1,-1); //Freeway
  145. B[16] = AddStaticVehicle(463,-1139.88903809,1114.63232422,37.73188400,137.99926758,-1,-1); //Freeway
  146. B[17] = AddStaticVehicle(463,-1140.75561523,1115.38208008,37.73352432,137.99926758,-1,-1); //Freeway
  147. B[18] = AddStaticVehicle(463,-1141.89880371,1116.17529297,37.73984146,137.99926758,-1,-1); //Freeway
  148. B[19] = AddStaticVehicle(463,-1120.37792969,1102.60485840,37.60331726,137.99926758,-1,-1); //Freeway
  149. B[20] = AddStaticVehicle(463,-1121.36303711,1103.39318848,37.59843063,137.99926758,-1,-1); //Freeway
  150. B[21] = AddStaticVehicle(463,-1122.38562012,1104.14404297,37.60314178,137.99926758,-1,-1); //Freeway
  151. B[22] = AddStaticVehicle(463,-1123.17810059,1104.86840820,37.60379791,137.99926758,-1,-1); //Freeway
  152. B[23] = AddStaticVehicle(463,-1123.98852539,1105.69812012,37.61041641,137.99926758,-1,-1); //Freeway
  153. B[24] = AddStaticVehicle(463,-1125.07739258,1106.42395020,37.61697769,137.99926758,-1,-1); //Freeway
  154. B[25] = AddStaticVehicle(463,-1126.03796387,1107.20471191,37.61981964,137.99926758,-1,-1); //Freeway
  155. B[26] = AddStaticVehicle(463,-1127.08886719,1107.81726074,37.62800217,137.99926758,-1,-1); //Freeway
  156. B[27] = AddStaticVehicle(463,-1128.13281250,1108.51574707,37.64270401,137.99926758,-1,-1); //Freeway
  157. B[28] = AddStaticVehicle(463,-1132.37731934,1111.84167480,37.63898849,137.99926758,-1,-1); //Freeway
  158. B[29] = AddStaticVehicle(463,-1133.12463379,1112.54113770,37.63978577,137.99926758,-1,-1); //Freeway
  159. B[30] = AddStaticVehicle(463,-1133.98608398,1113.20532227,37.64253616,137.99926758,-1,-1); //Freeway
  160. B[31] = AddStaticVehicle(463,-1134.78430176,1113.88073730,37.64436722,137.99926758,-1,-1); //Freeway
  161. B[32] = AddStaticVehicle(463,-1135.60278320,1114.54187012,37.64691162,137.99926758,-1,-1); //Freeway
  162. B[33] = AddStaticVehicle(463,-1136.40258789,1115.37341309,37.64545822,137.99926758,-1,-1); //Freeway
  163. B[34] = AddStaticVehicle(463,-1137.31958008,1116.30322266,37.64428711,137.99926758,-1,-1); //Freeway
  164. B[35] = AddStaticVehicle(463,-1138.33374023,1117.11572266,37.64758301,137.99926758,-1,-1); //Freeway
  165. B[36] = AddStaticVehicle(463,-1139.15002441,1117.69287109,37.65186691,137.99926758,-1,-1); //Freeway
  166. B[37] = AddStaticVehicle(463,-1139.91760254,1118.54602051,37.64841843,137.99926758,-1,-1); //Freeway
  167. B[38] = AddStaticVehicle(463,-1140.85131836,1119.22021484,37.65206909,137.99926758,-1,-1); //Freeway
  168. B[39] = AddStaticVehicle(463,-1143.03820801,1116.99584961,37.74423599,137.99926758,-1,-1); //Freeway
  169. B[40] = AddStaticVehicle(463,-1118.51025391,1104.81396484,37.51979446,137.99926758,-1,-1); //Freeway
  170. B[41] = AddStaticVehicle(463,-1119.57885742,1105.79321289,37.51936340,137.99926758,-1,-1); //Freeway
  171. B[42] = AddStaticVehicle(463,-1120.60327148,1106.79443359,37.51176834,137.99926758,-1,-1); //Freeway
  172. B[43] = AddStaticVehicle(463,-1121.78955078,1107.63439941,37.51788330,137.99926758,-1,-1); //Freeway
  173. B[44] = AddStaticVehicle(463,-1122.79357910,1108.74316406,37.52251816,137.99926758,-1,-1); //Freeway
  174. B[45] = AddStaticVehicle(463,-1124.07226562,1109.70764160,37.52786636,137.99926758,-1,-1); //Freeway
  175. B[46] = AddStaticVehicle(463,-1125.43945312,1110.83374023,37.53478622,137.99926758,-1,-1); //Freeway
  176. B[47] = AddStaticVehicle(463,-1130.13793945,1114.44213867,37.54105759,137.99926758,-1,-1); //Freeway
  177. B[48] = AddStaticVehicle(463,-1131.23901367,1115.32543945,37.54327011,137.99926758,-1,-1); //Freeway
  178. B[49] = AddStaticVehicle(463,-1132.35986328,1116.26672363,37.54451370,137.99926758,-1,-1); //Freeway
  179. B[50] = AddStaticVehicle(463,-1133.64172363,1117.44860840,37.54538345,137.99926758,-1,-1); //Freeway
  180. B[51] = AddStaticVehicle(463,-1134.89270020,1118.55883789,37.54715347,137.99926758,-1,-1); //Freeway
  181. B[52] = AddStaticVehicle(463,-1136.19348145,1119.51025391,37.55330276,137.99926758,-1,-1); //Freeway
  182. B[53] = AddStaticVehicle(463,-1137.33703613,1120.42651367,37.55601883,137.99926758,-1,-1); //Freeway
  183. B[54] = AddStaticVehicle(463,-1138.51257324,1121.45642090,37.55663681,137.99926758,-1,-1); //Freeway
  184.  
  185.  
  186.  
  187. CreateObject(16061,-1079.14648438,1174.96044922,37.26702499,0.00000000,0.00000000,58.00000000); //object(des_treeline2)(2)
  188. CreateObject(1074,-1123.27001953,1095.54089355,37.88275146,0.00000000,0.00000000,136.00000000); //object(wheel_sr3)(1)
  189. CreateObject(1074,-1122.34045410,1096.74597168,37.83177185,0.00000000,0.00000000,135.99975586); //object(wheel_sr3)(2)
  190. CreateObject(1074,-1121.50988770,1097.78454590,37.79056931,0.00000000,0.00000000,135.99975586); //object(wheel_sr3)(3)
  191. CreateObject(1074,-1120.72363281,1098.68859863,37.75334549,0.00000000,0.00000000,135.99975586); //object(wheel_sr3)(4)
  192. CreateObject(1074,-1119.92407227,1099.44995117,37.71903992,0.00000000,0.00000000,135.99975586); //object(wheel_sr3)(5)
  193. CreateObject(1074,-1119.02453613,1100.41674805,37.67797089,0.00000000,0.00000000,135.99975586); //object(wheel_sr3)(6)
  194. CreateObject(1074,-1118.17187500,1101.52246094,37.63478470,0.00000000,0.00000000,135.99975586); //object(wheel_sr3)(7)
  195. CreateObject(1074,-1117.27746582,1102.51367188,37.59327316,0.00000000,0.00000000,135.99975586); //object(wheel_sr3)(8)
  196. CreateObject(1074,-1116.35620117,1103.55126953,37.55014038,0.00000000,0.00000000,135.99975586); //object(wheel_sr3)(9)
  197. CreateObject(1074,-1145.32238770,1116.91870117,37.87223816,0.00000000,0.00000000,323.99975586); //object(wheel_sr3)(10)
  198. CreateObject(1074,-1144.89416504,1117.52526855,37.84626770,0.00000000,0.00000000,323.99780273); //object(wheel_sr3)(11)
  199. CreateObject(1074,-1145.08605957,1123.54650879,37.95278168,0.00000000,0.00000000,323.99780273); //object(wheel_sr3)(12)
  200. CreateObject(1074,-1146.32373047,1122.28344727,38.21734619,0.00000000,0.00000000,323.99780273); //object(wheel_sr3)(13)
  201. CreateObject(1074,-1148.01269531,1120.55969238,38.15547180,0.00000000,0.00000000,323.99780273); //object(wheel_sr3)(14)
  202. CreateObject(1074,-1141.88916016,1126.79797363,37.66928864,0.00000000,0.00000000,323.99780273); //object(wheel_sr3)(15)
  203. CreateObject(1074,-1143.74377441,1124.90527344,37.64550781,0.00000000,0.00000000,323.99780273); //object(wheel_sr3)(16)
  204. CreateObject(1074,-1144.67077637,1120.09143066,37.78042984,0.00000000,0.00000000,323.99780273); //object(wheel_sr3)(17)
  205.  
  206.  
  207.  
  208. return 1;
  209. }
  210.  
  211. public OnGameModeExit()
  212. {
  213. TextDrawDestroy(text_Top5[0]);
  214. TextDrawDestroy(text_Top5[1]);
  215.  
  216.  
  217.  
  218.  
  219. return 1;
  220. }
  221.  
  222. public OnPlayerRequestClass(playerid, classid)
  223. {
  224.  
  225. SetPlayerInterior(playerid,11);
  226. SetPlayerPos(playerid,508.7362,-87.4335,998.9609);
  227. SetPlayerCameraPos(playerid,508.7362,-83.4335,998.9609);
  228. SetPlayerCameraLookAt(playerid,508.7362,-87.4335,998.9609);
  229. SetPlayerFacingAngle(playerid,0.0);
  230. return 1;
  231. }
  232. forward BlueTeam();
  233. public BlueTeam( )
  234. {
  235. GameTextForAll("~g~Race Time ~r~Has Passed!!",2500,3);
  236. SetTimer("GameModeExitFunc",2000,0);
  237.  
  238. }
  239. //---------------------------------
  240. public OnPlayerConnect(playerid)
  241. {
  242. GameTextForPlayer(playerid,"~w~Alloy~y~ Wheels ~n~~r~Of ~w~Steel~b~!",3000,1);
  243.  
  244. return 1;
  245. }
  246.  
  247. public OnPlayerDisconnect(playerid, reason)
  248. {
  249. new veh;
  250. veh = GetPlayerVehicleID(playerid);
  251. SetVehicleToRespawn(veh);
  252. //kujh mat kar k
  253. return 1;
  254. }
  255.  
  256. public OnPlayerSpawn(playerid)
  257. {
  258. SetPlayerRaceCheckpoint(playerid,0,-1206.5160,1024.8600,42.3262 ,-1303.3438,921.5903,45.9751,10);
  259. Stats[playerid] = 1;
  260. SetCameraBehindPlayer(playerid);
  261. if ( iRaceIsStarted == true ) {
  262. TogglePlayerControllable ( playerid , 1 ) ;
  263. GameTextForPlayer ( playerid , "The race has started.. ~r~you are late!" , 3000 , 3 ) ;
  264. }
  265. else {
  266. TogglePlayerControllable ( playerid , 0 ) ;
  267. }
  268.  
  269. SetPlayerPos(playerid,-1125.76806641,1099.78759766,37.70999527);
  270. SetPlayerColor(playerid,purple);
  271.  
  272. // TextDrawShowForPlayer(playerid, text_Top5[0]);
  273. // TextDrawShowForPlayer(playerid, text_Top5[1]);
  274.  
  275. //Put Player In Vehicles
  276. if(playerid == 0)
  277. {
  278. PutPlayerInVehicle(playerid, B[0], 0);
  279. }
  280. else if(playerid == 1)
  281. {
  282. PutPlayerInVehicle(playerid, B[1], 0);
  283. }
  284. else if(playerid == 2)
  285. {
  286. PutPlayerInVehicle(playerid, B[2], 0);
  287. }
  288. else if(playerid == 3)
  289. {
  290. PutPlayerInVehicle(playerid, B[3], 0);
  291. }
  292. else if(playerid == 4)
  293. {
  294. PutPlayerInVehicle(playerid, B[4], 0);
  295. }
  296. else if(playerid == 5)
  297. {
  298. PutPlayerInVehicle(playerid, B[5], 0);
  299. }
  300. else if(playerid == 6)
  301. {
  302. PutPlayerInVehicle(playerid, B[6], 0);
  303. }
  304. else if(playerid == 7)
  305. {
  306. PutPlayerInVehicle(playerid, B[7], 0);
  307. }
  308. else if(playerid == 8)
  309. {
  310. PutPlayerInVehicle(playerid, B[8], 0);
  311. }
  312. else if(playerid == 9)
  313. {
  314. PutPlayerInVehicle(playerid, B[9], 0);
  315. }
  316. else if(playerid == 10)
  317. {
  318. PutPlayerInVehicle(playerid, B[10], 0);
  319. }
  320. else if(playerid == 11)
  321. {
  322. PutPlayerInVehicle(playerid, B[11], 0);
  323. }
  324. else if(playerid == 12)
  325. {
  326. PutPlayerInVehicle(playerid, B[12], 0);
  327. }
  328. else if(playerid == 13)
  329. {
  330. PutPlayerInVehicle(playerid, B[13], 0);
  331. }
  332. else if(playerid == 14)
  333. {
  334. PutPlayerInVehicle(playerid, B[14], 0);
  335. }
  336. else if(playerid == 15)
  337. {
  338. PutPlayerInVehicle(playerid, B[15], 0);
  339. }
  340. else if(playerid == 16)
  341. {
  342. PutPlayerInVehicle(playerid, B[16], 0);
  343. }
  344. else if(playerid == 17)
  345. {
  346. PutPlayerInVehicle(playerid, B[17], 0);
  347. }
  348. else if(playerid == 18)
  349. {
  350. PutPlayerInVehicle(playerid, B[18], 0);
  351. }
  352. else if(playerid == 19)
  353. {
  354. PutPlayerInVehicle(playerid, B[19], 0);
  355. }
  356. else if(playerid == 20)
  357. {
  358. PutPlayerInVehicle(playerid, B[20], 0);
  359. }
  360. else if(playerid == 21)
  361. {
  362. PutPlayerInVehicle(playerid, B[22], 0);
  363. }
  364. else if(playerid == 23)
  365. {
  366. PutPlayerInVehicle(playerid, B[23], 0);
  367. }
  368. else if(playerid == 24)
  369. {
  370. PutPlayerInVehicle(playerid, B[24], 0);
  371. }
  372. else if(playerid == 25)
  373. {
  374. PutPlayerInVehicle(playerid, B[25], 0);
  375. }
  376. else if(playerid == 26)
  377. {
  378. PutPlayerInVehicle(playerid, B[26], 0);
  379. }
  380. else if(playerid == 27)
  381. {
  382. PutPlayerInVehicle(playerid, B[27], 0);
  383. }
  384. else if(playerid == 28)
  385. {
  386. PutPlayerInVehicle(playerid, B[28], 0);
  387. }
  388. else if(playerid == 29)
  389. {
  390. PutPlayerInVehicle(playerid, B[29], 0);
  391. }
  392. else if(playerid == 30)
  393. {
  394. PutPlayerInVehicle(playerid, B[30], 0);
  395. }
  396. else if(playerid == 31)
  397. {
  398. PutPlayerInVehicle(playerid, B[31], 0);
  399. }
  400. else if(playerid == 32)
  401. {
  402. PutPlayerInVehicle(playerid, B[32], 0);
  403. }
  404. else if(playerid == 33)
  405. {
  406. PutPlayerInVehicle(playerid, B[33], 0);
  407. }
  408. else if(playerid == 34)
  409. {
  410. PutPlayerInVehicle(playerid, B[35], 0);
  411. }
  412. else if(playerid == 36)
  413. {
  414. PutPlayerInVehicle(playerid, B[36], 0);
  415. }
  416. else if(playerid == 37)
  417. {
  418. PutPlayerInVehicle(playerid, B[37], 0);
  419. }
  420. else if(playerid == 38)
  421. {
  422. PutPlayerInVehicle(playerid, B[38], 0);
  423. }
  424. else if(playerid == 39)
  425. {
  426. PutPlayerInVehicle(playerid, B[39], 0);
  427. }
  428. else if(playerid == 40)
  429. {
  430. PutPlayerInVehicle(playerid, B[40], 0);
  431. }
  432. else if(playerid == 41)
  433. {
  434. PutPlayerInVehicle(playerid, B[41], 0);
  435. }
  436.  
  437.  
  438. TextDrawShowForPlayer(playerid,Textdraw0);
  439.  
  440. TextDrawShowForPlayer(playerid,Textdraw1);
  441. TextDrawShowForPlayer(playerid,Textdraw2);
  442. SetPlayerInterior(playerid,0);
  443. return 1;
  444. }
  445. forward StartGame(playerid);
  446. public StartGame(playerid)
  447. {
  448.  
  449. SetTimer("Count",10000,0);
  450.  
  451. return 1;
  452. }
  453. //
  454.  
  455. public GameTime()
  456. {
  457. if(GameSeconds || GameMinutes)
  458. {
  459. GameSeconds--;
  460. if(GameSeconds <= -1)
  461. {
  462. GameMinutes--;
  463. GameSeconds=59;
  464. }
  465. new TimeString[14];
  466. format(TimeString,sizeof(TimeString),"%02d:%02d",GameMinutes,GameSeconds);
  467. TextDrawSetString(Textdraw0,TimeString);
  468. }
  469.  
  470. return 1;
  471. }
  472.  
  473.  
  474. //
  475. public
  476. iTimerToStartCountdown ( ) {
  477. iStartCountdown = SetTimer ( "iStartRace" , 1000 , true ) ;
  478. //TextDrawShowForAll(Textdraw5);
  479. return 1;
  480. }
  481. public iExitGameMode (playerid) {
  482. KillTimer ( iTimerToExit ) ;
  483.  
  484.  
  485. for(new i;i<15;++i)
  486. {
  487. SendClientMessageToAll(purple," ");
  488. }
  489. SendClientMessageToAll(purple,"Please Donate For Our Server");
  490. }
  491. public iStartRace ( ) {
  492. iCountdown-- ;
  493. switch ( iCountdown ) {
  494. case 0: {
  495. GameTextForAll ( "~g~Go ~r~Go ~y~Go" , 1000 , 3 ) ;
  496. TextDrawHideForAll(Textdraw5);
  497. iTimeToExit = true ;
  498. KillTimer ( iStartCountdown ) ;
  499. iRaceIsStarted = true ;
  500. for ( new i = 0 ; i < MAX_PLAYERS ; i++ ) {
  501. TogglePlayerControllable ( i , true ) ;
  502. }
  503. }
  504. case 1: {
  505. GameTextForAll ( "1" , 1000 , 3 ) ;
  506. //TextDrawSetString(Textdraw5,"~g~1");
  507. //TextDrawSetString(Textdraw5,"~g~GO ~w~!!");
  508. }
  509. case 2: {
  510. GameTextForAll ( "2" , 1000 , 3 ) ;
  511. // TextDrawSetString(Textdraw5,"~y~2");
  512. //TextDrawSetString(Textdraw5,"~g~1");
  513. }
  514. case 3: {
  515. GameTextForAll ( "3" , 1000 , 3 ) ;
  516. //TextDrawSetString(Textdraw5,"~r~3");
  517. //TextDrawSetString(Textdraw5,"~y~2");
  518. }
  519. //case 4: {
  520. //TextDrawSetString(Textdraw5,"~r~3");
  521.  
  522. // }
  523. }
  524. return 1;
  525. }
  526.  
  527. public OnPlayerDeath(playerid, killerid, reason)
  528. {
  529. new veh;
  530. veh = GetPlayerVehicleID(playerid);
  531. SetVehicleToRespawn(veh);
  532. SendDeathMessage(killerid, playerid, reason);
  533. TextDrawHideForPlayer(playerid, text_Top5[0]);
  534. TextDrawHideForPlayer(playerid, text_Top5[1]);
  535. return 1;
  536. }
  537.  
  538. public OnVehicleSpawn(vehicleid)
  539. {
  540. return 1;
  541. }
  542.  
  543. public OnVehicleDeath(vehicleid, killerid)
  544. {
  545. return 1;
  546. }
  547.  
  548. public OnPlayerText(playerid, text[])
  549. {
  550. return 1;
  551. }
  552.  
  553. public OnPlayerCommandText(playerid, cmdtext[])
  554. {
  555. if(!strcmp(cmdtext, "/shop", true))
  556. {
  557. SendClientMessage(playerid,0xff0010ff,"***Shop Disabled in This Mission***");
  558. return 1;
  559. }
  560.  
  561.  
  562. return SendClientMessage(playerid,COLOR_RED,"Unknown Command Use /help For All Commands");
  563. }
  564.  
  565. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  566. {
  567. return 1;
  568. }
  569.  
  570. public OnPlayerExitVehicle(playerid, vehicleid)
  571. {
  572. new veh;
  573. veh = GetPlayerVehicleID(playerid);
  574. SetVehicleToRespawn(veh);
  575. return 1;
  576. }
  577.  
  578. public OnPlayerStateChange(playerid, newstate, oldstate)
  579. {
  580. return 1;
  581. }
  582.  
  583. public OnPlayerEnterCheckpoint(playerid)
  584. {
  585. return 1;
  586. }
  587.  
  588. public OnPlayerLeaveCheckpoint(playerid)
  589. {
  590. return 1;
  591. }
  592.  
  593. public OnPlayerEnterRaceCheckpoint(playerid)
  594. {
  595. switch(Stats[playerid])
  596. {
  597. case 1:
  598. {
  599. DisablePlayerRaceCheckpoint(playerid);
  600. PlayerPlaySound(playerid, 1056, 0.0, 0.0, 10.0);
  601. SetPlayerRaceCheckpoint(playerid,0,-1303.3438,921.5903,45.9751 ,-1438.0826,778.1960,46.9262,10);
  602. Stats[playerid] = 2;
  603. return 1;
  604. }
  605. case 2:
  606. {
  607. DisablePlayerRaceCheckpoint(playerid);
  608. PlayerPlaySound(playerid, 1056, 0.0, 0.0, 10.0);
  609. SetPlayerRaceCheckpoint(playerid,0,-1438.0826,778.1960,46.9262 ,-1603.1776,604.9767,41.4696,10);
  610. Stats[playerid] = 3;
  611. }
  612. case 3:
  613. {
  614. DisablePlayerRaceCheckpoint(playerid);
  615. PlayerPlaySound(playerid, 1056, 0.0, 0.0, 10.0);
  616. SetPlayerRaceCheckpoint(playerid,0,-1603.1776,604.9767,41.4696 ,-1730.6274,474.5914,38.3835,10);
  617. Stats[playerid] = 4;
  618. }
  619. case 4:
  620. {
  621. DisablePlayerRaceCheckpoint(playerid);
  622. PlayerPlaySound(playerid, 1056, 0.0, 0.0, 10.0);
  623. SetPlayerRaceCheckpoint(playerid,0,-1730.6274,474.5914,38.3835 ,-1866.0215,232.0442,38.5611,10);
  624. Stats[playerid] = 5;
  625. }
  626. case 5:
  627. {
  628. DisablePlayerRaceCheckpoint(playerid);
  629. PlayerPlaySound(playerid, 1056, 0.0, 0.0, 10.0);
  630. SetPlayerRaceCheckpoint(playerid,0,-1866.0215,232.0442,38.5611 ,-1899.3824,-258.9382,38.2422,10);
  631. Stats[playerid] = 6;
  632. }
  633. case 6:
  634. {
  635. DisablePlayerRaceCheckpoint(playerid);
  636. PlayerPlaySound(playerid, 1056, 0.0, 0.0, 10.0);
  637. SetPlayerRaceCheckpoint(playerid,0,-1899.3824,-258.9382,38.2422 ,-1898.9611,-866.9935,44.9531,10);
  638. Stats[playerid] = 7;
  639. }
  640. case 7:
  641. {
  642. DisablePlayerRaceCheckpoint(playerid);
  643. PlayerPlaySound(playerid, 1056, 0.0, 0.0, 10.0);
  644. SetPlayerRaceCheckpoint(playerid,0,-1898.9611,-866.9935,44.9531 ,-1898.7498,-1216.3274,39.4844,10);
  645. Stats[playerid] = 8;
  646. }
  647. case 8:
  648. {
  649. DisablePlayerRaceCheckpoint(playerid);
  650. PlayerPlaySound(playerid, 1056, 0.0, 0.0, 10.0);
  651. SetPlayerRaceCheckpoint(playerid,0,-1898.7498,-1216.3274,39.4844 ,-1907.8506,-1314.1133,39.4766,10);
  652. Stats[playerid] = 9;
  653. }
  654. case 9:
  655. {
  656. DisablePlayerRaceCheckpoint(playerid);
  657. PlayerPlaySound(playerid, 1056, 0.0, 0.0, 10.0);
  658. SetPlayerRaceCheckpoint(playerid,0,-1907.8506,-1314.1133,39.4766 ,-1910.0282,-1266.9955,39.4766,10);
  659. Stats[playerid] = 10;
  660. }
  661. case 10:
  662. {
  663. DisablePlayerRaceCheckpoint(playerid);
  664. PlayerPlaySound(playerid, 1056, 0.0, 0.0, 10.0);
  665. SetPlayerRaceCheckpoint(playerid,0,-1910.0282,-1266.9955,39.4766 ,-1953.3282,-1233.2831,39.4844,10);
  666. Stats[playerid] = 11;
  667. }
  668. case 11:
  669. {
  670. DisablePlayerRaceCheckpoint(playerid);
  671. PlayerPlaySound(playerid, 1056, 0.0, 0.0, 10.0);
  672. SetPlayerRaceCheckpoint(playerid,0,-1953.3282,-1233.2831,39.4844 ,-1987.3389,-1067.7865,32.0234,10);
  673. Stats[playerid] = 12;
  674. }
  675. case 12:
  676. {
  677. DisablePlayerRaceCheckpoint(playerid);
  678. PlayerPlaySound(playerid, 1056, 0.0, 0.0, 10.0);
  679. SetPlayerRaceCheckpoint(playerid,0,-1987.3389,-1067.7865,32.0234,-1985.0624,-865.7950,32.0234,10);
  680. Stats[playerid] = 13;
  681. }
  682. case 13:
  683. {
  684. DisablePlayerRaceCheckpoint(playerid);
  685. PlayerPlaySound(playerid, 1056, 0.0, 0.0, 10.0);
  686. SetPlayerRaceCheckpoint(playerid,0,-1985.0624,-865.7950,32.0234 ,-1942.3215,-859.0550,32.0234,10);
  687. Stats[playerid] = 14;
  688. }
  689. case 14:
  690. {
  691. DisablePlayerRaceCheckpoint(playerid);
  692. PlayerPlaySound(playerid, 1056, 0.0, 0.0, 10.0);
  693. SetPlayerRaceCheckpoint(playerid,0,-1942.3215,-859.0550,32.0234 ,-1886.4285,-860.6800,32.0312,10);
  694. Stats[playerid] = 15;
  695. }
  696. case 15:
  697. {
  698. DisablePlayerRaceCheckpoint(playerid);
  699. PlayerPlaySound(playerid, 1056, 0.0, 0.0, 10.0);
  700. SetPlayerRaceCheckpoint(playerid,1,-1886.4285,-860.6800,32.0312 ,-1876.5088,-846.1639,32.0234,10);
  701. Stats[playerid] = 16;
  702. }
  703. case 16:
  704. {
  705. DisablePlayerRaceCheckpoint(playerid);
  706. PlayerPlaySound(playerid, 1056, 0.0, 0.0, 10.0);
  707. SetPlayerRaceCheckpoint(playerid,1,-1876.5088,-846.1639,32.0234,-1876.5088,-846.1639,32.0234,10);
  708. Stats[playerid] = 17;
  709.  
  710.  
  711. SetPlayerVirtualWorld(playerid, 3);
  712. //
  713. new name[MAX_PLAYER_NAME],string[128];
  714. new Prize[2];
  715. GetPlayerName(playerid,name,sizeof(name));
  716. Position++;
  717. switch(Position)
  718. {
  719. case 1: Prize[0] = 10000, Prize[1] = 5;
  720. case 2: Prize[0] = 5000, Prize[1] = 4;
  721. case 3: Prize[0] = 3000, Prize[1] = 3;
  722. case 4: Prize[0] = 3000, Prize[1] = 2;
  723. case 5: Prize[0] = 3000, Prize[1] = 2;
  724. case 6: Prize[0] = 1000, Prize[1] = 1;
  725. case 7: Prize[0] = (random(random(200)) + 400), Prize[1] = 1;
  726. case 8: Prize[0] = (random(random(150)) + 300), Prize[1] = 1;
  727. case 9: Prize[0] = (random(random(100)) + 200), Prize[1] = 1;
  728. default: Prize[0] = random(random(100)), Prize[1] = 1;
  729. }
  730. format(string, sizeof(string), ">> "#LIGHTBLUE"\"%s\" "#GREEN"has finished the race in position "#RED"NO: \"%d\".", name, Position);
  731. SendClientMessageToAll(purple, string);
  732. GivePlayerMoney(playerid, Prize[0]);
  733. SetPlayerScore(playerid, GetPlayerScore(playerid) + Prize[1]);
  734. DisablePlayerRaceCheckpoint(playerid);
  735. new veh;
  736. veh = GetPlayerVehicleID(playerid);
  737. DestroyVehicle(veh);
  738. }
  739.  
  740.  
  741.  
  742. }
  743. return 1;
  744. }
  745.  
  746. public OnPlayerLeaveRaceCheckpoint(playerid)
  747. {
  748. DisablePlayerRaceCheckpoint(playerid);
  749. return 1;
  750. }
  751.  
  752. public OnRconCommand(cmd[])
  753. {
  754. return 1;
  755. }
  756.  
  757. public OnPlayerRequestSpawn(playerid)
  758. {
  759. return 1;
  760. }
  761.  
  762. public OnObjectMoved(objectid)
  763. {
  764. return 1;
  765. }
  766.  
  767. public OnPlayerObjectMoved(playerid, objectid)
  768. {
  769. return 1;
  770. }
  771.  
  772. public OnPlayerPickUpPickup(playerid, pickupid)
  773. {
  774. return 1;
  775. }
  776.  
  777. public OnVehicleMod(playerid, vehicleid, componentid)
  778. {
  779. return 1;
  780. }
  781.  
  782. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  783. {
  784. return 1;
  785. }
  786.  
  787. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  788. {
  789. return 1;
  790. }
  791.  
  792. public OnPlayerSelectedMenuRow(playerid, row)
  793. {
  794. return 1;
  795. }
  796.  
  797. public OnPlayerExitedMenu(playerid)
  798. {
  799. return 1;
  800. }
  801.  
  802. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  803. {
  804. return 1;
  805. }
  806.  
  807. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  808. {
  809. if(newkeys == KEY_SUBMISSION)
  810. {
  811. if(IsPlayerInAnyVehicle(playerid))
  812. {
  813. if(GetPlayerMoney(playerid) >= 300)
  814. {
  815. SetVehicleHealth(GetPlayerVehicleID(playerid),1000.0);
  816. RepairVehicle(GetPlayerVehicleID(playerid));
  817. GivePlayerMoney(playerid,-300);
  818. PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
  819. }
  820. else
  821. {
  822. SendClientMessage(playerid,purple,"You Dont Have Enough Money");
  823. }
  824. }
  825. else
  826. {
  827. SendClientMessage(playerid,purple,"*You Must Be in Vehicle To Use Repaired!");
  828. }
  829.  
  830. }
  831.  
  832. return 1;
  833. }
  834.  
  835. public OnRconLoginAttempt(ip[], password[], success)
  836. {
  837. return 1;
  838. }
  839.  
  840. public OnPlayerUpdate(playerid)
  841. { new
  842. playerScores[MAX_PLAYERS][rankingEnum],
  843. index
  844. ;
  845. for(new i; i != MAX_PLAYERS; ++i)
  846. {
  847. if(IsPlayerConnected(i) && !IsPlayerNPC(i))
  848. {
  849. playerScores[index][player_Score] = GetPlayerScore(i);
  850. playerScores[index++][player_ID] = i;
  851. }
  852. }
  853. GetPlayerHighestScores(playerScores, 0, index);
  854.  
  855. new
  856. score_Text[256] = "~n~",
  857. player_Name[20]
  858. ;
  859. for(new i; i < 5; ++i)
  860. {
  861. if(i < index)
  862. {
  863. GetPlayerName(playerScores[i][player_ID], player_Name, sizeof(player_Name));
  864. format(score_Text, sizeof(score_Text), "%s~n~~b~%d. ~w~%s - ~r~%d", score_Text, i + 1, player_Name, playerScores[i][player_Score]);
  865. }
  866. else
  867. format(score_Text, sizeof(score_Text), "%s~n~~b~%d. ~r~N/A", score_Text, i + 1);
  868. }
  869. TextDrawSetString(text_Top5[1], score_Text);
  870.  
  871.  
  872.  
  873. return 1;
  874. }
  875.  
  876. public OnPlayerStreamIn(playerid, forplayerid)
  877. {
  878. return 1;
  879. }
  880.  
  881. public OnPlayerStreamOut(playerid, forplayerid)
  882. {
  883. return 1;
  884. }
  885.  
  886. public OnVehicleStreamIn(vehicleid, forplayerid)
  887. {
  888. return 1;
  889. }
  890.  
  891. public OnVehicleStreamOut(vehicleid, forplayerid)
  892. {
  893. return 1;
  894. }
  895.  
  896. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  897. {
  898. return 1;
  899. }
  900.  
  901. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  902. {
  903. return 1;
  904. }
  905. stock GetPlayerHighestScores(array[][rankingEnum], left, right)
  906. {
  907. new
  908. tempLeft = left,
  909. tempRight = right,
  910. pivot = array[(left + right) / 2][player_Score],
  911. tempVar
  912. ;
  913. while(tempLeft <= tempRight)
  914. {
  915. while(array[tempLeft][player_Score] > pivot) tempLeft++;
  916. while(array[tempRight][player_Score] < pivot) tempRight--;
  917.  
  918. if(tempLeft <= tempRight)
  919. {
  920. tempVar = array[tempLeft][player_Score], array[tempLeft][player_Score] = array[tempRight][player_Score], array[tempRight][player_Score] = tempVar;
  921. tempVar = array[tempLeft][player_ID], array[tempLeft][player_ID] = array[tempRight][player_ID], array[tempRight][player_ID] = tempVar;
  922. tempLeft++, tempRight--;
  923. }
  924. }
  925. if(left < tempRight) GetPlayerHighestScores(array, left, tempRight);
  926. if(tempLeft < right) GetPlayerHighestScores(array, tempLeft, right);
  927. }
  928.  
  929. public GameOver(playerid)
  930. {
  931. SendRconCommand("changemode GM2");
  932. GameTextForAll("~y~Changing Game ~n~ ~w~Please Wait....",5000,1);
  933. KillTimer(GameTimer);
  934. for(new i;i<15;++i)
  935. {
  936. SendClientMessageToAll(purple," ");
  937. }
  938. TextDrawHideForPlayer(playerid,Textdraw0);
  939. TextDrawHideForPlayer(playerid,Textdraw1);
  940. TextDrawHideForPlayer(playerid,Textdraw2);
  941. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement