Advertisement
Guest User

Sandra

a guest
Jun 4th, 2008
1,105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.94 KB | None | 0 0
  1. /*===================================================================================================*\
  2. ||===================================================================================================||
  3. || ________ ________ ___ _ ______ ______ ________ ||
  4. || \ | _____| | ____ | | \ | | | _ \ | _ \ | ____ | / ||
  5. || ======== \ | |_____ | |____| | | |\ \ | | | | | | | |_| / | |____| | / ======== ||
  6. || | | _____ | | ____ | | | \ \| | | | | | | _ \ | ____ | | ||
  7. || ======== / ______| | | | | | | | \ \ | | |_| | | | \ \ | | | | \ ======== ||
  8. || / |________| |_| |_| |_| \__| |______/ |_| \_| |_| |_| \ ||
  9. || ||
  10. ||===================================================================================================||
  11. || Created on the 4th of June 2008 by =>Sandra<= ||
  12. || Do NOT remove any credits!! ||
  13. \*===================================================================================================*/
  14.  
  15. #include <a_samp>
  16. #include <dini>
  17. #define MAX_PACKAGES 40
  18. #pragma unused strtok
  19. new Float:CPositions[MAX_PACKAGES][4] =
  20. {
  21. {-1486.92, 1630.25, 1056.54}, //green
  22. {-1486.72, 1641.97, 1060.67}, //yellow
  23. {-1485.11, 1596.46, 1061.33}, //yellow
  24. {-1488.43, 1564.97, 1056.63}, //red
  25. {-1466.76, 1581.16, 1054.72}, //green
  26. {-1466.51, 1596.21, 1056.70}, //yellow
  27. {-1462.08, 1622.39, 1054.41}, //green
  28. {-1461.83, 1635.99, 1054.41}, //green
  29. {-1453.67, 1635.78, 1056.42}, //yellow
  30. {-1453.90, 1628.47, 1054.41}, //yellow
  31. {-1454.02, 1620.89, 1056.42}, //red
  32. {-1446.53, 1620.97, 1054.41}, //red
  33. {-1416.65, 1606.79, 1055.32}, //green
  34. {-1409.12, 1617.69, 1055.32}, //yellow
  35. {-1390.24, 1623.65, 1055.32}, //red
  36. {-1384.55, 1603.49, 1053.71}, //green
  37. {-1378.88, 1610.33, 1053.71}, //green
  38. {-1371.29, 1623.02, 1054.81}, //green
  39. {-1372.50, 1631.84, 1055.55}, //red
  40. {-1362.46, 1612.83, 1055.46}, //green
  41. {-1360.01, 1638.50, 1056.21}, //yellow
  42. {-1371.38, 1638.84, 1053.41}, //green
  43. {-1403.92, 1645.57, 1071.03}, //red
  44. {-1388.59, 1571.87, 1053.53}, //green
  45. {-1373.78, 1562.30, 1059.53}, //green
  46. {-1354.83, 1584.96, 1058.47}, //green
  47. {-1354.83, 1610.70, 1054.53}, //green
  48. {-1456.99, 1648.68, 1054.41}, //green
  49. {-1443.41, 1648.54, 1054.41}, //green
  50. {-1431.34, 1597.96, 1054.36}, //green
  51. {-1420.67, 1597.97, 1054.16}, //green
  52. {-1434.54, 1578.21, 1054.42}, //green
  53. {-1427.82, 1584.00, 1054.43}, //green
  54. {-1430.88, 1580.87, 1055.71}, //yellow
  55. {-1426.79, 1568.77, 1058.44}, //green
  56. {-1401.74, 1568.74, 1054.62}, //yellow
  57. {-1408.25, 1585.43, 1055.75}, //green
  58. {-1408.17, 1593.39, 1055.79}, //green
  59. {-1451.70, 1570.27, 1059.34}, //red
  60. {-1457.84, 1575.85, 1056.20} //yellow
  61. };
  62.  
  63. new CValues[MAX_PACKAGES] =
  64. { 1,
  65. 2,
  66. 2,
  67. 3,
  68. 1,
  69. 2,
  70. 1,
  71. 1,
  72. 2,
  73. 2,
  74. 3,
  75. 3,
  76. 1,
  77. 2,
  78. 3,
  79. 1,
  80. 1,
  81. 1,
  82. 3,
  83. 1,
  84. 2,
  85. 1,
  86. 3,
  87. 1,
  88. 1,
  89. 1,
  90. 1,
  91. 1,
  92. 1,
  93. 1,
  94. 1,
  95. 1,
  96. 1,
  97. 2,
  98. 1,
  99. 2,
  100. 1,
  101. 1,
  102. 3,
  103. 2
  104. };
  105.  
  106. new PackageModels[MAX_PACKAGES] =
  107. {
  108. 1578,
  109. 1577,
  110. 1577,
  111. 1580,
  112. 1578,
  113. 1577,
  114. 1578,
  115. 1578,
  116. 1577,
  117. 1577,
  118. 1580,
  119. 1580,
  120. 1578,
  121. 1577,
  122. 1580,
  123. 1578,
  124. 1578,
  125. 1578,
  126. 1580,
  127. 1578,
  128. 1577,
  129. 1578,
  130. 1580,
  131. 1578,
  132. 1578,
  133. 1578,
  134. 1578,
  135. 1578,
  136. 1578,
  137. 1578,
  138. 1578,
  139. 1578,
  140. 1578,
  141. 1577,
  142. 1578,
  143. 1577,
  144. 1578,
  145. 1578,
  146. 1580,
  147. 1577
  148. };
  149.  
  150. new IsPackagePickedUp[MAX_PACKAGES];
  151. new PackagePickupID[MAX_PACKAGES];
  152. new IsSomeOnePlayingKickstart;
  153. new StadiumCycle;
  154. new PosCheckTimer;
  155. new Text:Textdraw;
  156. new TextdrawString[64];
  157. new TextdrawUpdateTimer;
  158. new Score;
  159. new MinutesLeft;
  160. new SecondsLeft;
  161. new HasToGetOnBike[MAX_PLAYERS];
  162. new IsOnBike[MAX_PLAYERS];
  163. new IsFallenOffBike[MAX_PLAYERS];
  164. new IsPlayerRacing[MAX_PLAYERS];
  165. new TopScores[5];
  166. new TopScoreNames[5][MAX_PLAYER_NAME];
  167. new Text:ScoreBoard;
  168.  
  169. public OnFilterScriptInit()
  170. {
  171. print("--------------------------------------");
  172. print(" Kickstart Challenge Filterscript ");
  173. print(" Made by =>Sandra<= ");
  174. print(" Succesfully Loaded! ");
  175. print("--------------------------------------");
  176. format(TextdrawString, 64, " ");
  177. new key[20];
  178. for(new i; i<5; i++)
  179. {
  180. format(key, 20, "Score%d", i+1);
  181. TopScores[i] = dini_Int("KickstartTopscores.txt", key);
  182. format(key, 20, "ScoreName%d", i+1);
  183. format(TopScoreNames[i], MAX_PLAYER_NAME, "%s", dini_Get("KickstartTopscores.txt", key));
  184. }
  185. return 1;
  186. }
  187.  
  188. public OnFilterScriptExit()
  189. {
  190. for(new i; i<MAX_PACKAGES; i++)
  191. {
  192. DestroyPickup(PackagePickupID[i]);
  193. IsPackagePickedUp[i] = 0;
  194. }
  195. TextDrawDestroy(Textdraw);
  196. DestroyVehicle(StadiumCycle);
  197. new key[20];
  198. for(new i; i<5; i++)
  199. {
  200. format(key, 20, "Score%d", i+1);
  201. dini_IntSet("KickstartTopscores.txt", key, TopScores[i]);
  202. format(key, 20, "ScoreName%d", i+1);
  203. dini_Set("KickstartTopscores.txt", key, TopScoreNames[i]);
  204. }
  205. print("--------------------------------------");
  206. print(" Kickstart Challenge Filterscript ");
  207. print(" Made by =>Sandra<= ");
  208. print(" Succesfully Unloaded! ");
  209. print(" TopScores Saved! ");
  210. print("--------------------------------------");
  211. return 1;
  212. }
  213.  
  214. public OnPlayerConnect(playerid)
  215. {
  216. HasToGetOnBike[playerid] = 0;
  217. IsOnBike[playerid] = 0;
  218. IsFallenOffBike[playerid] = 0;
  219. IsPlayerRacing[playerid] = 0;
  220. return 1;
  221. }
  222.  
  223. public OnPlayerDisconnect(playerid, reason)
  224. {
  225. if(IsPlayerRacing[playerid] == 1)
  226. {
  227. for(new i; i<MAX_PACKAGES; i++)
  228. {
  229. DestroyPickup(PackagePickupID[i]);
  230. IsPackagePickedUp[i] = 0;
  231. }
  232. IsPlayerRacing[playerid] = 0;
  233. KillTimer(PosCheckTimer);
  234. IsSomeOnePlayingKickstart = 0;
  235. TextDrawDestroy(Textdraw);
  236. DestroyVehicle(StadiumCycle);
  237. }
  238. return 1;
  239. }
  240.  
  241. public OnPlayerDeath(playerid, killerid, reason)
  242. {
  243. if(IsPlayerRacing[playerid] == 1)
  244. {
  245. for(new i; i<MAX_PACKAGES; i++)
  246. {
  247. DestroyPickup(PackagePickupID[i]);
  248. IsPackagePickedUp[i] = 0;
  249. }
  250. IsPlayerRacing[playerid] = 0;
  251. KillTimer(PosCheckTimer);
  252. IsSomeOnePlayingKickstart = 0;
  253. TextDrawDestroy(Textdraw);
  254. DestroyVehicle(StadiumCycle);
  255. }
  256. return 1;
  257. }
  258.  
  259. public OnPlayerCommandText(playerid, cmdtext[])
  260. {
  261. if (strcmp("/kickstart", cmdtext, true) == 0)
  262. {
  263. if(IsSomeOnePlayingKickstart == 1)
  264. {
  265. SendClientMessage(playerid, 0xFF0000AA, "Sorry, someone else is already playing Kickstart. Wait till he/she's finished!");
  266. return 1;
  267. }
  268. IsSomeOnePlayingKickstart = 1;
  269. StadiumCycle = CreateVehicle(468,-1492.5464,1613.2220,1052.1998,271.7825,0,0, -1);
  270. LinkVehicleToInterior(StadiumCycle, 14);
  271. SetPlayerInterior(playerid, 14);
  272. SetPlayerPos(playerid, -1494.9211,1616.5856,1052.5313);
  273. SetPlayerFacingAngle(playerid, 245.0736);
  274. SetCameraBehindPlayer(playerid);
  275. IsPlayerRacing[playerid] = 1;
  276. for(new i; i<MAX_PACKAGES; i++)
  277. {
  278. PackagePickupID[i] = CreatePickup(PackageModels[i], 1, CPositions[i][0], CPositions[i][1], CPositions[i][2]);
  279. IsPackagePickedUp[i] = 0;
  280. }
  281. GameTextForPlayer(playerid, "~w~Get on the bike!", 9999999, 3);
  282. HasToGetOnBike[playerid] = 1;
  283. return 1;
  284. }
  285. if (strcmp("/exitkickstart", cmdtext, true) == 0)
  286. {
  287. for(new i; i<MAX_PACKAGES; i++)
  288. {
  289. DestroyPickup(PackagePickupID[i]);
  290. IsPackagePickedUp[i] = 0;
  291. }
  292. IsPlayerRacing[playerid] = 0;
  293. RemovePlayerFromVehicle(playerid);
  294. KillTimer(PosCheckTimer);
  295. IsSomeOnePlayingKickstart = 0;
  296. TextDrawDestroy(Textdraw);
  297. DestroyVehicle(StadiumCycle);
  298. GameTextForPlayer(playerid, "~r~Game Over", 5000, 3);
  299. SetPlayerInterior(playerid, 0);
  300. SpawnPlayer(playerid);
  301.  
  302. return 1;
  303. }
  304. if(strcmp(cmdtext, "/topscores", true)==0)
  305. {
  306. new str[128];
  307. SendClientMessage(playerid, 0xFFFFFFAA, "Kickstart Challenge Topscores:");
  308. format(str, 128, "#1: Score: %d by %s", TopScores[0], TopScoreNames[0]);
  309. SendClientMessage(playerid, 0xFFFF66AA, str);
  310. format(str, 128, "#2: Score: %d by %s", TopScores[1], TopScoreNames[1]);
  311. SendClientMessage(playerid, 0xFFFF66AA, str);
  312. format(str, 128, "#3: Score: %d by %s", TopScores[2], TopScoreNames[2]);
  313. SendClientMessage(playerid, 0xFFFF66AA, str);
  314. format(str, 128, "#4: Score: %d by %s", TopScores[3], TopScoreNames[3]);
  315. SendClientMessage(playerid, 0xFFFF66AA, str);
  316. format(str, 128, "#5: Score: %d by %s", TopScores[4], TopScoreNames[4]);
  317. SendClientMessage(playerid, 0xFFFF66AA, str);
  318. SendClientMessage(playerid, 0xFFFFFFAA, "--------------------------------------");
  319. return 1;
  320. }
  321. if(strcmp(cmdtext, "/kickstarthelp", true) == 0)
  322. {
  323. SendClientMessage(playerid, 0xFFFFFFAA, "The main goal of this game is to collect as much packages within the timelimit");
  324. SendClientMessage(playerid, 0xFFFFFFAA, "You can only collect them if you're on the motorcycle");
  325. SendClientMessage(playerid, 0xFFFFFFAA, "There are 3 diffrent package-colors: Green, Yellow and Red");
  326. SendClientMessage(playerid, 0xFFFFFFAA, "A green package is worth 1 point:");
  327. SendClientMessage(playerid, 0xFFFFFFAA, "A yellow package is worth 2 points:");
  328. SendClientMessage(playerid, 0xFFFFFFAA, "A red package is worth 3 points");
  329. SendClientMessage(playerid, 0xFFFFFFAA, "To start a game, type /kickstart. And if you want to stop, use: /exitkickstart");
  330. SendClientMessage(playerid, 0xFFFFFFAA, "If you want to see the top 5 scores, type: /topscores");
  331. return 1;
  332. }
  333. return 0;
  334. }
  335.  
  336. public OnPlayerStateChange(playerid, newstate, oldstate)
  337. {
  338. if(IsPlayerRacing[playerid] == 1)
  339. {
  340. new vehicleid = GetPlayerVehicleID(playerid);
  341. if(oldstate == 2 && IsOnBike[playerid] == 1)
  342. {
  343. GameTextForPlayer(playerid, "~r~Get back on your bike!", 9999999, 3);
  344. IsOnBike[playerid] = 0;
  345. IsFallenOffBike[playerid] = 1;
  346. }
  347. if(newstate == 2)
  348. {
  349. if(vehicleid == StadiumCycle && HasToGetOnBike[playerid] == 1)
  350. {
  351. IsOnBike[playerid] = 1;
  352. GameTextForPlayer(playerid, " ", 100, 3);
  353. HasToGetOnBike[playerid] = 0;
  354. StartGame(playerid);
  355. }
  356. if(vehicleid == StadiumCycle && IsFallenOffBike[playerid] == 1)
  357. {
  358. IsFallenOffBike[playerid] = 0;
  359. IsOnBike[playerid] = 1;
  360. GameTextForPlayer(playerid, " ", 100, 3);
  361. }
  362. }
  363. }
  364. return 1;
  365. }
  366.  
  367. stock PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
  368. {
  369. if(IsPlayerConnected(playerid))
  370. {
  371. new Float:oldposx, Float:oldposy, Float:oldposz;
  372. new Float:tempposx, Float:tempposy, Float:tempposz;
  373. GetVehiclePos(GetPlayerVehicleID(playerid), oldposx, oldposy, oldposz);
  374. tempposx = (oldposx -x);
  375. tempposy = (oldposy -y);
  376. tempposz = (oldposz -z);
  377. if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  378. {
  379. return 1;
  380. }
  381. }
  382. return 0;
  383. }
  384.  
  385. stock StartGame(playerid)
  386. {
  387. MinutesLeft = 3;
  388. SecondsLeft = 0;
  389. PosCheckTimer = SetTimerEx("CheckPosition", 75, 1, "i", playerid);
  390. Textdraw = TextDrawCreate(550, 200, TextdrawString);
  391. TextDrawUseBox(Textdraw, 1);
  392. TextDrawLetterSize(Textdraw, 0.50, 1.3);
  393. TextDrawColor(Textdraw, 0xFFFF66AA);
  394. TextDrawBoxColor(Textdraw, 0x000000AA);
  395. TextDrawSetShadow(Textdraw, 0);
  396. TextDrawShowForPlayer(playerid, Textdraw);
  397. TextdrawUpdateTimer = SetTimerEx("TextdrawUpdate", 1000, 1, "i", playerid);
  398. }
  399.  
  400. forward CheckPosition(playerid);
  401. public CheckPosition(playerid)
  402. {
  403. new Float:Distance;
  404. if(IsPlayerInAnyVehicle(playerid))
  405. {
  406. for(new i; i<MAX_PACKAGES; i++)
  407. {
  408. if(IsPackagePickedUp[i] == 0)
  409. {
  410. Distance = GetDistanceToPackage(playerid, i);
  411. if(Distance <= 1.0)
  412. {
  413. DestroyPickup(PackagePickupID[i]);
  414. IsPackagePickedUp[i] = 1;
  415. new color[7], textcolor[4], str[64];
  416. if(CValues[i] == 1) {color = "Green"; textcolor = "~g~";}
  417. else if(CValues[i] == 2) {color = "Yellow"; textcolor = "~y~";}
  418. else if(CValues[i] == 3) {color = "Red"; textcolor = "~r~";}
  419. format(str, 64, "~n~~n~~n~~n~~n~~n~~n~~n~~w~You picked up a %s%s ~w~Package!", textcolor, color);
  420. GameTextForPlayer(playerid, str, 3000, 3);
  421. Score += CValues[i];
  422. }
  423. }
  424. }
  425. }
  426. }
  427.  
  428. forward Float:GetDistanceToPackage(playerid, Package);
  429. public Float:GetDistanceToPackage(playerid, Package)
  430. {
  431. new Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2;
  432. GetPlayerPos(playerid,x1,y1,z1);
  433. x2 = CPositions[Package][0];
  434. y2 = CPositions[Package][1];
  435. z2 = CPositions[Package][2];
  436. return floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));
  437. }
  438.  
  439. forward TextdrawUpdate(playerid);
  440. public TextdrawUpdate(playerid)
  441. {
  442. TextDrawHideForPlayer(playerid, Textdraw);
  443. format(TextdrawString, 64, "Score: %d ~n~Time: %d:%02d", Score, MinutesLeft, SecondsLeft);
  444. TextDrawSetString(Textdraw, TextdrawString);
  445. TextDrawShowForPlayer(playerid, Textdraw);
  446. SecondsLeft--;
  447. if(MinutesLeft == 0 && SecondsLeft == -1) //Time is up
  448. {
  449. new str[128];
  450. TextDrawHideForPlayer(playerid, Textdraw);
  451. TextDrawDestroy(Textdraw);
  452. IsPlayerRacing[playerid] = 0;
  453. AddNameToTopscore(playerid);
  454. TogglePlayerControllable(playerid, 0);
  455. format(str, 128, "~r~Time is up! ~n~Your score is: ~n~~y~%d", Score);
  456. GameTextForPlayer(playerid, str, 10000, 4);
  457. KillTimer(TextdrawUpdateTimer);
  458. KillTimer(PosCheckTimer);
  459. for(new i; i<MAX_PACKAGES; i++)
  460. {
  461. DestroyPickup(PackagePickupID[i]);
  462. IsPackagePickedUp[i] = 0;
  463. }
  464. SetTimerEx("ResetGame", 10000, 0, "i", playerid);
  465. PlayerPlaySound(playerid, 1185, 0, 0, 0);
  466. SetTimerEx("StopSound", 10000, 0, "i", playerid);
  467. return 1;
  468. }
  469. if(SecondsLeft == -1)
  470. {
  471. SecondsLeft = 59;
  472. MinutesLeft--;
  473. }
  474. return 1;
  475. }
  476.  
  477. forward StopSound(playerid);
  478. public StopSound(playerid)
  479. {
  480. PlayerPlaySound(playerid, 1186, 0, 0, 0);
  481. }
  482.  
  483. forward ResetGame(playerid);
  484. public ResetGame(playerid)
  485. {
  486. IsSomeOnePlayingKickstart = 0;
  487. RemovePlayerFromVehicle(playerid);
  488. Score = 0;
  489. DestroyVehicle(StadiumCycle);
  490. TextDrawDestroy(ScoreBoard);
  491. SetPlayerInterior(playerid, 0);
  492. SpawnPlayer(playerid);
  493. IsOnBike[playerid] = 0;
  494. }
  495.  
  496. stock AddNameToTopscore(playerid)
  497. {
  498. new FinalPosition;
  499. if(Score > TopScores[0]) FinalPosition = 1;
  500. else if(Score > TopScores[1] && Score <= TopScores[0]) FinalPosition = 2;
  501. else if(Score > TopScores[2] && Score <= TopScores[1]) FinalPosition = 3;
  502. else if(Score > TopScores[3] && Score <= TopScores[2]) FinalPosition = 4;
  503. else if(Score > TopScores[4] && Score <= TopScores[3]) FinalPosition = 5;
  504. else if(Score <= TopScores[4]) FinalPosition = -1;
  505.  
  506. if(FinalPosition == 1)
  507. {
  508. new pName[MAX_PLAYER_NAME];
  509. GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
  510. TopScores[4] = TopScores[3];
  511. TopScoreNames[4] = TopScoreNames[3];
  512. TopScores[3] = TopScores[2];
  513. TopScoreNames[3] = TopScoreNames[2];
  514. TopScores[2] = TopScores[1];
  515. TopScoreNames[2] = TopScoreNames[1];\
  516. TopScores[1] = TopScores[0];
  517. TopScoreNames[1] = TopScoreNames[0];\
  518. TopScores[0] = Score;
  519. TopScoreNames[0] = pName;
  520. }
  521. else if(FinalPosition == 2)
  522. {
  523. new pName[MAX_PLAYER_NAME];
  524. GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
  525. TopScores[4] = TopScores[3];
  526. TopScoreNames[4] = TopScoreNames[3];
  527. TopScores[3] = TopScores[2];
  528. TopScoreNames[3] = TopScoreNames[2];
  529. TopScores[2] = TopScores[1];
  530. TopScoreNames[2] = TopScoreNames[1];
  531. TopScores[1] = Score;
  532. TopScoreNames[1] = pName;
  533. }
  534. else if(FinalPosition == 3)
  535. {
  536. new pName[MAX_PLAYER_NAME];
  537. GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
  538. TopScores[4] = TopScores[3];
  539. TopScoreNames[4] = TopScoreNames[3];
  540. TopScores[3] = TopScores[2];
  541. TopScoreNames[3] = TopScoreNames[2];
  542. TopScores[2] = Score;
  543. TopScoreNames[2] = pName;
  544. }
  545. else if(FinalPosition == 4)
  546. {
  547. new pName[MAX_PLAYER_NAME];
  548. GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
  549. TopScores[4] = TopScores[3];
  550. TopScoreNames[4] = TopScoreNames[3];
  551. TopScores[3] = Score;
  552. TopScoreNames[3] = pName;
  553. }
  554. else if(FinalPosition == 5)
  555. {
  556. new pName[MAX_PLAYER_NAME];
  557. GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
  558. TopScores[4] = Score;
  559. TopScoreNames[4] = pName;
  560. }
  561. new TxtStr[128];
  562. if(FinalPosition == 1)
  563. {
  564. new str[128];
  565. format(str, 128, "%s has set a new Kickstart-Challenge Highscore!! New highscore: %d", TopScoreNames[0], TopScores[0]);
  566. SendClientMessageToAll(0xFFFF00AA, str);
  567. format(TxtStr, 128, "~w~HighScores:~n~~y~#1: %d by %s~n~~r~#2: %d by %s~n~#3: %d by %s~n~#4: %d by %s~n~#5: %d by %s",
  568. TopScores[0], TopScoreNames[0],
  569. TopScores[1], TopScoreNames[1],
  570. TopScores[2], TopScoreNames[2],
  571. TopScores[3], TopScoreNames[3],
  572. TopScores[4], TopScoreNames[4]
  573. );
  574. }
  575. if(FinalPosition == 2)
  576. {
  577. format(TxtStr, 128, "~w~HighScores:~n~~r~#1: %d by %s~n~~y~#2: %d by %s~n~~r~#3: %d by %s~n~#4: %d by %s~n~#5: %d by %s",
  578. TopScores[0], TopScoreNames[0],
  579. TopScores[1], TopScoreNames[1],
  580. TopScores[2], TopScoreNames[2],
  581. TopScores[3], TopScoreNames[3],
  582. TopScores[4], TopScoreNames[4]
  583. );
  584. }
  585. if(FinalPosition == 3)
  586. {
  587. format(TxtStr, 128, "~w~HighScores:~n~~r~#1: %d by %s~n~#2: %d by %s~y~#3: %d by %s~n~~r~#4: %d by %s~n~#5: %d by %s",
  588. TopScores[0], TopScoreNames[0],
  589. TopScores[1], TopScoreNames[1],
  590. TopScores[2], TopScoreNames[2],
  591. TopScores[3], TopScoreNames[3],
  592. TopScores[4], TopScoreNames[4]
  593. );
  594. }
  595. if(FinalPosition == 4)
  596. {
  597. format(TxtStr, 128, "~w~HighScores:~n~~r~#1: %d by %s~n~#2: %d by %s~n~#3: %d by %s~n~~y~#4: %d by %s~n~~r~#5: %d by %s",
  598. TopScores[0], TopScoreNames[0],
  599. TopScores[1], TopScoreNames[1],
  600. TopScores[2], TopScoreNames[2],
  601. TopScores[3], TopScoreNames[3],
  602. TopScores[4], TopScoreNames[4]
  603. );
  604. }
  605. if(FinalPosition == 5)
  606. {
  607. format(TxtStr, 128, "~w~HighScores:~n~~r~#1: %d by %s~n~#2: %d by %s~n~#3: %d by %s~n~#4: %d by %s~n~~y~#5: %d by %s",
  608. TopScores[0], TopScoreNames[0],
  609. TopScores[1], TopScoreNames[1],
  610. TopScores[2], TopScoreNames[2],
  611. TopScores[3], TopScoreNames[3],
  612. TopScores[4], TopScoreNames[4]
  613. );
  614. }
  615. if(FinalPosition == -1)
  616. {
  617. format(TxtStr, 128, "~w~HighScores:~n~~r~#1: %d by %s~n~#2: %d by %s~n~#3: %d by %s~n~#4: %d by %s~n~#5: %d by %s",
  618. TopScores[0], TopScoreNames[0],
  619. TopScores[1], TopScoreNames[1],
  620. TopScores[2], TopScoreNames[2],
  621. TopScores[3], TopScoreNames[3],
  622. TopScores[4], TopScoreNames[4]
  623. );
  624. }
  625. ScoreBoard = TextDrawCreate(190, 200, TxtStr);
  626. TextDrawUseBox(ScoreBoard, 1);
  627. TextDrawBoxColor(ScoreBoard, 0x000000AA);
  628. TextDrawLetterSize(ScoreBoard, 0.7, 2.0);
  629. TextDrawShowForPlayer(playerid, ScoreBoard);
  630. }
  631.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement