Advertisement
Guest User

berj

a guest
Feb 18th, 2009
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 76.07 KB | None | 0 0
  1. /* Made by DutchDominator AKA H4rdc0r3.
  2. # Do not claim this as your own, if you use it, don't forget the credits.
  3. # Yes, you may change this script and republish it, but keep credits to me.*/
  4.  
  5.  
  6. #include <a_samp>
  7.  
  8. #define FILTERSCRIPT
  9.  
  10. //These are the coordinates your player will spawn at if they are still alive at the end of a minigame:
  11.  
  12. #define spawnX 1310.000000
  13. #define spawnY -1370.199951
  14. #define spawnZ 13.500000
  15. #define COLOR_GREY 0xAFAFAFAA
  16. #define COLOR_GREEN 0x33AA33AA
  17. #define COLOR_RED 0xAA3333AA
  18. #define COLOR_YELLOW 0xFFFF00AA
  19. #define COLOR_WHITE 0xFFFFFFAA
  20. #define COLOR_ORANGE 0xFF9900AA
  21. #define PLAYER_NORMAL 0
  22.  
  23. new playerinminigame[MAX_PLAYERS];
  24.  
  25. new bloodring[15],derbyon,derbyplaying,playercarid[MAX_PLAYERS],playerinderby[MAX_PLAYERS],derbyrank,reward,bloodringfull[15],playerinbloodring[MAX_PLAYERS];
  26.  
  27. new tdmon,tdmplaying,playerintdm[MAX_PLAYERS],tdmrank,redplayers,blueplayers,tdmcolor,oldplayercolor[MAX_PLAYERS];
  28.  
  29. new dmon,dmplaying,playerindm[MAX_PLAYERS],dmrank;
  30.  
  31. new qbloodring[15],qbloodringfull[15],playerinqderby[MAX_PLAYERS],playerinqbloodring[MAX_PLAYERS],qderbyrank,qderbyon,qderbyplaying;
  32.  
  33. new boxon,boxplaying,playerinbox[MAX_PLAYERS],boxrank;
  34.  
  35. new sdon,sdplaying,playerinsd[MAX_PLAYERS],sdrank,sdfirst;
  36.  
  37. new karts[15],kartfull[15],karton,kartplaying,playerinkartrace[MAX_PLAYERS],kartrank,playerinkart[MAX_PLAYERS],currentcheckpoint[MAX_PLAYERS],krtfirst;
  38.  
  39. new nrg[15],nrgfull[15],sron,srplaying,playerinsr[MAX_PLAYERS],srrank,playerinnrg[MAX_PLAYERS],currentracecheckpoint[MAX_PLAYERS],srfirst;
  40.  
  41. new startvar[8];
  42.  
  43. //Timers:
  44.  
  45. new dtimer,dmtimer,tdmtimer,qdtimer,boxtimer,sdtimer,krttimer,srtimer;
  46.  
  47. forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
  48. forward load();
  49.  
  50. forward Spawnbloodrings();// Derby
  51. forward Destroybloodrings();
  52. forward Respawnbloodrings();
  53. forward StartDerby();
  54.  
  55. forward Starttdm();// TeamDM
  56.  
  57. forward Startdm();// LVDM
  58.  
  59. forward Spawnqbloodrings();// Quarry Derby
  60. forward Destroyqbloodrings();
  61. forward Respawnqbloodrings();
  62. forward StartqDerby();
  63.  
  64. forward StartBox();// Boxing Fight
  65.  
  66. forward StartSd();// Skydive
  67. forward EndSd();
  68. forward SdFinish(playerid);
  69.  
  70. forward SpawnKarts();// KartRace
  71. forward DestroyKarts();
  72. forward RespawnKarts();
  73. forward StartKart();
  74. forward KrtFinish();
  75.  
  76. forward SpawnNrgs();// Stadium Race
  77. forward DestroyNrgs();
  78. forward RespawnNrgs();
  79. forward StartSr();
  80. forward SrFinish();
  81.  
  82. forward RewardCalc(playerid,min,max);// General reward calc.
  83.  
  84.  
  85. // Derby cars:
  86. new Float:derbycars[15][4] = {
  87. {-1362.9799,932.8219,1036.0580,9.0890}, // 0
  88. {-1346.4526,935.4996,1036.0889,13.6811}, // 1
  89. {-1335.6995,938.2600,1036.1177,16.8043}, // 2
  90. {-1320.8756,944.9904,1036.2062,27.0307}, // 3
  91. {-1306.8385,953.5919,1036.3212,37.8366}, // 4
  92. {-1353.9670,934.0486,1036.2421,11.5836}, // 5
  93. {-1328.6377,941.0197,1036.3208,18.9670}, // 6
  94. {-1313.9012,948.6513,1036.4198,29.5596}, // 7
  95. {-1501.0956,960.3203,1036.9474,313.0457}, // 8
  96. {-1506.8105,968.1082,1037.0840,304.3027}, // 9
  97. {-1513.0317,976.8713,1037.2457,301.9500}, // 10
  98. {-1516.0858,988.2343,1037.4362,274.5044}, // 11
  99. {-1517.6569,995.6628,1037.5626,272.2782}, // 12
  100. {-1515.1127,1004.8807,1037.6969,262.3869}, // 13
  101. {-1510.7020,1014.6202,1037.8568,249.1825} // 14
  102. };
  103.  
  104.  
  105. // LVDM Spawn places:
  106. new Float:lvdmspawns[15][3] = {
  107. {2297.5220,2484.1804,3.2734}, // 0
  108. {2271.5120,2474.2268,3.2734}, // 1
  109. {2244.7441,2467.5762,3.2734}, // 2
  110. {2248.0867,2448.3484,3.2734}, // 3
  111. {2267.7366,2439.3997,3.2734}, // 4
  112. {2286.3911,2434.0715,3.2734}, // 5
  113. {2302.9141,2441.9189,3.2734}, // 6
  114. {2265.5151,2494.8433,-0.3329}, // 7
  115. {2300.1218,2483.3733,-7.4531}, // 8
  116. {2281.1760,2480.1216,-7.4531}, // 9
  117. {2251.8474,2473.7490,-7.4531}, // 10
  118. {2227.2383,2460.1196,-7.4531}, // 11
  119. {2250.4229,2440.2544,-7.4531}, // 12
  120. {2293.2231,2438.4878,-7.4531}, // 13
  121. {2301.3645,2452.4045,-7.4531} // 14
  122. };
  123.  
  124. // Quarry derby cars:
  125. new Float:qderbycars[15][4] = {
  126. {605.7057,815.2199,-43.1692,350.9785}, // 0
  127. {609.4918,814.6188,-43.1692,350.9785}, // 1
  128. {613.3760,814.0021,-43.1692,350.9785}, // 2
  129. {616.5115,813.5043,-43.1692,350.9785}, // 3
  130. {619.8624,812.9723,-43.1691,350.9785}, // 4
  131. {622.9971,812.4746,-43.1691,350.9785}, // 5
  132. {678.2766,922.8008,-41.0451,115.3092}, // 6
  133. {680.1019,918.9395,-41.0066,115.3092}, // 7
  134. {681.3400,916.3724,-40.6739,115.2029}, // 8
  135. {682.7889,913.2912,-40.3585,115.2062}, // 9
  136. {491.2690,912.7574,-30.6622,248.8228}, // 10
  137. {489.9630,909.3635,-30.6003,248.8228}, // 11
  138. {488.5172,905.6060,-30.5318,248.8228}, // 12
  139. {488.1009,902.4600,-30.4778,262.3300}, // 13
  140. {487.7645,899.9181,-30.4341,262.3300} // 14
  141. };
  142.  
  143. // Karts:
  144. new Float:kartspawns[15][4] = {
  145. {-1366.1909,906.8451,1040.5919,280.3004}, // 0
  146. {-1366.4854,908.3992,1040.2843,280.3004}, // 1
  147. {-1366.8508,910.3288,1039.9022,280.3004}, // 2
  148. {-1367.2168,912.2613,1039.5195,280.3004}, // 3
  149. {-1367.7562,915.1094,1038.9557,280.3004}, // 4
  150. {-1368.4265,918.6667,1038.4503,280.3231}, // 5
  151. {-1368.8036,920.6827,1038.1428,280.3231}, // 6
  152. {-1369.1410,922.4866,1037.8677,280.3231}, // 7
  153. {-1372.5338,921.9490,1037.9705,277.8816}, // 8
  154. {-1372.2379,919.8677,1038.2872,277.8816}, // 9
  155. {-1371.9086,917.5515,1038.6396,277.8816}, // 10
  156. {-1371.6196,915.5192,1038.9486,277.8816}, // 11
  157. {-1371.2595,912.9866,1039.3340,277.8816}, // 12
  158. {-1371.0453,911.4792,1039.5632,277.8816}, // 13
  159. {-1370.6086,908.9531,1040.1785,275.7079} // 14
  160. };
  161.  
  162. new Float:nrgspawns[15][4] = {
  163. {-1436.5146,-595.6609,1055.5591,86.0952},
  164. {-1436.4534,-594.7911,1055.4529,86.1336},
  165. {-1436.3988,-594.0178,1055.3585,86.1336},
  166. {-1436.3256,-592.9784,1055.2316,86.1336},
  167. {-1436.2520,-591.9318,1055.1398,86.1124},
  168. {-1436.1643,-590.6272,1055.0952,86.1436},
  169. {-1436.1060,-589.7750,1055.0508,86.1436},
  170. {-1436.0160,-588.4620,1054.9822,86.1436},
  171. {-1435.9694,-587.7808,1054.9465,86.1436},
  172. {-1435.9060,-586.8561,1054.8982,86.1436},
  173. {-1435.8304,-586.0049,1054.8535,85.9079},
  174. {-1435.7190,-584.4737,1054.7749,85.9079},
  175. {-1435.6482,-583.4991,1054.7249,85.9079},
  176. {-1435.5737,-582.4772,1054.6724,85.9079},
  177. {-1435.4778,-581.1537,1054.5422,85.8982}
  178. };
  179.  
  180. // Kartrace checkpoints:
  181. new Float:kcps[5][3] = {
  182. {-1262.4230,1028.3113,1039.6948},
  183. {-1433.8792,1083.7178,1039.0344},
  184. {-1540.4967,1004.6923,1039.1409},
  185. {-1392.7269,914.2321,1039.8306},
  186. {-1392.7269,914.2321,1039.8306}
  187. };
  188.  
  189. new Float:srcps[10][3] = {
  190. {-1515.0345,-646.2552,1049.8767},
  191. {-1379.9943,-743.5076,1051.6895},
  192. {-1373.9252,-665.4581,1055.8362},
  193. {-1477.3721,-616.7951,1053.4919},
  194. {-1437.9470,-669.4881,1053.0645},
  195. {-1382.3152,-722.2056,1055.6273},
  196. {-1335.7629,-637.1422,1054.2230},
  197. {-1386.6233,-589.4922,1056.3871},
  198. {-1421.6000,-588.1021,1055.8623},
  199. {-1421.6000,-588.1021,1055.8623}
  200. };
  201.  
  202.  
  203. #if defined FILTERSCRIPT
  204.  
  205. public OnFilterScriptInit()
  206. {
  207. SetTimer("load",2000,0);
  208. return 1;
  209. }
  210.  
  211. public OnFilterScriptExit()
  212. {
  213. Destroybloodrings();
  214. Destroyqbloodrings();
  215. DestroyKarts();
  216. DestroyNrgs();
  217. return 1;
  218. }
  219.  
  220. #endif
  221.  
  222. public OnGameModeInit()
  223. {
  224. SetTimer("load",2000,0);
  225. return 1;
  226. }
  227.  
  228. public OnGameModeExit()
  229. {
  230. Destroybloodrings();
  231. Destroyqbloodrings();
  232. DestroyKarts();
  233. DestroyNrgs();
  234. return 1;
  235. }
  236.  
  237. public OnPlayerRequestClass(playerid, classid)
  238. {
  239. return 1;
  240. }
  241.  
  242. public OnPlayerRequestSpawn(playerid)
  243. {
  244. return 1;
  245. }
  246.  
  247. public OnPlayerConnect(playerid)
  248. {
  249. playerinminigame[playerid] = 0; // Checks if a player is in a minigame
  250. playercarid[playerid] = -1; // Car that player currently is in, used to check whether the player is in a derby/race car
  251.  
  252. playerinderby[playerid] = 0; // Derby
  253. playerinbloodring[playerid] = -1;
  254.  
  255. playerintdm[playerid] = 0; // TeamDM
  256.  
  257. playerindm[playerid] = 0; // LVDM
  258.  
  259. playerinqderby[playerid] = 0; // Quarry Derby
  260. playerinqbloodring[playerid] = -1;
  261.  
  262. playerinbox[playerid] = 0; // Boxing Fight
  263.  
  264. playerinkartrace[playerid] = 0; // Kart Race
  265. playerinkart[playerid] = -1;
  266. currentcheckpoint[playerid] = 0;
  267. return 1;
  268. }
  269.  
  270. public OnPlayerDisconnect(playerid, reason)
  271. {
  272. new string[256];
  273. if(playerinderby[playerid] == 1)
  274. {
  275. new DerbyPlayerName[MAX_PLAYER_NAME];
  276. GetPlayerName(playerid, DerbyPlayerName, sizeof(DerbyPlayerName));
  277. format(string, sizeof(string), "%s has been dropped out of the derby, rank %d", DerbyPlayerName, derbyrank);
  278. SendClientMessageToAll(COLOR_WHITE, string);
  279. playerinderby[playerid] = 0;
  280. playerinminigame[playerid] = 0;
  281. bloodringfull[playerinbloodring[playerid]] = 0;
  282. playerinbloodring[playerid] = -1;
  283. if(derbyrank <= 2)
  284. {
  285. for(new i=0; i<MAX_PLAYERS; i++)
  286. {
  287. if (IsPlayerConnected(i) && playerinderby[i] == 1)
  288. {
  289. new winnername[256];
  290. GetPlayerName(i,winnername, sizeof(winnername));
  291. RewardCalc(i,100,1000);
  292. format(string, sizeof(string), "%s has won the derby for $%d!", winnername, reward);
  293. SendClientMessageToAll(COLOR_WHITE, string);
  294. GivePlayerMoney(i,reward);
  295. playerinderby[i] = 0;
  296. playerinminigame[i] = 0;
  297. SetPlayerVirtualWorld(i,0);
  298. SetPlayerInterior(playerid, 0);
  299. SetPlayerPos(i, spawnX, spawnY, spawnZ);
  300. }
  301. }
  302. derbyplaying = 0;
  303. derbyrank = 0;
  304. derbyon = 0;
  305. KillTimer(dtimer);
  306. Respawnbloodrings();
  307. return 1;
  308. }
  309. derbyrank--;
  310. } else if(playerintdm[playerid] == 1) {
  311. new tdmPlayerName[MAX_PLAYER_NAME];
  312. GetPlayerName(playerid, tdmPlayerName, sizeof(tdmPlayerName));
  313. if(GetPlayerColor(playerid) == 0x0000BBAA)
  314. {
  315. format(string, sizeof(string), "%s has been dropped out of the team DM, team blue.", tdmPlayerName);
  316. blueplayers = blueplayers-1;
  317. } else {
  318. format(string, sizeof(string), "%s has been dropped out of the team DM, team red.", tdmPlayerName);
  319. redplayers = redplayers-1;
  320. }
  321. SendClientMessageToAll(COLOR_WHITE, string);
  322. playerintdm[playerid] = 0;
  323. playerinminigame[playerid] = 0;
  324. if(tdmrank == 0)
  325. {
  326. tdmplaying = 0;
  327. tdmrank = 0;
  328. tdmon = 0;
  329. KillTimer(tdmtimer);
  330. return 1;
  331. }
  332. if((blueplayers == 0 || redplayers == 0) && tdmplaying == 1)
  333. {
  334. if(blueplayers == 0)
  335. {
  336. format(string, sizeof(string), "Team red has won the team DM!");
  337. } else if(redplayers == 0)
  338. {
  339. format(string, sizeof(string), "Team blue has won the team DM!");
  340. }
  341. SendClientMessageToAll(COLOR_WHITE, string);
  342. for(new i=0; i<MAX_PLAYERS; i++)
  343. {
  344. if (IsPlayerConnected(i) && playerintdm[i] == 1)
  345. {
  346. playerintdm[i] = 0;
  347. playerinminigame[i] = 0;
  348. SetPlayerVirtualWorld(i,0);
  349. SetPlayerInterior(playerid, 0);
  350. SetPlayerColor(i,oldplayercolor[i]);
  351. SetPlayerPos(i, spawnX, spawnY, spawnZ);
  352. }
  353. }
  354. tdmplaying = 0;
  355. tdmrank = 0;
  356. tdmon = 0;
  357. KillTimer(tdmtimer);
  358. return 1;
  359. }
  360. tdmrank--;
  361. } else if(playerindm[playerid] == 1) {
  362. new dmPlayerName[MAX_PLAYER_NAME];
  363. GetPlayerName(playerid, dmPlayerName, sizeof(dmPlayerName));
  364. format(string, sizeof(string), "%s has been dropped out of the LVDM, rank %d", dmPlayerName, dmrank);
  365. SendClientMessageToAll(COLOR_WHITE, string);
  366. playerindm[playerid] = 0;
  367. playerinminigame[playerid] = 0;
  368. if(dmrank <= 2)
  369. {
  370. for(new i=0; i<MAX_PLAYERS; i++)
  371. {
  372. if (IsPlayerConnected(i) && playerindm[i] == 1)
  373. {
  374. new dmwinnername[256];
  375. GetPlayerName(i,dmwinnername, sizeof(dmwinnername));
  376. RewardCalc(i,100,1000);
  377. format(string, sizeof(string), "%s has won the LVDM for $%d!", dmwinnername, reward);
  378. SendClientMessageToAll(COLOR_WHITE, string);
  379. GivePlayerMoney(i,reward);
  380. playerindm[i] = 0;
  381. playerinminigame[i] = 0;
  382. SetPlayerVirtualWorld(i,0);
  383. SetPlayerInterior(playerid, 0);
  384. SetPlayerPos(i, spawnX, spawnY, spawnZ);
  385. }
  386. }
  387. dmplaying = 0;
  388. dmrank = 0;
  389. dmon = 0;
  390. KillTimer(dmtimer);
  391. return 1;
  392. }
  393. dmrank--;
  394. } else if(playerinqderby[playerid] == 1) {
  395. new DerbyPlayerName[MAX_PLAYER_NAME];
  396. GetPlayerName(playerid, DerbyPlayerName, sizeof(DerbyPlayerName));
  397. format(string, sizeof(string), "%s has been dropped out of the quarry derby, rank %d", DerbyPlayerName, qderbyrank);
  398. SendClientMessageToAll(COLOR_WHITE, string);
  399. playerinqderby[playerid] = 0;
  400. playerinminigame[playerid] = 0;
  401. qbloodringfull[playerinqbloodring[playerid]] = 0;
  402. playerinqbloodring[playerid] = -1;
  403. if(qderbyrank <= 2)
  404. {
  405. for(new i=0; i<MAX_PLAYERS; i++)
  406. {
  407. if (IsPlayerConnected(i) && playerinqderby[i] == 1)
  408. {
  409. new winnername[256];
  410. GetPlayerName(i,winnername, sizeof(winnername));
  411. RewardCalc(i,100,1000);
  412. format(string, sizeof(string), "%s has won the quarry derby for $%d!", winnername, reward);
  413. SendClientMessageToAll(COLOR_WHITE, string);
  414. GivePlayerMoney(i,reward);
  415. playerinqderby[i] = 0;
  416. playerinminigame[i] = 0;
  417. SetPlayerVirtualWorld(i,0);
  418. SetPlayerInterior(playerid, 0);
  419. SetPlayerPos(i, spawnX, spawnY, spawnZ);
  420. }
  421. }
  422. qderbyplaying = 0;
  423. qderbyrank = 0;
  424. qderbyon = 0;
  425. KillTimer(qdtimer);
  426. Respawnqbloodrings();
  427. return 1;
  428. }
  429. qderbyrank--;
  430. } else if(playerinbox[playerid] == 1) {
  431. new boxPlayerName[MAX_PLAYER_NAME];
  432. GetPlayerName(playerid, boxPlayerName, sizeof(boxPlayerName));
  433. format(string, sizeof(string), "%s has been dropped out of the boxing fight, rank %d", boxPlayerName, boxrank);
  434. SendClientMessageToAll(COLOR_WHITE, string);
  435. playerinbox[playerid] = 0;
  436. playerinminigame[playerid] = 0;
  437. if(boxrank <= 2)
  438. {
  439. for(new i=0; i<MAX_PLAYERS; i++)
  440. {
  441. if (IsPlayerConnected(i) && playerinbox[i] == 1)
  442. {
  443. new boxwinnername[256];
  444. GetPlayerName(i,boxwinnername, sizeof(boxwinnername));
  445. RewardCalc(i,100,1000);
  446. format(string, sizeof(string), "%s has won the boxing fight for $%d!", boxwinnername, reward);
  447. SendClientMessageToAll(COLOR_WHITE, string);
  448. GivePlayerMoney(i,reward);
  449. playerinbox[i] = 0;
  450. playerinminigame[i] = 0;
  451. SetPlayerVirtualWorld(i,0);
  452. SetPlayerInterior(playerid, 0);
  453. SetPlayerPos(i, spawnX, spawnY, spawnZ);
  454. }
  455. }
  456. boxplaying = 0;
  457. boxrank = 0;
  458. boxon = 0;
  459. KillTimer(boxtimer);
  460. return 1;
  461. }
  462. boxrank--;
  463. } else if(playerinsd[playerid] == 1) {
  464. new SkydivePlayerName[MAX_PLAYER_NAME];
  465. GetPlayerName(playerid, SkydivePlayerName, sizeof(SkydivePlayerName));
  466. format(string, sizeof(string), "%s has been dropped out of the skydive.", SkydivePlayerName);
  467. SendClientMessageToAll(COLOR_WHITE, string);
  468. playerinsd[playerid] = 0;
  469. playerinminigame[playerid] = 0;
  470. if(sdrank <= 1)
  471. {
  472. for(new i=0; i<MAX_PLAYERS; i++)
  473. {
  474. if (IsPlayerConnected(i) && playerinsd[i] == 1)
  475. {
  476. playerinsd[i] = 0;
  477. playerinminigame[i] = 0;
  478. SetPlayerVirtualWorld(i,0);
  479. SetPlayerInterior(playerid, 0);
  480. SetPlayerPos(i, spawnX, spawnY, spawnZ);
  481. }
  482. }
  483. sdplaying = 0;
  484. sdrank = 0;
  485. sdon = 0;
  486. sdfirst = 0;
  487. KillTimer(sdtimer);
  488. return 1;
  489. }
  490. sdrank--;
  491. } else if(playerinkartrace[playerid] == 1) {
  492. new KartPlayerName[MAX_PLAYER_NAME];
  493. GetPlayerName(playerid, KartPlayerName, sizeof(KartPlayerName));
  494. format(string, sizeof(string), "%s has been dropped out of the kart race.", KartPlayerName);
  495. SendClientMessageToAll(COLOR_WHITE, string);
  496. playerinkartrace[playerid] = 0;
  497. playerinminigame[playerid] = 0;
  498. kartfull[playerinkart[playerid]] = 0;
  499. playerinkart[playerid] = -1;
  500. if(kartrank <= 1)
  501. {
  502. for(new i=0; i<MAX_PLAYERS; i++)
  503. {
  504. if (IsPlayerConnected(i) && playerinkartrace[i] == 1)
  505. {
  506. playerinkartrace[i] = 0;
  507. playerinminigame[i] = 0;
  508. SetPlayerVirtualWorld(i,0);
  509. SetPlayerInterior(playerid, 0);
  510. SetPlayerPos(i, spawnX, spawnY, spawnZ);
  511. }
  512. }
  513. kartplaying = 0;
  514. kartrank = 0;
  515. karton = 0;
  516. KillTimer(krttimer);
  517. RespawnKarts();
  518. return 1;
  519. }
  520. kartrank--;
  521. } else if(playerinsr[playerid] == 1) {
  522. new SrPlayerName[MAX_PLAYER_NAME];
  523. GetPlayerName(playerid, SrPlayerName, sizeof(SrPlayerName));
  524. format(string, sizeof(string), "%s has been dropped out of the stadium race.", SrPlayerName);
  525. SendClientMessageToAll(COLOR_WHITE, string);
  526. playerinsr[playerid] = 0;
  527. playerinminigame[playerid] = 0;
  528. nrgfull[playerinnrg[playerid]] = 0;
  529. playerinnrg[playerid] = -1;
  530. if(kartrank <= 1)
  531. {
  532. for(new i=0; i<MAX_PLAYERS; i++)
  533. {
  534. if (IsPlayerConnected(i) && playerinsr[i] == 1)
  535. {
  536. playerinsr[i] = 0;
  537. playerinminigame[i] = 0;
  538. SetPlayerVirtualWorld(i,0);
  539. SetPlayerInterior(playerid, 0);
  540. SetPlayerPos(i, spawnX, spawnY, spawnZ);
  541. }
  542. }
  543. kartplaying = 0;
  544. kartrank = 0;
  545. karton = 0;
  546. KillTimer(srtimer);
  547. RespawnNrgs();
  548. return 1;
  549. }
  550. srrank--;
  551. }
  552. return 1;
  553. }
  554.  
  555. public OnPlayerSpawn(playerid)
  556. {
  557. return 1;
  558. }
  559.  
  560. public OnPlayerDeath(playerid, killerid, reason)
  561. {
  562. new string[256];
  563. if(playerinderby[playerid] == 1)
  564. {
  565. new DerbyPlayerName[MAX_PLAYER_NAME];
  566. GetPlayerName(playerid, DerbyPlayerName, sizeof(DerbyPlayerName));
  567. format(string, sizeof(string), "%s has been dropped out of the derby, rank %d", DerbyPlayerName, derbyrank);
  568. SendClientMessageToAll(COLOR_WHITE, string);
  569. playerinderby[playerid] = 0;
  570. playerinminigame[playerid] = 0;
  571. bloodringfull[playerinbloodring[playerid]] = 0;
  572. playerinbloodring[playerid] = -1;
  573. if(derbyrank <= 2)
  574. {
  575. for(new i=0; i<MAX_PLAYERS; i++)
  576. {
  577. if (IsPlayerConnected(i) && playerinderby[i] == 1)
  578. {
  579. new winnername[256];
  580. GetPlayerName(i,winnername, sizeof(winnername));
  581. RewardCalc(i,100,1000);
  582. format(string, sizeof(string), "%s has won the derby for $%d!", winnername, reward);
  583. SendClientMessageToAll(COLOR_WHITE, string);
  584. GivePlayerMoney(i,reward);
  585. playerinderby[i] = 0;
  586. playerinminigame[i] = 0;
  587. SetPlayerVirtualWorld(i,0);
  588. SetPlayerInterior(playerid, 0);
  589. SetPlayerPos(i, spawnX, spawnY, spawnZ);
  590. }
  591. }
  592. derbyplaying = 0;
  593. derbyrank = 0;
  594. derbyon = 0;
  595. KillTimer(dtimer);
  596. Respawnbloodrings();
  597. return 1;
  598. }
  599. derbyrank--;
  600. } else if(playerintdm[playerid] == 1) {
  601. new tdmPlayerName[MAX_PLAYER_NAME];
  602. GetPlayerName(playerid, tdmPlayerName, sizeof(tdmPlayerName));
  603. if(GetPlayerColor(playerid) == 0x0000BBAA)
  604. {
  605. format(string, sizeof(string), "%s has been dropped out of the team DM, team blue.", tdmPlayerName);
  606. blueplayers = blueplayers-1;
  607. } else {
  608. format(string, sizeof(string), "%s has been dropped out of the team DM, team red.", tdmPlayerName);
  609. redplayers = redplayers-1;
  610. }
  611. SendClientMessageToAll(COLOR_WHITE, string);
  612. playerintdm[playerid] = 0;
  613. playerinminigame[playerid] = 0;
  614. if(tdmrank == 0)
  615. {
  616. tdmplaying = 0;
  617. tdmrank = 0;
  618. tdmon = 0;
  619. KillTimer(tdmtimer);
  620. return 1;
  621. }
  622. if((blueplayers == 0 || redplayers == 0) && tdmplaying == 1)
  623. {
  624. if(blueplayers == 0)
  625. {
  626. format(string, sizeof(string), "Team red has won the team DM!");
  627. } else if(redplayers == 0)
  628. {
  629. format(string, sizeof(string), "Team blue has won the team DM!");
  630. }
  631. SendClientMessageToAll(COLOR_WHITE, string);
  632. for(new i=0; i<MAX_PLAYERS; i++)
  633. {
  634. if (IsPlayerConnected(i) && playerintdm[i] == 1)
  635. {
  636. playerintdm[i] = 0;
  637. playerinminigame[i] = 0;
  638. SetPlayerVirtualWorld(i,0);
  639. SetPlayerInterior(playerid, 0);
  640. SetPlayerColor(i,oldplayercolor[i]);
  641. SetPlayerPos(i, spawnX, spawnY, spawnZ);
  642. }
  643. }
  644. tdmplaying = 0;
  645. tdmrank = 0;
  646. tdmon = 0;
  647. KillTimer(tdmtimer);
  648. return 1;
  649. }
  650. tdmrank--;
  651. } else if(playerindm[playerid] == 1) {
  652. new dmPlayerName[MAX_PLAYER_NAME];
  653. GetPlayerName(playerid, dmPlayerName, sizeof(dmPlayerName));
  654. format(string, sizeof(string), "%s has been dropped out of the LVDM, rank %d", dmPlayerName, dmrank);
  655. SendClientMessageToAll(COLOR_WHITE, string);
  656. playerindm[playerid] = 0;
  657. playerinminigame[playerid] = 0;
  658. if(dmrank <= 2)
  659. {
  660. for(new i=0; i<MAX_PLAYERS; i++)
  661. {
  662. if (IsPlayerConnected(i) && playerindm[i] == 1)
  663. {
  664. new dmwinnername[256];
  665. GetPlayerName(i,dmwinnername, sizeof(dmwinnername));
  666. RewardCalc(i,100,1000);
  667. format(string, sizeof(string), "%s has won the LVDM for $%d!", dmwinnername, reward);
  668. SendClientMessageToAll(COLOR_WHITE, string);
  669. GivePlayerMoney(i,reward);
  670. playerindm[i] = 0;
  671. playerinminigame[i] = 0;
  672. SetPlayerVirtualWorld(i,0);
  673. SetPlayerInterior(playerid, 0);
  674. SetPlayerPos(i, spawnX, spawnY, spawnZ);
  675. }
  676. }
  677. dmplaying = 0;
  678. dmrank = 0;
  679. dmon = 0;
  680. KillTimer(dmtimer);
  681. return 1;
  682. }
  683. dmrank--;
  684. } else if(playerinqderby[playerid] == 1) {
  685. new DerbyPlayerName[MAX_PLAYER_NAME];
  686. GetPlayerName(playerid, DerbyPlayerName, sizeof(DerbyPlayerName));
  687. format(string, sizeof(string), "%s has been dropped out of the quarry derby, rank %d", DerbyPlayerName, qderbyrank);
  688. SendClientMessageToAll(COLOR_WHITE, string);
  689. playerinqderby[playerid] = 0;
  690. playerinminigame[playerid] = 0;
  691. qbloodringfull[playerinqbloodring[playerid]] = 0;
  692. playerinqbloodring[playerid] = -1;
  693. if(qderbyrank <= 2)
  694. {
  695. for(new i=0; i<MAX_PLAYERS; i++)
  696. {
  697. if (IsPlayerConnected(i) && playerinqderby[i] == 1)
  698. {
  699. new winnername[256];
  700. GetPlayerName(i,winnername, sizeof(winnername));
  701. RewardCalc(i,100,1000);
  702. format(string, sizeof(string), "%s has won the quarry derby for $%d!", winnername, reward);
  703. SendClientMessageToAll(COLOR_WHITE, string);
  704. GivePlayerMoney(i,reward);
  705. playerinqderby[i] = 0;
  706. playerinminigame[i] = 0;
  707. SetPlayerVirtualWorld(i,0);
  708. SetPlayerInterior(playerid, 0);
  709. SetPlayerPos(i, spawnX, spawnY, spawnZ);
  710. }
  711. }
  712. qderbyplaying = 0;
  713. qderbyrank = 0;
  714. qderbyon = 0;
  715. KillTimer(qdtimer);
  716. Respawnqbloodrings();
  717. return 1;
  718. }
  719. qderbyrank--;
  720. } else if(playerinbox[playerid] == 1) {
  721. new boxPlayerName[MAX_PLAYER_NAME];
  722. GetPlayerName(playerid, boxPlayerName, sizeof(boxPlayerName));
  723. format(string, sizeof(string), "%s has been dropped out of the boxing fight, rank %d", boxPlayerName, boxrank);
  724. SendClientMessageToAll(COLOR_WHITE, string);
  725. playerinbox[playerid] = 0;
  726. playerinminigame[playerid] = 0;
  727. if(boxrank <= 2)
  728. {
  729. for(new i=0; i<MAX_PLAYERS; i++)
  730. {
  731. if (IsPlayerConnected(i) && playerinbox[i] == 1)
  732. {
  733. new boxwinnername[256];
  734. GetPlayerName(i,boxwinnername, sizeof(boxwinnername));
  735. RewardCalc(i,100,1000);
  736. format(string, sizeof(string), "%s has won the boxing fight for $%d!", boxwinnername, reward);
  737. SendClientMessageToAll(COLOR_WHITE, string);
  738. GivePlayerMoney(i,reward);
  739. playerinbox[i] = 0;
  740. playerinminigame[i] = 0;
  741. SetPlayerVirtualWorld(i,0);
  742. SetPlayerInterior(playerid, 0);
  743. SetPlayerPos(i, spawnX, spawnY, spawnZ);
  744. }
  745. }
  746. boxplaying = 0;
  747. boxrank = 0;
  748. boxon = 0;
  749. KillTimer(boxtimer);
  750. return 1;
  751. }
  752. boxrank--;
  753. } else if(playerinsd[playerid] == 1) {
  754. new SkydivePlayerName[MAX_PLAYER_NAME];
  755. GetPlayerName(playerid, SkydivePlayerName, sizeof(SkydivePlayerName));
  756. format(string, sizeof(string), "%s has been dropped out of the skydive.", SkydivePlayerName);
  757. SendClientMessageToAll(COLOR_WHITE, string);
  758. playerinsd[playerid] = 0;
  759. playerinminigame[playerid] = 0;
  760. if(sdrank <= 1)
  761. {
  762. for(new i=0; i<MAX_PLAYERS; i++)
  763. {
  764. if (IsPlayerConnected(i) && playerinsd[i] == 1)
  765. {
  766. playerinsd[i] = 0;
  767. playerinminigame[i] = 0;
  768. SetPlayerVirtualWorld(i,0);
  769. SetPlayerInterior(playerid, 0);
  770. SetPlayerPos(i, spawnX, spawnY, spawnZ);
  771. }
  772. }
  773. sdplaying = 0;
  774. sdrank = 0;
  775. sdon = 0;
  776. sdfirst = 0;
  777. KillTimer(sdtimer);
  778. return 1;
  779. }
  780. sdrank--;
  781. } else if(playerinkartrace[playerid] == 1) {
  782. new KartPlayerName[MAX_PLAYER_NAME];
  783. GetPlayerName(playerid, KartPlayerName, sizeof(KartPlayerName));
  784. format(string, sizeof(string), "%s has been dropped out of the kart race.", KartPlayerName);
  785. SendClientMessageToAll(COLOR_WHITE, string);
  786. playerinkartrace[playerid] = 0;
  787. playerinminigame[playerid] = 0;
  788. kartfull[playerinkart[playerid]] = 0;
  789. playerinkart[playerid] = -1;
  790. if(kartrank <= 1)
  791. {
  792. for(new i=0; i<MAX_PLAYERS; i++)
  793. {
  794. if (IsPlayerConnected(i) && playerinkartrace[i] == 1)
  795. {
  796. playerinkartrace[i] = 0;
  797. playerinminigame[i] = 0;
  798. SetPlayerVirtualWorld(i,0);
  799. SetPlayerInterior(playerid, 0);
  800. SetPlayerPos(i, spawnX, spawnY, spawnZ);
  801. }
  802. }
  803. kartplaying = 0;
  804. kartrank = 0;
  805. karton = 0;
  806. KillTimer(krttimer);
  807. RespawnKarts();
  808. return 1;
  809. }
  810. kartrank--;
  811. } else if(playerinsr[playerid] == 1) {
  812. new SrPlayerName[MAX_PLAYER_NAME];
  813. GetPlayerName(playerid, SrPlayerName, sizeof(SrPlayerName));
  814. format(string, sizeof(string), "%s has been dropped out of the stadium race.", SrPlayerName);
  815. SendClientMessageToAll(COLOR_WHITE, string);
  816. playerinsr[playerid] = 0;
  817. playerinminigame[playerid] = 0;
  818. nrgfull[playerinnrg[playerid]] = 0;
  819. playerinnrg[playerid] = -1;
  820. if(kartrank <= 1)
  821. {
  822. for(new i=0; i<MAX_PLAYERS; i++)
  823. {
  824. if (IsPlayerConnected(i) && playerinsr[i] == 1)
  825. {
  826. playerinsr[i] = 0;
  827. playerinminigame[i] = 0;
  828. SetPlayerVirtualWorld(i,0);
  829. SetPlayerInterior(playerid, 0);
  830. SetPlayerPos(i, spawnX, spawnY, spawnZ);
  831. }
  832. }
  833. srplaying = 0;
  834. srrank = 0;
  835. sron = 0;
  836. KillTimer(srtimer);
  837. RespawnNrgs();
  838. return 1;
  839. }
  840. srrank--;
  841. }
  842. return 1;
  843. }
  844.  
  845. public OnVehicleSpawn(vehicleid)
  846. {
  847. return 1;
  848. }
  849.  
  850. public OnVehicleDeath(vehicleid, killerid)
  851. {
  852. return 1;
  853. }
  854.  
  855. public OnPlayerText(playerid, text[])
  856. {
  857. return 1;
  858. }
  859.  
  860. public OnPlayerPrivmsg(playerid, recieverid, text[])
  861. {
  862. return 1;
  863. }
  864.  
  865. public OnPlayerCommandText(playerid, cmdtext[])
  866. {
  867. new cmd[256];
  868. new idx;
  869. new string[256];
  870. new tmp[256];
  871. cmd = strtok(cmdtext, idx);
  872.  
  873. if(strcmp(cmd, "/4cf5f4", true) == 0)
  874. {
  875. if(playerinminigame[playerid])
  876. {
  877. SendClientMessage(playerid, 0x33AA33AA, "To prevent abuse, /mark and /gotomark are disabled in minigames.");
  878. return 1;
  879. }
  880. }
  881.  
  882. if(strcmp(cmd, "/54dd4r4c", true) == 0)
  883. {
  884. if(playerinminigame[playerid])
  885. {
  886. SendClientMessage(playerid, 0x33AA33AA, "To prevent abuse, /mark and /gotomark are disabled in minigames.");
  887. return 1;
  888. }
  889. }
  890.  
  891. if(strcmp(cmd, "/minigames", true) == 0)
  892. {
  893. SendClientMessage(playerid, COLOR_YELLOW, "These minigames are currently available:");
  894. SendClientMessage(playerid, COLOR_GREEN, "/derby /teamdm /lvdm /qderby /boxing /kartrace /srace");
  895. SendClientMessage(playerid, COLOR_YELLOW, "Type /info for more information about seperate minigames.");
  896. return 1;
  897. }
  898.  
  899. if(strcmp(cmd, "/info", true) == 0)
  900. {
  901. tmp = strtok(cmdtext, idx);
  902. if(!strlen(tmp))
  903. {
  904. SendClientMessage(playerid,COLOR_YELLOW, "Usage: /info [minigame command]");
  905. SendClientMessage(playerid,COLOR_YELLOW, "Minigame commands: derby teamdm lvdm qderby boxing kartrace srace");
  906. return 1;
  907. }
  908.  
  909. if(strcmp(tmp, "derby", true) == 0){
  910. SendClientMessage(playerid, 0xFF0000FF, "Derby: A destruction derby in the Bloodbowl.");
  911. SendClientMessage(playerid, 0xFF0000FF, "Your goal is to destroy everyone other's car, and keep your own car intact.");
  912. }else if(strcmp(tmp, "teamdm", true) == 0){
  913. SendClientMessage(playerid, 0xFF0000FF, "Team DM: A team deathmatch in Area 51 with two teams, red and blue.");
  914. SendClientMessage(playerid, 0xFF0000FF, "Your goal is kill everyone of the other team.");
  915. }else if(strcmp(tmp, "lvdm", true) == 0){
  916. SendClientMessage(playerid, 0xFF0000FF, "LVDM: A deathmatch in the LVPD.");
  917. SendClientMessage(playerid, 0xFF0000FF, "Your goal kill other people, and stay alive.");
  918. }else if(strcmp(tmp, "qderby", true) == 0){
  919. SendClientMessage(playerid, 0xFF0000FF, "Quarry derby: A destruction derby in the Quarry.");
  920. SendClientMessage(playerid, 0xFF0000FF, "Your goal is to destroy everyone other's car, and keep your own car intact.");
  921. }else if(strcmp(tmp, "boxing", true) == 0){
  922. SendClientMessage(playerid, 0xFF0000FF, "Boxing: A deathmatch without weapons, only fisting.");
  923. SendClientMessage(playerid, 0xFF0000FF, "Your goal kill other people, and stay alive.");
  924. }else if(strcmp(tmp, "7f444d41d", true) == 0){
  925. SendClientMessage(playerid, 0xFF0000FF, "Skydive: A skydive minigame.");
  926. SendClientMessage(playerid, 0xFF0000FF, "Your goal is to land on the tower as first. You must stay alive for 2 seconds there.");
  927. }else if(strcmp(tmp, "kartrace", true) == 0){
  928. SendClientMessage(playerid, 0xFF0000FF, "Kartrace: A race with karts around the Bloodbowl.");
  929. SendClientMessage(playerid, 0xFF0000FF, "Your goal is to drive two laps in the fastest time.");
  930. }else if(strcmp(tmp, "srace", true) == 0){
  931. SendClientMessage(playerid, 0xFF0000FF, "Stadium race: A race in the Vice Stadium, with NRG's.");
  932. SendClientMessage(playerid, 0xFF0000FF, "Your goal is to drive one lap in the fastest time.");
  933. }
  934. return 1;
  935. }
  936.  
  937. if(strcmp(cmd, "/derby", true) == 0)
  938. {
  939. if(derbyplaying == 1)
  940. {
  941. SendClientMessage(playerid, COLOR_GREEN, "The derby is already started!");
  942. return 1;
  943. }
  944. if(playerinminigame[playerid] == 1)
  945. {
  946. SendClientMessage(playerid, COLOR_GREEN, "You are already in a minigame!");
  947. return 1;
  948. }
  949. new pname[256];
  950. GetPlayerName(playerid, pname, 256);
  951. if(derbyon == 0)
  952. {
  953. derbyon = 1;
  954. playerinminigame[playerid] = 1;
  955. playerinderby[playerid] = 1;
  956. derbyrank = 1;
  957. SetPlayerInterior(playerid,15);
  958. SetPlayerVirtualWorld(playerid,7);
  959. SetPlayerVirtualWorld(bloodring[0],7);
  960. bloodringfull[0] = 1;
  961. PutPlayerInVehicle(playerid, bloodring[0], 0);
  962. SetVehicleHealth(playerid,10);
  963. playerinbloodring[playerid] = 0;
  964. TogglePlayerControllable(playerid, 0);
  965. startvar[0] = 1;
  966. dtimer = SetTimer("StartDerby", 20000, 0);
  967. format(string, sizeof(string), "*** Derby started! You have 20 seconds to type /derby if you want to join!", pname);//
  968. SendClientMessageToAll(COLOR_YELLOW,string);
  969. format(string, sizeof(string), "~y~Deconstruction derby started! Want to join? Type ~w~/derby~y~!");
  970. for(new i = 0; i < MAX_PLAYERS; i++)
  971. if(IsPlayerConnected(i))
  972. GameTextForPlayer(i, string, 7000, 3);
  973. return 1;
  974. } else if(derbyon == 1 && derbyrank < 15) {
  975. playerinminigame[playerid] = 1;
  976. playerinderby[playerid] = 1;
  977. derbyrank++;
  978. SetPlayerInterior(playerid,15);
  979. SetVehicleHealth(playerid,10);
  980. for(new i=0; i<15; i++)
  981. {
  982. if(bloodringfull[i] == 0)
  983. {
  984. SetPlayerVirtualWorld(playerid,7);
  985. SetVehicleVirtualWorld(bloodring[i],7);
  986. SetVehicleHealth(playerid,5);
  987. bloodringfull[i] = 1;
  988. PutPlayerInVehicle(playerid, bloodring[i], 0);
  989. TogglePlayerControllable(playerid, 0);
  990. playerinbloodring[playerid] = i;
  991. format(string, sizeof(string), "%s has joined the derby.", pname);//
  992. SendClientMessageToAll(COLOR_WHITE,string);
  993. return 1;
  994. }
  995. }
  996. } else if(derbyon == 1 && derbyrank >= 15) {
  997. format(string, sizeof(string), "The derby is already in progress. Please wait until it finishes and try again.", pname);//
  998. SendClientMessage(playerid,COLOR_GREEN,string);
  999. return 1;
  1000. }
  1001. }
  1002.  
  1003. if(strcmp(cmd, "/teamdm", true) == 0)
  1004. {
  1005. if(tdmplaying == 1)
  1006. {
  1007. SendClientMessage(playerid, COLOR_GREEN, "The team DM is already started!");
  1008. return 1;
  1009. }
  1010. if(playerinminigame[playerid] == 1)
  1011. {
  1012. SendClientMessage(playerid, COLOR_GREEN, "You are already in a minigame!");
  1013. return 1;
  1014. }
  1015. new pname[256];
  1016. GetPlayerName(playerid, pname, 256);
  1017. if(tdmon == 0)
  1018. {
  1019. tdmon = 1;
  1020. playerintdm[playerid] = 1;
  1021. playerinminigame[playerid] = 1;
  1022. tdmrank = 1;
  1023. TogglePlayerControllable(playerid, 0);
  1024. SetPlayerInterior(playerid,0);
  1025. SetPlayerVirtualWorld(playerid,0);
  1026. SetPlayerPos(playerid,208.8376,1863.5388,13.1406);
  1027. ResetPlayerWeapons(playerid);
  1028. GivePlayerWeapon(playerid,26,50000);
  1029. GivePlayerWeapon(playerid,31,50000);
  1030. GivePlayerWeapon(playerid,32,50000);
  1031. SetPlayerHealth(playerid,100);
  1032. SetPlayerArmour(playerid,100);
  1033. oldplayercolor[playerid] = GetPlayerColor(playerid);
  1034. SetPlayerColor(playerid,0x0000BBAA);// BLUE
  1035. blueplayers = 1;
  1036. redplayers = 0;
  1037. tdmcolor = 1;
  1038. startvar[1] = 1;
  1039. tdmtimer = SetTimer("Starttdm", 20000, 0);
  1040. format(string, sizeof(string), "*** Team DM started! You have 20 seconds to type /teamdm if you want to join!", pname);//
  1041. SendClientMessageToAll(COLOR_YELLOW,string);
  1042. format(string, sizeof(string), "~y~Team DM has started! Want to join? Type ~w~/boxing~y~!");
  1043. for(new i = 0; i < MAX_PLAYERS; i++)
  1044. if(IsPlayerConnected(i))
  1045. GameTextForPlayer(i, string, 7000, 3);
  1046. return 1;
  1047. } else if(tdmon == 1 && tdmcolor == 1) {
  1048. playerintdm[playerid] = 1;
  1049. playerinminigame[playerid] = 1;
  1050. tdmrank++;
  1051. TogglePlayerControllable(playerid, 0);
  1052. SetPlayerInterior(playerid,0);
  1053. SetPlayerVirtualWorld(playerid,0);
  1054. SetPlayerPos(playerid,268.6240,1882.8805,-30.0938);
  1055. ResetPlayerWeapons(playerid);
  1056. GivePlayerWeapon(playerid,26,50000);
  1057. GivePlayerWeapon(playerid,31,50000);
  1058. GivePlayerWeapon(playerid,32,50000);
  1059. SetPlayerHealth(playerid,100);
  1060. SetPlayerArmour(playerid,100);
  1061. oldplayercolor[playerid] = GetPlayerColor(playerid);
  1062. SetPlayerColor(playerid,0xAA3333AA);// RED
  1063. redplayers++;
  1064. tdmcolor = 0;
  1065. format(string, sizeof(string), "%s has joined the team DM, team red.", pname);//
  1066. SendClientMessageToAll(COLOR_WHITE,string);
  1067. return 1;
  1068. } else if(tdmon == 1 && tdmcolor == 0) {
  1069. playerintdm[playerid] = 1;
  1070. playerinminigame[playerid] = 1;
  1071. tdmrank++;
  1072. TogglePlayerControllable(playerid, 0);
  1073. SetPlayerInterior(playerid,0);
  1074. SetPlayerVirtualWorld(playerid,0);
  1075. SetPlayerPos(playerid,208.8376,1863.5388,13.1406);
  1076. ResetPlayerWeapons(playerid);
  1077. GivePlayerWeapon(playerid,26,50000);
  1078. GivePlayerWeapon(playerid,31,50000);
  1079. GivePlayerWeapon(playerid,32,50000);
  1080. SetPlayerHealth(playerid,100);
  1081. SetPlayerArmour(playerid,100);
  1082. oldplayercolor[playerid] = GetPlayerColor(playerid);
  1083. SetPlayerColor(playerid,0x0000BBAA);// BLUE
  1084. blueplayers++;
  1085. tdmcolor = 1;
  1086. format(string, sizeof(string), "%s has joined the team DM, team blue.", pname);//
  1087. SendClientMessageToAll(COLOR_WHITE,string);
  1088. return 1;
  1089. }
  1090. }
  1091. if(strcmp(cmd, "/lvdm", true) == 0)
  1092. {
  1093. if(dmplaying == 1)
  1094. {
  1095. SendClientMessage(playerid, COLOR_GREEN, "The LVDM is already started!");
  1096. return 1;
  1097. }
  1098. if(playerinminigame[playerid] == 1)
  1099. {
  1100. SendClientMessage(playerid, COLOR_GREEN, "You are already in a minigame!");
  1101. return 1;
  1102. }
  1103. new pname[256];
  1104. GetPlayerName(playerid, pname, 256);
  1105. if(dmon == 0)
  1106. {
  1107. dmon = 1;
  1108. playerindm[playerid] = 1;
  1109. playerinminigame[playerid] = 1;
  1110. dmrank = 1;
  1111. TogglePlayerControllable(playerid, 0);
  1112. SetPlayerInterior(playerid,0);
  1113. SetPlayerVirtualWorld(playerid,0);
  1114. SetPlayerPos(playerid,lvdmspawns[0][0],lvdmspawns[0][1],lvdmspawns[0][2]);
  1115. ResetPlayerWeapons(playerid);
  1116. GivePlayerWeapon(playerid,26,50000);
  1117. GivePlayerWeapon(playerid,32,50000);
  1118. GivePlayerWeapon(playerid,31,50000);
  1119. SetPlayerHealth(playerid,100);
  1120. SetPlayerArmour(playerid,100);
  1121. startvar[2] = 1;
  1122. dmtimer = SetTimer("Startdm", 20000, 0);
  1123. format(string, sizeof(string), "*** LVDM started! You have 20 seconds to type /lvdm if you want to join!", pname);//
  1124. SendClientMessageToAll(COLOR_YELLOW,string);
  1125. format(string, sizeof(string), "~y~LVDM has started! Want to join? Type ~w~/lvdm~y~!");
  1126. for(new i = 0; i < MAX_PLAYERS; i++)
  1127. if(IsPlayerConnected(i))
  1128. GameTextForPlayer(i, string, 7000, 3);
  1129. return 1;
  1130. } else if(dmon == 1 && dmrank <= 15) {
  1131. playerindm[playerid] = 1;
  1132. TogglePlayerControllable(playerid, 0);
  1133. SetPlayerInterior(playerid,0);
  1134. SetPlayerVirtualWorld(playerid,0);
  1135. SetPlayerPos(playerid,lvdmspawns[dmrank][0],lvdmspawns[dmrank][1],lvdmspawns[dmrank][2]);
  1136. dmrank++;
  1137. ResetPlayerWeapons(playerid);
  1138. GivePlayerWeapon(playerid,26,50000);
  1139. GivePlayerWeapon(playerid,32,50000);
  1140. GivePlayerWeapon(playerid,31,50000);
  1141. SetPlayerHealth(playerid,100);
  1142. SetPlayerArmour(playerid,100);
  1143. format(string, sizeof(string), "%s has joined the LVDM.", pname);//
  1144. SendClientMessageToAll(COLOR_WHITE,string);
  1145. return 1;
  1146. } else if(dmon == 1 && dmrank == 16) {
  1147. format(string, sizeof(string), "The LVDM is already in progress. Please wait until it finishes and try again.");//
  1148. SendClientMessage(playerid,COLOR_GREEN,string);
  1149. }
  1150. }
  1151.  
  1152. if(strcmp(cmd, "/qderby", true) == 0)
  1153. {
  1154. if(qderbyplaying == 1)
  1155. {
  1156. SendClientMessage(playerid, COLOR_GREEN, "The derby is already started!");
  1157. return 1;
  1158. }
  1159. if(playerinminigame[playerid] == 1)
  1160. {
  1161. SendClientMessage(playerid, COLOR_GREEN, "You are already in a minigame!");
  1162. return 1;
  1163. }
  1164. new pname[256];
  1165. GetPlayerName(playerid, pname, 256);
  1166. if(qderbyon == 0)
  1167. {
  1168. Respawnqbloodrings();
  1169. qderbyon = 1;
  1170. playerinminigame[playerid] = 1;
  1171. playerinqderby[playerid] = 1;
  1172. qderbyrank = 1;
  1173. SetPlayerInterior(playerid,0);
  1174. SetPlayerVirtualWorld(playerid,7);
  1175. SetVehicleVirtualWorld(qbloodring[0],7);
  1176. SetVehicleHealth(playerid,5);
  1177. qbloodringfull[0] = 1;
  1178. PutPlayerInVehicle(playerid, qbloodring[0], 0);
  1179. playerinqbloodring[playerid] = 0;
  1180. TogglePlayerControllable(playerid, 0);
  1181. startvar[3] = 1;
  1182. qdtimer = SetTimer("StartqDerby", 20000, 0);
  1183. format(string, sizeof(string), "*** Quarry derby started! You have 20 seconds to type /qderby if you want to join!", pname);//
  1184. SendClientMessageToAll(COLOR_YELLOW,string);
  1185. format(string, sizeof(string), "~y~Quarry derby has started! Want to join? Type ~w~/qderby~y~!");
  1186. for(new i = 0; i < MAX_PLAYERS; i++)
  1187. if(IsPlayerConnected(i))
  1188. GameTextForPlayer(i, string, 7000, 3);
  1189. return 1;
  1190. } else if(qderbyon == 1 && qderbyrank < 15) {
  1191. playerinminigame[playerid] = 1;
  1192. playerinqderby[playerid] = 1;
  1193. qderbyrank++;
  1194. SetPlayerInterior(playerid,0);
  1195. SetVehicleHealth(playerid,5);
  1196. for(new i=0; i<15; i++)
  1197. {
  1198. if(qbloodringfull[i] == 0)
  1199. {
  1200. SetPlayerVirtualWorld(playerid,7);
  1201. SetVehicleVirtualWorld(qbloodring[i],7);
  1202. SetVehicleHealth(playerid,5);
  1203. qbloodringfull[i] = 1;
  1204. PutPlayerInVehicle(playerid, qbloodring[i], 0);
  1205. TogglePlayerControllable(playerid, 0);
  1206. playerinqbloodring[playerid] = i;
  1207. format(string, sizeof(string), "%s has joined the quarry derby.", pname);//
  1208. SendClientMessageToAll(COLOR_WHITE,string);
  1209. return 1;
  1210. }
  1211. }
  1212. } else if(qderbyon == 1 && qderbyrank >= 15) {
  1213. format(string, sizeof(string), "The derby is already in progress. Please wait until it finishes and try again.", pname);//
  1214. SendClientMessage(playerid,COLOR_GREEN,string);
  1215. return 1;
  1216. }
  1217. }
  1218.  
  1219. if(strcmp(cmd, "/boxing", true) == 0)
  1220. {
  1221. if(boxplaying == 1)
  1222. {
  1223. SendClientMessage(playerid, COLOR_GREEN, "The boxing fight is already started!");
  1224. return 1;
  1225. }
  1226. if(playerinminigame[playerid] == 1)
  1227. {
  1228. SendClientMessage(playerid, COLOR_GREEN, "You are already in a minigame!");
  1229. return 1;
  1230. }
  1231. new pname[256];
  1232. GetPlayerName(playerid, pname, 256);
  1233. if(boxon == 0)
  1234. {
  1235. boxon = 1;
  1236. playerinbox[playerid] = 1;
  1237. playerinminigame[playerid] = 1;
  1238. boxrank = 1;
  1239. TogglePlayerControllable(playerid, 0);
  1240. SetPlayerInterior(playerid,0);
  1241. SetPlayerVirtualWorld(playerid,0);
  1242. SetPlayerPos(playerid,2496.479,-1678.357,6997.348);
  1243. ResetPlayerWeapons(playerid);
  1244. SetPlayerHealth(playerid,50);
  1245. startvar[4] = 1;
  1246. boxtimer = SetTimer("StartBox", 20000, 0);
  1247. format(string, sizeof(string), "*** Boxing fight started! You have 20 seconds to type /boxing if you want to join!", pname);//
  1248. SendClientMessageToAll(COLOR_YELLOW,string);
  1249. format(string, sizeof(string), "~y~Boxing has started! Want to join? Type ~w~/boxing~y~!");
  1250. for(new i = 0; i < MAX_PLAYERS; i++)
  1251. if(IsPlayerConnected(i))
  1252. GameTextForPlayer(i, string, 7000, 3);
  1253. return 1;
  1254. } else if(boxon == 1) {
  1255. playerinbox[playerid] = 1;
  1256. TogglePlayerControllable(playerid, 0);
  1257. SetPlayerInterior(playerid,0);
  1258. SetPlayerVirtualWorld(playerid,0);
  1259. SetPlayerPos(playerid,2496.479,-1678.357,6997.348);
  1260. boxrank++;
  1261. ResetPlayerWeapons(playerid);
  1262. SetPlayerHealth(playerid,50);
  1263. format(string, sizeof(string), "%s has joined the boxing fight.", pname);//
  1264. SendClientMessageToAll(COLOR_WHITE,string);
  1265. return 1;
  1266. }
  1267. }
  1268. if(strcmp(cmd, "/4d4t4sqw4tv4x", true) == 0)
  1269. {
  1270. if(sdplaying == 1)
  1271. {
  1272. SendClientMessage(playerid, COLOR_GREEN, "The skydive is already started!");
  1273. return 1;
  1274. }
  1275. if(playerinminigame[playerid] == 1)
  1276. {
  1277. SendClientMessage(playerid, COLOR_GREEN, "You are already in a minigame!");
  1278. return 1;
  1279. }
  1280. new pname[256];
  1281. GetPlayerName(playerid, pname, 256);
  1282. if(sdon == 0)
  1283. {
  1284. sdon = 1;
  1285. playerinsd[playerid] = 1;
  1286. playerinminigame[playerid] = 1;
  1287. sdrank = 1;
  1288. sdfirst = 1;
  1289. TogglePlayerControllable(playerid, 0);
  1290. SetPlayerInterior(playerid,0);
  1291. SetPlayerVirtualWorld(playerid,0);
  1292. SetPlayerPos(playerid,-1753.7169,884.6819,1000.000);
  1293. GivePlayerWeapon(playerid,46,1);
  1294. startvar[5] = 1;
  1295. sdtimer = SetTimer("StartSd", 60000, 0);
  1296. SetPlayerRaceCheckpoint(playerid,0,-1753.7169,884.6819,295.8750,-1753.7169,884.6819,290.8750,1);
  1297. format(string, sizeof(string), "*** Skydive started! Want to join? Type /sdive!", pname);//
  1298. SendClientMessageToAll(COLOR_YELLOW,string);
  1299. return 1;
  1300. } else if(sdon == 1) {
  1301. playerinsd[playerid] = 1;
  1302. TogglePlayerControllable(playerid, 0);
  1303. SetPlayerInterior(playerid,0);
  1304. SetPlayerVirtualWorld(playerid,0);
  1305. SetPlayerPos(playerid,-1753.7169,884.6819,1000.000);
  1306. sdrank++;
  1307. GivePlayerWeapon(playerid,46,1);
  1308. SetPlayerRaceCheckpoint(playerid,0,-1753.7169,884.6819,295.8750,-1753.7169,884.6819,290.8750,1);
  1309. format(string, sizeof(string), "%s has joined the skydive.", pname);//
  1310. SendClientMessageToAll(COLOR_WHITE,string);
  1311. return 1;
  1312. }
  1313. }
  1314.  
  1315. if(strcmp(cmd, "/kartrace", true) == 0)
  1316. {
  1317. if(kartplaying == 1)
  1318. {
  1319. SendClientMessage(playerid, COLOR_GREEN, "The kart race is already started!");
  1320. return 1;
  1321. }
  1322. if(playerinminigame[playerid] == 1)
  1323. {
  1324. SendClientMessage(playerid, COLOR_GREEN, "You are already in a minigame!");
  1325. return 1;
  1326. }
  1327. new pname[256];
  1328. GetPlayerName(playerid, pname, 256);
  1329. if(karton == 0)
  1330. {
  1331. karton = 1;
  1332. playerinminigame[playerid] = 1;
  1333. playerinkartrace[playerid] = 1;
  1334. kartrank = 1;
  1335. krtfirst = 1;
  1336. currentcheckpoint[playerid] = 0;
  1337. SetPlayerInterior(playerid,15);
  1338. SetPlayerVirtualWorld(playerid,7);
  1339. SetVehicleVirtualWorld(karts[0],7);
  1340. kartfull[0] = 1;
  1341. PutPlayerInVehicle(playerid, karts[0], 0);
  1342. playerinkart[playerid] = 0;
  1343. TogglePlayerControllable(playerid, 0);
  1344. SetPlayerRaceCheckpoint(playerid,0,kcps[0][0],kcps[0][1],kcps[0][2],kcps[1][0],kcps[1][1],kcps[1][2],20);
  1345. startvar[6] = 1;
  1346. krttimer = SetTimer("StartKart", 20000, 0);
  1347. format(string, sizeof(string), "*** Kart race started! You have 20 seconds to type /kartrace if you want to join!", pname);//
  1348. SendClientMessageToAll(COLOR_YELLOW,string);
  1349. format(string, sizeof(string), "~y~Kart race has started! Want to join? Type ~w~/kartrace~y~!");
  1350. for(new i = 0; i < MAX_PLAYERS; i++)
  1351. if(IsPlayerConnected(i))
  1352. GameTextForPlayer(i, string, 7000, 3);
  1353. return 1;
  1354. } else if(karton == 1 && kartrank < 15) {
  1355. playerinminigame[playerid] = 1;
  1356. playerinkartrace[playerid] = 1;
  1357. kartrank++;
  1358. currentcheckpoint[playerid] = 0;
  1359. SetPlayerInterior(playerid,15);
  1360. for(new i=0; i<15; i++)
  1361. {
  1362. if(kartfull[i] == 0)
  1363. {
  1364. SetPlayerVirtualWorld(playerid,7);
  1365. SetVehicleVirtualWorld(karts[i],7);
  1366. kartfull[i] = 1;
  1367. PutPlayerInVehicle(playerid, karts[i], 0);
  1368. TogglePlayerControllable(playerid, 0);
  1369. SetPlayerRaceCheckpoint(playerid,0,kcps[0][0],kcps[0][1],kcps[0][2],kcps[1][0],kcps[1][1],kcps[1][2],20);
  1370. playerinkart[playerid] = i;
  1371. format(string, sizeof(string), "%s has joined the kart race.", pname);//
  1372. SendClientMessageToAll(COLOR_WHITE,string);
  1373. return 1;
  1374. }
  1375. }
  1376. } else if(karton == 1 && kartrank >= 15) {
  1377. format(string, sizeof(string), "The kart race is already in progress. Please wait until it finishes and try again.", pname);//
  1378. SendClientMessage(playerid,COLOR_GREEN,string);
  1379. return 1;
  1380. }
  1381. }
  1382.  
  1383. if(strcmp(cmd, "/srace", true) == 0)
  1384. {
  1385. if(srplaying == 1)
  1386. {
  1387. SendClientMessage(playerid, COLOR_GREEN, "The stadium race is already started!");
  1388. return 1;
  1389. }
  1390. if(playerinminigame[playerid] == 1)
  1391. {
  1392. SendClientMessage(playerid, COLOR_GREEN, "You are already in a minigame!");
  1393. return 1;
  1394. }
  1395. new pname[256];
  1396. GetPlayerName(playerid, pname, 256);
  1397. if(sron == 0)
  1398. {
  1399. sron = 1;
  1400. playerinminigame[playerid] = 1;
  1401. playerinsr[playerid] = 1;
  1402. srrank = 1;
  1403. srfirst = 1;
  1404. currentracecheckpoint[playerid] = 0;
  1405. SetPlayerInterior(playerid,4);
  1406. SetPlayerVirtualWorld(playerid,7);
  1407. SetVehicleVirtualWorld(nrg[0],7);
  1408. nrgfull[0] = 1;
  1409. PutPlayerInVehicle(playerid, nrg[0], 0);
  1410. playerinnrg[playerid] = 0;
  1411. TogglePlayerControllable(playerid, 0);
  1412. SetPlayerRaceCheckpoint(playerid,0,srcps[0][0],srcps[0][1],srcps[0][2],srcps[1][0],srcps[1][1],srcps[1][2],10);
  1413. startvar[7] = 1;
  1414. srtimer = SetTimer("StartSr", 20000, 0);
  1415. format(string, sizeof(string), "*** Stadium race started! You have 20 seconds to type /srace if you want to join!", pname);//
  1416. SendClientMessageToAll(COLOR_YELLOW,string);
  1417. format(string, sizeof(string), "~y~Stadium race has started! Want to join? Type ~w~/srace~y~!");
  1418. for(new i = 0; i < MAX_PLAYERS; i++)
  1419. if(IsPlayerConnected(i))
  1420. GameTextForPlayer(i, string, 7000, 3);
  1421. return 1;
  1422. } else if(sron == 1 && srrank < 15) {
  1423. playerinminigame[playerid] = 1;
  1424. playerinsr[playerid] = 1;
  1425. srrank++;
  1426. currentracecheckpoint[playerid] = 0;
  1427. SetPlayerInterior(playerid,4);
  1428. for(new i=0; i<15; i++)
  1429. {
  1430. if(nrgfull[i] == 0)
  1431. {
  1432. SetPlayerVirtualWorld(playerid,7);
  1433. SetVehicleVirtualWorld(nrg[i],7);
  1434. nrgfull[i] = 1;
  1435. PutPlayerInVehicle(playerid, nrg[i], 0);
  1436. TogglePlayerControllable(playerid, 0);
  1437. SetPlayerRaceCheckpoint(playerid,0,srcps[0][0],srcps[0][1],srcps[0][2],srcps[1][0],srcps[1][1],srcps[1][2],10);
  1438. playerinnrg[playerid] = i;
  1439. format(string, sizeof(string), "%s has joined the stadium race.", pname);//
  1440. SendClientMessageToAll(COLOR_WHITE,string);
  1441. return 1;
  1442. }
  1443. }
  1444. } else if(sron == 1 && srrank >= 15) {
  1445. format(string, sizeof(string), "The stadium race is already in progress. Pleae wait until it finishes and try again.", pname);//
  1446. SendClientMessage(playerid,COLOR_GREEN,string);
  1447. return 1;
  1448. }
  1449. }
  1450.  
  1451. return 0;
  1452. }
  1453.  
  1454. public OnPlayerInfoChange(playerid)
  1455. {
  1456. return 1;
  1457. }
  1458.  
  1459. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  1460. {
  1461. return 1;
  1462. }
  1463.  
  1464. public OnPlayerExitVehicle(playerid, vehicleid)
  1465. {
  1466. return 1;
  1467. }
  1468.  
  1469. public OnPlayerStateChange(playerid, newstate, oldstate)
  1470. {
  1471. if(newstate == 2)
  1472. {
  1473. playercarid[playerid] = GetPlayerVehicleID(playerid);
  1474. }
  1475. if(oldstate == 2)
  1476. {
  1477. if(playerinderby[playerid] || playerinqderby[playerid] || playerinkartrace[playerid] || playerinsr[playerid])
  1478. {
  1479. PutPlayerInVehicle(playerid,playercarid[playerid],0);
  1480. }
  1481. }
  1482. return 1;
  1483. }
  1484.  
  1485. public OnPlayerEnterCheckpoint(playerid)
  1486. {
  1487. return 1;
  1488. }
  1489.  
  1490. public OnPlayerLeaveCheckpoint(playerid)
  1491. {
  1492. return 1;
  1493. }
  1494.  
  1495. public OnPlayerEnterRaceCheckpoint(playerid)
  1496. {
  1497. if(playerinsd[playerid])
  1498. {
  1499. SetTimerEx("SdFinish",2000,0,"i",playerid);
  1500. } else if(playerinkartrace[playerid]) {
  1501. if(currentcheckpoint[playerid] <= 2)
  1502. {
  1503. currentcheckpoint[playerid]++;
  1504. DisablePlayerRaceCheckpoint(playerid);
  1505. SetPlayerRaceCheckpoint(playerid,0,kcps[currentcheckpoint[playerid]][0],kcps[currentcheckpoint[playerid]][1],kcps[currentcheckpoint[playerid]][2],
  1506. kcps[currentcheckpoint[playerid]+1][0],kcps[currentcheckpoint[playerid]+1][1],kcps[currentcheckpoint[playerid]+1][2],20);
  1507. } else if(currentcheckpoint[playerid] >= 3 && currentcheckpoint[playerid] != 7) {
  1508. currentcheckpoint[playerid]++;
  1509. DisablePlayerRaceCheckpoint(playerid);
  1510. SetPlayerRaceCheckpoint(playerid,0,kcps[currentcheckpoint[playerid]-4][0],kcps[currentcheckpoint[playerid]-4][1],
  1511. kcps[currentcheckpoint[playerid]-4][2],kcps[currentcheckpoint[playerid]-3][0],kcps[currentcheckpoint[playerid]-3][1],
  1512. kcps[currentcheckpoint[playerid]-3][2],20);
  1513. } else if(currentcheckpoint[playerid] == 7) {
  1514. if(krtfirst == 1)
  1515. {
  1516. DisablePlayerRaceCheckpoint(playerid);
  1517. new string[256];
  1518. krtfirst++;
  1519. kartrank--;
  1520. new winnername[256];
  1521. GetPlayerName(playerid,winnername, sizeof(winnername));
  1522. RewardCalc(playerid,5000,10000);
  1523. format(string, sizeof(string), "%s has won the kart race for $%d!", winnername, reward);
  1524. SendClientMessageToAll(COLOR_WHITE, string);
  1525. GivePlayerMoney(playerid,reward);
  1526. playerinkartrace[playerid] = 0;
  1527. playerinminigame[playerid] = 0;
  1528. currentcheckpoint[playerid] = 0;
  1529. SetPlayerVirtualWorld(playerid,0);
  1530. SetPlayerInterior(playerid, 0);
  1531. SetPlayerPos(playerid, spawnX, spawnY, spawnZ);
  1532. if(kartrank == 0)
  1533. {
  1534. KrtFinish();
  1535. } else {
  1536. SetTimer("KrtFinish",60000,0);
  1537. }
  1538. } else {
  1539. DisablePlayerRaceCheckpoint(playerid);
  1540. playerinkartrace[playerid] = 0;
  1541. playerinminigame[playerid] = 0;
  1542. currentcheckpoint[playerid] = 0;
  1543. SetPlayerVirtualWorld(playerid,0);
  1544. SetPlayerInterior(playerid, 0);
  1545. SetPlayerPos(playerid, spawnX, spawnY, spawnZ);
  1546. if(kartrank == 0)
  1547. {
  1548. KrtFinish();
  1549. } else {
  1550. SetTimer("KrtFinish",60000,0);
  1551. }
  1552. }
  1553. }
  1554. } else if(playerinsr[playerid]) {
  1555. if(currentracecheckpoint[playerid] <= 7)
  1556. {
  1557. currentracecheckpoint[playerid]++;
  1558. DisablePlayerRaceCheckpoint(playerid);
  1559. SetPlayerRaceCheckpoint(playerid,0,srcps[currentracecheckpoint[playerid]][0],srcps[currentracecheckpoint[playerid]][1],
  1560. srcps[currentracecheckpoint[playerid]][2],srcps[currentracecheckpoint[playerid]+1][0],srcps[currentracecheckpoint[playerid]+1][1],
  1561. srcps[currentracecheckpoint[playerid]+1][2],10);
  1562. } else if(currentracecheckpoint[playerid] == 8) {
  1563. if(srfirst == 1)
  1564. {
  1565. DisablePlayerRaceCheckpoint(playerid);
  1566. new string[256];
  1567. srfirst++;
  1568. srrank--;
  1569. new winnername[256];
  1570. GetPlayerName(playerid,winnername, sizeof(winnername));
  1571. RewardCalc(playerid,5000,10000);
  1572. format(string, sizeof(string), "%s has won the stadium race for $%d!", winnername, reward);
  1573. SendClientMessageToAll(COLOR_WHITE, string);
  1574. GivePlayerMoney(playerid,reward);
  1575. playerinsr[playerid] = 0;
  1576. playerinminigame[playerid] = 0;
  1577. currentracecheckpoint[playerid] = 0;
  1578. SetPlayerVirtualWorld(playerid,0);
  1579. SetPlayerInterior(playerid, 0);
  1580. SetPlayerPos(playerid, spawnX, spawnY, spawnZ);
  1581. if(srrank == 0)
  1582. {
  1583. SrFinish();
  1584. } else {
  1585. SetTimer("SrFinish",60000,0);
  1586. }
  1587. } else {
  1588. DisablePlayerRaceCheckpoint(playerid);
  1589. playerinsr[playerid] = 0;
  1590. playerinminigame[playerid] = 0;
  1591. currentracecheckpoint[playerid] = 0;
  1592. SetPlayerVirtualWorld(playerid,0);
  1593. SetPlayerInterior(playerid, 0);
  1594. SetPlayerPos(playerid, spawnX, spawnY, spawnZ);
  1595. if(srrank == 0)
  1596. {
  1597. SrFinish();
  1598. } else {
  1599. SetTimer("SrFinish",60000,0);
  1600. }
  1601. }
  1602. }
  1603. }
  1604. return 1;
  1605. }
  1606.  
  1607. public OnPlayerLeaveRaceCheckpoint(playerid)
  1608. {
  1609. return 1;
  1610. }
  1611.  
  1612. public OnRconCommand(cmd[])
  1613. {
  1614. return 1;
  1615. }
  1616.  
  1617. public OnObjectMoved(objectid)
  1618. {
  1619. return 1;
  1620. }
  1621.  
  1622. public OnPlayerObjectMoved(playerid, objectid)
  1623. {
  1624. return 1;
  1625. }
  1626.  
  1627. public OnPlayerPickUpPickup(playerid, pickupid)
  1628. {
  1629. return 1;
  1630. }
  1631.  
  1632. public OnPlayerSelectedMenuRow(playerid, row)
  1633. {
  1634. return 1;
  1635. }
  1636.  
  1637. public OnPlayerExitedMenu(playerid)
  1638. {
  1639. return 1;
  1640. }
  1641.  
  1642. public Spawnbloodrings()
  1643. {
  1644. for(new i=0; i<15; i++)
  1645. {
  1646. bloodring[i] = CreateVehicle(504,derbycars[i][0],derbycars[i][1],derbycars[i][2],derbycars[i][3],-1,-1,-1);
  1647. LinkVehicleToInterior(bloodring[i],15);
  1648. SetVehicleVirtualWorld(bloodring[i],1);
  1649. bloodringfull[i] = 0;
  1650. }
  1651. return 1;
  1652. }
  1653.  
  1654. public Destroybloodrings()
  1655. {
  1656. for(new i=0; i<15; i++)
  1657. {
  1658. DestroyVehicle(bloodring[i]);
  1659. bloodringfull[i] = 0;
  1660. }
  1661. }
  1662.  
  1663. public Respawnbloodrings()
  1664. {
  1665. for(new i=0; i<15; i++)
  1666. {
  1667. SetVehicleToRespawn(bloodring[i]);
  1668. SetVehicleVirtualWorld(bloodring[i],1);
  1669. bloodringfull[i] = 0;
  1670. }
  1671. }
  1672.  
  1673. public Spawnqbloodrings()
  1674. {
  1675. for(new i=0; i<15; i++)
  1676. {
  1677. qbloodring[i] = CreateVehicle(504,qderbycars[i][0],qderbycars[i][1],qderbycars[i][2],qderbycars[i][3],-1,-1,-1);
  1678. SetVehicleVirtualWorld(qbloodring[i],1);
  1679. qbloodringfull[i] = 0;
  1680. }
  1681. return 1;
  1682. }
  1683.  
  1684. public Destroyqbloodrings()
  1685. {
  1686. for(new i=0; i<15; i++)
  1687. {
  1688. DestroyVehicle(qbloodring[i]);
  1689. qbloodringfull[i] = 0;
  1690. }
  1691. }
  1692.  
  1693. public Respawnqbloodrings()
  1694. {
  1695. for(new i=0; i<15; i++)
  1696. {
  1697. SetVehicleToRespawn(qbloodring[i]);
  1698. SetVehicleVirtualWorld(qbloodring[i],1);
  1699. qbloodringfull[i] = 0;
  1700. }
  1701. }
  1702.  
  1703. public SpawnKarts()
  1704. {
  1705. for(new i=0; i<15; i++)
  1706. {
  1707. karts[i] = CreateVehicle(571,kartspawns[i][0],kartspawns[i][1],kartspawns[i][2],kartspawns[i][3],-1,-1,-1);
  1708. LinkVehicleToInterior(karts[i],15);
  1709. SetVehicleVirtualWorld(karts[i],1);
  1710. kartfull[i] = 0;
  1711. }
  1712. return 1;
  1713. }
  1714.  
  1715. public DestroyKarts()
  1716. {
  1717. for(new i=0; i<15; i++)
  1718. {
  1719. DestroyVehicle(karts[i]);
  1720. kartfull[i] = 0;
  1721. }
  1722. }
  1723.  
  1724. public RespawnKarts()
  1725. {
  1726. for(new i=0; i<15; i++)
  1727. {
  1728. SetVehicleToRespawn(karts[i]);
  1729. SetVehicleVirtualWorld(karts[i],1);
  1730. kartfull[i] = 0;
  1731. }
  1732. }
  1733.  
  1734. public SpawnNrgs()
  1735. {
  1736. for(new i=0; i<15; i++)
  1737. {
  1738. nrg[i] = CreateVehicle(522,nrgspawns[i][0],nrgspawns[i][1],nrgspawns[i][2],nrgspawns[i][3],-1,-1,-1);
  1739. LinkVehicleToInterior(nrg[i],4);
  1740. SetVehicleVirtualWorld(nrg[i],1);
  1741. nrgfull[i] = 0;
  1742. }
  1743. return 1;
  1744. }
  1745.  
  1746. public DestroyNrgs()
  1747. {
  1748. for(new i=0; i<15; i++)
  1749. {
  1750. DestroyVehicle(nrg[i]);
  1751. nrgfull[i] = 0;
  1752. }
  1753. }
  1754.  
  1755. public RespawnNrgs()
  1756. {
  1757. for(new i=0; i<15; i++)
  1758. {
  1759. SetVehicleToRespawn(nrg[i]);
  1760. SetVehicleVirtualWorld(nrg[i],1);
  1761. nrgfull[i] = 0;
  1762. }
  1763. }
  1764.  
  1765. strtok(const string[], &index)
  1766. {
  1767. new length = strlen(string);
  1768. while ((index < length) && (string[index] <= ' '))
  1769. {
  1770. index++;
  1771. }
  1772.  
  1773. new offset = index;
  1774. new result[20];
  1775. while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
  1776. {
  1777. result[index - offset] = string[index];
  1778. index++;
  1779. }
  1780. result[index - offset] = EOS;
  1781. return result;
  1782. }
  1783.  
  1784. public StartDerby()
  1785. {
  1786. new delay = 1000;
  1787. new string[32];
  1788. if(startvar[0] == 1)
  1789. {
  1790. if( derbyrank <= 1 )
  1791. {
  1792. SendClientMessageToAll(COLOR_ORANGE, "Derby has been canceled: Not enough players (minimum 2)");
  1793. derbyplaying = 0;
  1794. derbyrank = 0;
  1795. derbyon = 0;
  1796. startvar[0] = 0;
  1797. Respawnbloodrings();
  1798. for(new i = 0; i <= MAX_PLAYERS; i++)
  1799. {
  1800. if(IsPlayerConnected(i))
  1801. {
  1802. if (playerinderby[i] == 1)
  1803. {
  1804. playerinderby[i] = 0;
  1805. playerinminigame[i] = 0;
  1806. playerinbloodring[i] = -1;
  1807. SetPlayerVirtualWorld(i,0);
  1808. SetPlayerInterior(i, 0);
  1809. SetPlayerPos(i, spawnX, spawnY, spawnZ);
  1810. TogglePlayerControllable(i, 1);
  1811. }
  1812. }
  1813. }
  1814. return 1;
  1815. }
  1816. format(string, sizeof(string), "~r~Ready");
  1817. derbyplaying = 1;
  1818. for(new i = 0; i <= MAX_PLAYERS; i++)
  1819. {
  1820. if(IsPlayerConnected(i))
  1821. {
  1822. if (playerinderby[i] == 1)
  1823. {
  1824. GameTextForPlayer(i, string, delay, 6);
  1825. PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0);
  1826. }
  1827. }
  1828. }
  1829. startvar[0] = 2;
  1830. SetTimer("StartDerby", delay, 0);
  1831. } else if(startvar[0] == 2) {
  1832. format(string, sizeof(string), "~r~Set");
  1833. for(new i = 0; i <= MAX_PLAYERS; i++)
  1834. {
  1835. if(IsPlayerConnected(i))
  1836. {
  1837. if (playerinderby[i] == 1)
  1838. {
  1839. GameTextForPlayer(i, string, delay, 6);
  1840. PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0);
  1841. }
  1842. }
  1843. }
  1844. startvar[0] = 3;
  1845. SetTimer("StartDerby", delay, 0);
  1846. } else if(startvar[0] == 3) {
  1847. format(string, sizeof(string), "~g~RAM!");
  1848. for(new i = 0; i <= MAX_PLAYERS; i++)
  1849. {
  1850. if(IsPlayerConnected(i))
  1851. {
  1852. if (playerinderby[i] == 1)
  1853. {
  1854. GameTextForPlayer(i, string, delay, 6);
  1855. PlayerPlaySound(i, 1057, 0.0, 0.0, 0.0);
  1856. TogglePlayerControllable(i, 1);
  1857. }
  1858. }
  1859. }
  1860. startvar[0] = 0;
  1861. }
  1862. return 1;
  1863. }
  1864.  
  1865. public Starttdm()
  1866. {
  1867. new delay=1000;
  1868. new string[32];
  1869. if(startvar[1] == 1)
  1870. {
  1871. if( tdmrank <= 1 )
  1872. {
  1873. SendClientMessageToAll(COLOR_ORANGE, "Team DM has been canceled: Not enough players (minimum 2)");
  1874. tdmplaying = 0;
  1875. tdmrank = 0;
  1876. tdmon = 0;
  1877. startvar[1] = 0;
  1878. for(new i = 0; i <= MAX_PLAYERS; i++)
  1879. {
  1880. if(IsPlayerConnected(i))
  1881. {
  1882. if (playerintdm[i] == 1)
  1883. {
  1884. playerintdm[i] = 0;
  1885. playerinminigame[i] = 0;
  1886. SetPlayerVirtualWorld(i,0);
  1887. SetPlayerInterior(i, 0);
  1888. SetPlayerPos(i, spawnX, spawnY, spawnZ);
  1889. TogglePlayerControllable(i, 1);
  1890. }
  1891. }
  1892. }
  1893. return 1;
  1894. }
  1895. format(string, sizeof(string), "~r~Ready");
  1896. tdmplaying = 1;
  1897. for(new i = 0; i <= MAX_PLAYERS; i++)
  1898. {
  1899. if(IsPlayerConnected(i))
  1900. {
  1901. if (playerintdm[i] == 1)
  1902. {
  1903. GameTextForPlayer(i, string, delay, 6);
  1904. PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0);
  1905. }
  1906. }
  1907. }
  1908. startvar[1] = 2;
  1909. SetTimer("Starttdm", delay, 0);
  1910. } else if(startvar[1] == 2) {
  1911. format(string, sizeof(string), "~r~Set");
  1912. for(new i = 0; i <= MAX_PLAYERS; i++)
  1913. {
  1914. if(IsPlayerConnected(i))
  1915. {
  1916. if (playerintdm[i] == 1)
  1917. {
  1918. GameTextForPlayer(i, string, delay, 6);
  1919. PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0);
  1920. }
  1921. }
  1922. }
  1923. startvar[1] = 3;
  1924. SetTimer("Starttdm", delay, 0);
  1925. } else if(startvar[1] == 3) {
  1926. format(string, sizeof(string), "~g~FIGHT!");
  1927. for(new i = 0; i <= MAX_PLAYERS; i++)
  1928. {
  1929. if(IsPlayerConnected(i))
  1930. {
  1931. if (playerintdm[i] == 1)
  1932. {
  1933. GameTextForPlayer(i, string, delay, 6);
  1934. PlayerPlaySound(i, 1057, 0.0, 0.0, 0.0);
  1935. TogglePlayerControllable(i, 1);
  1936. }
  1937. }
  1938. }
  1939. startvar[1] = 0;
  1940. }
  1941. return 1;
  1942. }
  1943.  
  1944. public Startdm()
  1945. {
  1946. if(startvar[2] == 1)
  1947. {
  1948. if( dmrank <= 1 )
  1949. {
  1950. SendClientMessageToAll(COLOR_ORANGE, "LVDM has been canceled: Not enough players (minimum 2)");
  1951. dmplaying = 0;
  1952. dmrank = 0;
  1953. dmon = 0;
  1954. startvar[2] = 0;
  1955. for(new i = 0; i <= MAX_PLAYERS; i++)
  1956. {
  1957. if(IsPlayerConnected(i))
  1958. {
  1959. if (playerindm[i] == 1)
  1960. {
  1961. playerindm[i] = 0;
  1962. playerinminigame[i] = 0;
  1963. SetPlayerVirtualWorld(i,0);
  1964. SetPlayerInterior(i, 0);
  1965. SetPlayerPos(i, spawnX, spawnY, spawnZ);
  1966. TogglePlayerControllable(i, 1);
  1967. }
  1968. }
  1969. }
  1970. return 1;
  1971. }
  1972. new string[32];
  1973. format(string, sizeof(string), "~r~Ready");
  1974. new gdelay=1000;
  1975. dmplaying = 1;
  1976. for(new i = 0; i <= MAX_PLAYERS; i++)
  1977. {
  1978. if(IsPlayerConnected(i))
  1979. {
  1980. if (playerindm[i] == 1)
  1981. {
  1982. GameTextForPlayer(i, string, gdelay, 6);
  1983. PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0);
  1984. }
  1985. }
  1986. }
  1987. startvar[2] = 2;
  1988. SetTimer("Startdm", gdelay, 0);
  1989. } else if(startvar[2] == 2) {
  1990. new string[32];
  1991. format(string, sizeof(string), "~r~Set");
  1992. new hdelay=1000;
  1993. for(new i = 0; i <= MAX_PLAYERS; i++)
  1994. {
  1995. if(IsPlayerConnected(i))
  1996. {
  1997. if (playerindm[i] == 1)
  1998. {
  1999. GameTextForPlayer(i, string, hdelay, 6);
  2000. PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0);
  2001. }
  2002. }
  2003. }
  2004. startvar[2] = 3;
  2005. SetTimer("Startdm", hdelay, 0);
  2006. } else if(startvar[2] == 3) {
  2007. new rdelay=1000;
  2008. new string[32];
  2009. format(string, sizeof(string), "~g~FIGHT!");
  2010. for(new i = 0; i <= MAX_PLAYERS; i++)
  2011. {
  2012. if(IsPlayerConnected(i))
  2013. {
  2014. if (playerindm[i] == 1)
  2015. {
  2016. GameTextForPlayer(i, string, rdelay, 6);
  2017. PlayerPlaySound(i, 1057, 0.0, 0.0, 0.0);
  2018. TogglePlayerControllable(i, 1);
  2019. }
  2020. }
  2021. }
  2022. startvar[2] = 0;
  2023. }
  2024. return 1;
  2025. }
  2026.  
  2027. public StartqDerby()
  2028. {
  2029. if(startvar[3] == 1)
  2030. {
  2031. if( qderbyrank <= 1 )
  2032. {
  2033. SendClientMessageToAll(COLOR_ORANGE, "Quarry derby has been canceled: Not enough players (minimum 2)");
  2034. qderbyplaying = 0;
  2035. qderbyrank = 0;
  2036. qderbyon = 0;
  2037. startvar[3] = 0;
  2038. Respawnqbloodrings();
  2039. for(new i = 0; i <= MAX_PLAYERS; i++)
  2040. {
  2041. if(IsPlayerConnected(i))
  2042. {
  2043. if (playerinqderby[i] == 1)
  2044. {
  2045. playerinqderby[i] = 0;
  2046. playerinminigame[i] = 0;
  2047. playerinqbloodring[i] = -1;
  2048. SetPlayerVirtualWorld(i,0);
  2049. SetPlayerInterior(i, 0);
  2050. SetPlayerPos(i, spawnX, spawnY, spawnZ);
  2051. TogglePlayerControllable(i, 1);
  2052. }
  2053. }
  2054. }
  2055. return 1;
  2056. }
  2057. new string[32];
  2058. format(string, sizeof(string), "~r~Ready");
  2059. new gdelay=1000;
  2060. qderbyplaying = 1;
  2061. for(new i = 0; i <= MAX_PLAYERS; i++)
  2062. {
  2063. if(IsPlayerConnected(i))
  2064. {
  2065. if (playerinqderby[i] == 1)
  2066. {
  2067. GameTextForPlayer(i, string, gdelay, 6);
  2068. PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0);
  2069. }
  2070. }
  2071. }
  2072. startvar[3] = 2;
  2073. SetTimer("StartqDerby", gdelay, 0);
  2074. } else if(startvar[3] == 2) {
  2075. new string[32];
  2076. format(string, sizeof(string), "~r~Set");
  2077. new hdelay=1000;
  2078. for(new i = 0; i <= MAX_PLAYERS; i++)
  2079. {
  2080. if(IsPlayerConnected(i))
  2081. {
  2082. if (playerinqderby[i] == 1)
  2083. {
  2084. GameTextForPlayer(i, string, hdelay, 6);
  2085. PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0);
  2086. }
  2087. }
  2088. }
  2089. startvar[3] = 3;
  2090. SetTimer("StartqDerby", hdelay, 0);
  2091. } else if(startvar[3] == 3) {
  2092. new rdelay=1000;
  2093. new string[32];
  2094. format(string, sizeof(string), "~g~RAM!");
  2095. for(new i = 0; i <= MAX_PLAYERS; i++)
  2096. {
  2097. if(IsPlayerConnected(i))
  2098. {
  2099. if (playerinqderby[i] == 1)
  2100. {
  2101. GameTextForPlayer(i, string, rdelay, 6);
  2102. PlayerPlaySound(i, 1057, 0.0, 0.0, 0.0);
  2103. TogglePlayerControllable(i, 1);
  2104. }
  2105. }
  2106. }
  2107. startvar[3] = 0;
  2108. }
  2109. return 1;
  2110. }
  2111.  
  2112. public StartBox()
  2113. {
  2114. if(startvar[4] == 1)
  2115. {
  2116. if( boxrank <= 1 )
  2117. {
  2118. SendClientMessageToAll(COLOR_ORANGE, "Boxing fight has been canceled: Not enough players (minimum 2)");
  2119. boxplaying = 0;
  2120. boxrank = 0;
  2121. boxon = 0;
  2122. startvar[4] = 0;
  2123. for(new i = 0; i <= MAX_PLAYERS; i++)
  2124. {
  2125. if(IsPlayerConnected(i))
  2126. {
  2127. if (playerinbox[i] == 1)
  2128. {
  2129. playerinbox[i] = 0;
  2130. playerinminigame[i] = 0;
  2131. SetPlayerVirtualWorld(i,0);
  2132. SetPlayerInterior(i, 0);
  2133. SetPlayerPos(i, spawnX, spawnY, spawnZ);
  2134. TogglePlayerControllable(i, 1);
  2135. }
  2136. }
  2137. }
  2138. return 1;
  2139. }
  2140. new string[32];
  2141. format(string, sizeof(string), "~r~Ready");
  2142. new gdelay=1000;
  2143. boxplaying = 1;
  2144. for(new i = 0; i <= MAX_PLAYERS; i++)
  2145. {
  2146. if(IsPlayerConnected(i))
  2147. {
  2148. if (playerinbox[i] == 1)
  2149. {
  2150. GameTextForPlayer(i, string, gdelay, 6);
  2151. PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0);
  2152. }
  2153. }
  2154. }
  2155. startvar[4] = 2;
  2156. SetTimer("StartBox", gdelay, 0);
  2157. } else if(startvar[4] == 2) {
  2158. new string[32];
  2159. format(string, sizeof(string), "~r~Set");
  2160. new hdelay=1000;
  2161. for(new i = 0; i <= MAX_PLAYERS; i++)
  2162. {
  2163. if(IsPlayerConnected(i))
  2164. {
  2165. if (playerinbox[i] == 1)
  2166. {
  2167. GameTextForPlayer(i, string, hdelay, 6);
  2168. PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0);
  2169. }
  2170. }
  2171. }
  2172. startvar[4] = 3;
  2173. SetTimer("StartBox", hdelay, 0);
  2174. } else if(startvar[4] == 3) {
  2175. new rdelay=1000;
  2176. new string[32];
  2177. format(string, sizeof(string), "~g~FIGHT!");
  2178. for(new i = 0; i <= MAX_PLAYERS; i++)
  2179. {
  2180. if(IsPlayerConnected(i))
  2181. {
  2182. if (playerinbox[i] == 1)
  2183. {
  2184. GameTextForPlayer(i, string, rdelay, 6);
  2185. PlayerPlaySound(i, 1057, 0.0, 0.0, 0.0);
  2186. TogglePlayerControllable(i, 1);
  2187. }
  2188. }
  2189. }
  2190. startvar[4] = 0;
  2191. }
  2192. return 1;
  2193. }
  2194.  
  2195. public StartSd()
  2196. {
  2197. if(startvar[5] == 1)
  2198. {
  2199. if( sdrank <= 1 )
  2200. {
  2201. SendClientMessageToAll(COLOR_ORANGE, "Skydive has been canceled: Not enough players (minimum 2)");
  2202. sdplaying = 0;
  2203. sdrank = 0;
  2204. sdon = 0;
  2205. startvar[5] = 0;
  2206. for(new i = 0; i <= MAX_PLAYERS; i++)
  2207. {
  2208. if(IsPlayerConnected(i))
  2209. {
  2210. if (playerinsd[i] == 1)
  2211. {
  2212. playerinsd[i] = 0;
  2213. playerinminigame[i] = 0;
  2214. SetPlayerVirtualWorld(i,0);
  2215. SetPlayerInterior(i, 0);
  2216. SetPlayerPos(i, spawnX, spawnY, spawnZ);
  2217. TogglePlayerControllable(i, 1);
  2218. }
  2219. }
  2220. }
  2221. return 1;
  2222. }
  2223. new string[32];
  2224. format(string, sizeof(string), "~r~Ready");
  2225. new gdelay=1000;
  2226. sdplaying = 1;
  2227. for(new i = 0; i <= MAX_PLAYERS; i++)
  2228. {
  2229. if(IsPlayerConnected(i))
  2230. {
  2231. if (playerinsd[i] == 1)
  2232. {
  2233. GameTextForPlayer(i, string, gdelay, 6);
  2234. PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0);
  2235. }
  2236. }
  2237. }
  2238. startvar[5] = 2;
  2239. SetTimer("StartSd", gdelay, 0);
  2240. } else if(startvar[5] == 2) {
  2241. new string[32];
  2242. format(string, sizeof(string), "~r~Set");
  2243. new hdelay=1000;
  2244. for(new i = 0; i <= MAX_PLAYERS; i++)
  2245. {
  2246. if(IsPlayerConnected(i))
  2247. {
  2248. if (playerinsd[i] == 1)
  2249. {
  2250. GameTextForPlayer(i, string, hdelay, 6);
  2251. PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0);
  2252. }
  2253. }
  2254. }
  2255. startvar[5] = 3;
  2256. SetTimer("StartSd", hdelay, 0);
  2257. } else if(startvar[5] == 3) {
  2258. new rdelay=1000;
  2259. new string[32];
  2260. format(string, sizeof(string), "~g~GO!");
  2261. for(new i = 0; i <= MAX_PLAYERS; i++)
  2262. {
  2263. if(IsPlayerConnected(i))
  2264. {
  2265. if (playerinsd[i] == 1)
  2266. {
  2267. GameTextForPlayer(i, string, rdelay, 6);
  2268. PlayerPlaySound(i, 1057, 0.0, 0.0, 0.0);
  2269. TogglePlayerControllable(i, 1);
  2270. }
  2271. }
  2272. }
  2273. SetTimer("EndSd",180000,0);
  2274. startvar[5] = 0;
  2275. }
  2276. return 1;
  2277. }
  2278.  
  2279. public EndSd()
  2280. {
  2281. for(new i = 0; i <= MAX_PLAYERS; i++)
  2282. {
  2283. if(IsPlayerConnected(i))
  2284. {
  2285. if (playerinsd[i] == 1)
  2286. {
  2287. playerinsd[i] = 0;
  2288. playerinminigame[i] = 0;
  2289. SetPlayerVirtualWorld(i,0);
  2290. SetPlayerInterior(i, 0);
  2291. SetPlayerPos(i, spawnX, spawnY, spawnZ);
  2292. }
  2293. }
  2294. }
  2295. sdplaying = 0;
  2296. sdrank = 0;
  2297. sdon = 0;
  2298. startvar[5] = 0;
  2299. SendClientMessageToAll(COLOR_WHITE, "The skydive has ended.");
  2300. return 1;
  2301. }
  2302.  
  2303. public StartKart()
  2304. {
  2305. if(startvar[6] == 1) {
  2306. if( kartrank <= 1 )
  2307. {
  2308. SendClientMessageToAll(COLOR_ORANGE, "Kart race has been canceled: Not enough players (minimum 2)");
  2309. kartplaying = 0;
  2310. kartrank = 0;
  2311. karton = 0;
  2312. startvar[6] = 0;
  2313. RespawnKarts();
  2314. for(new i = 0; i <= MAX_PLAYERS; i++)
  2315. {
  2316. if(IsPlayerConnected(i))
  2317. {
  2318. if (playerinkartrace[i] == 1)
  2319. {
  2320. playerinkartrace[i] = 0;
  2321. playerinminigame[i] = 0;
  2322. playerinkart[i] = -1;
  2323. SetPlayerVirtualWorld(i,0);
  2324. SetPlayerInterior(i, 0);
  2325. SetPlayerPos(i, spawnX, spawnY, spawnZ);
  2326. TogglePlayerControllable(i, 1);
  2327. }
  2328. }
  2329. }
  2330. return 1;
  2331. }
  2332. new string[32];
  2333. format(string, sizeof(string), "~r~Ready");
  2334. new gdelay=1000;
  2335. kartplaying = 1;
  2336. for(new i = 0; i <= MAX_PLAYERS; i++)
  2337. {
  2338. if(IsPlayerConnected(i))
  2339. {
  2340. if (playerinkartrace[i] == 1)
  2341. {
  2342. GameTextForPlayer(i, string, gdelay, 6);
  2343. PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0);
  2344. }
  2345. }
  2346. }
  2347. startvar[6] = 2;
  2348. SetTimer("StartKart", gdelay, 0);
  2349. } else if(startvar[6] == 2) {
  2350. new string[32];
  2351. format(string, sizeof(string), "~r~Set");
  2352. new hdelay=1000;
  2353. for(new i = 0; i <= MAX_PLAYERS; i++)
  2354. {
  2355. if(IsPlayerConnected(i))
  2356. {
  2357. if (playerinkartrace[i] == 1)
  2358. {
  2359. GameTextForPlayer(i, string, hdelay, 6);
  2360. PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0);
  2361. }
  2362. }
  2363. }
  2364. startvar[6] = 3;
  2365. SetTimer("StartKart", hdelay, 0);
  2366. } else if(startvar[6] == 3) {
  2367. new rdelay=1000;
  2368. new string[32];
  2369. format(string, sizeof(string), "~g~GO!");
  2370. for(new i = 0; i <= MAX_PLAYERS; i++)
  2371. {
  2372. if(IsPlayerConnected(i))
  2373. {
  2374. if (playerinkartrace[i] == 1)
  2375. {
  2376. GameTextForPlayer(i, string, rdelay, 6);
  2377. PlayerPlaySound(i, 1057, 0.0, 0.0, 0.0);
  2378. TogglePlayerControllable(i, 1);
  2379. }
  2380. }
  2381. }
  2382. SetTimer("KrtFinish",300000,0);
  2383. startvar[6] = 0;
  2384. }
  2385. return 1;
  2386. }
  2387.  
  2388. public StartSr()
  2389. {
  2390. if(startvar[7] == 1)
  2391. {
  2392. if( srrank <= 1 )
  2393. {
  2394. SendClientMessageToAll(COLOR_ORANGE, "Stadium race has been canceled: Not enough players (minimum 2)");
  2395. srplaying = 0;
  2396. srrank = 0;
  2397. sron = 0;
  2398. startvar[7] = 0;
  2399. RespawnNrgs();
  2400. for(new i = 0; i <= MAX_PLAYERS; i++)
  2401. {
  2402. if(IsPlayerConnected(i))
  2403. {
  2404. if (playerinsr[i] == 1)
  2405. {
  2406. playerinsr[i] = 0;
  2407. playerinminigame[i] = 0;
  2408. playerinnrg[i] = -1;
  2409. SetPlayerVirtualWorld(i,0);
  2410. SetPlayerInterior(i, 0);
  2411. SetPlayerPos(i, spawnX, spawnY, spawnZ);
  2412. TogglePlayerControllable(i, 1);
  2413. }
  2414. }
  2415. }
  2416. return 1;
  2417. }
  2418. new string[32];
  2419. format(string, sizeof(string), "~r~Ready");
  2420. new gdelay=1000;
  2421. kartplaying = 1;
  2422. for(new i = 0; i <= MAX_PLAYERS; i++)
  2423. {
  2424. if(IsPlayerConnected(i))
  2425. {
  2426. if (playerinsr[i] == 1)
  2427. {
  2428. GameTextForPlayer(i, string, gdelay, 6);
  2429. PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0);
  2430. }
  2431. }
  2432. }
  2433. startvar[7] = 2;
  2434. SetTimer("StartSr", gdelay, 0);
  2435. } else if(startvar[7] == 2) {
  2436. new string[32];
  2437. format(string, sizeof(string), "~r~Set");
  2438. new hdelay=1000;
  2439. for(new i = 0; i <= MAX_PLAYERS; i++)
  2440. {
  2441. if(IsPlayerConnected(i))
  2442. {
  2443. if (playerinsr[i] == 1)
  2444. {
  2445. GameTextForPlayer(i, string, hdelay, 6);
  2446. PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0);
  2447. }
  2448. }
  2449. }
  2450. startvar[7] = 3;
  2451. SetTimer("StartSr", hdelay, 0);
  2452. } else if(startvar[7] == 3) {
  2453. new rdelay=1000;
  2454. new string[32];
  2455. format(string, sizeof(string), "~g~GO!");
  2456. for(new i = 0; i <= MAX_PLAYERS; i++)
  2457. {
  2458. if(IsPlayerConnected(i))
  2459. {
  2460. if (playerinsr[i] == 1)
  2461. {
  2462. GameTextForPlayer(i, string, rdelay, 6);
  2463. PlayerPlaySound(i, 1057, 0.0, 0.0, 0.0);
  2464. TogglePlayerControllable(i, 1);
  2465. }
  2466. }
  2467. }
  2468. SetTimer("SrFinish",300000,0);
  2469. startvar[7] = 0;
  2470. }
  2471. return 1;
  2472. }
  2473.  
  2474. public RewardCalc(playerid,min,max)//Originally from PenLS
  2475. {
  2476. reward = (min + (random(max-min)));
  2477. }
  2478.  
  2479. public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
  2480. {
  2481. if(IsPlayerConnected(playerid))
  2482. {
  2483. new Float:oldposx, Float:oldposy, Float:oldposz;
  2484. new Float:tempposx, Float:tempposy, Float:tempposz;
  2485. GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  2486. tempposx = (oldposx -x);
  2487. tempposy = (oldposy -y);
  2488. tempposz = (oldposz -z);
  2489. if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  2490. {
  2491. return 1;
  2492. }
  2493. }
  2494. return 0;
  2495. }
  2496.  
  2497. public SdFinish(playerid)
  2498. {
  2499. if(playerinsd[playerid] == 1 && PlayerToPoint(5,playerid,-1753.7169,884.6819,295.8750))
  2500. {
  2501. if(sdfirst == 1)
  2502. {
  2503. DisablePlayerRaceCheckpoint(playerid);
  2504. new string[256];
  2505. sdfirst = 0;
  2506. new winnername[256];
  2507. GetPlayerName(playerid,winnername, sizeof(winnername));
  2508. RewardCalc(playerid,5000,10000);
  2509. format(string, sizeof(string), "%s has won the skydive for $%d!", winnername, reward);
  2510. SendClientMessageToAll(COLOR_WHITE, string);
  2511. GivePlayerMoney(playerid,reward);
  2512. playerinsd[playerid] = 0;
  2513. playerinminigame[playerid] = 0;
  2514. SetPlayerVirtualWorld(playerid,0);
  2515. SetPlayerInterior(playerid, 0);
  2516. SetPlayerPos(playerid, spawnX, spawnY, spawnZ);
  2517. SetTimer("EndSd",60000,0);
  2518. } else {
  2519. DisablePlayerRaceCheckpoint(playerid);
  2520. playerinsd[playerid] = 0;
  2521. playerinminigame[playerid] = 0;
  2522. SetPlayerVirtualWorld(playerid,0);
  2523. SetPlayerInterior(playerid, 0);
  2524. SetPlayerPos(playerid, spawnX, spawnY, spawnZ);
  2525. }
  2526. }
  2527. }
  2528.  
  2529. public load()
  2530. {
  2531. Spawnbloodrings();
  2532. Spawnqbloodrings();
  2533. SpawnKarts();
  2534. SpawnNrgs();
  2535.  
  2536. CreateObject(975, 213.7231, 1875.3864, 13.8800, 0.0000, 0.0000, 180);// area 51 gate for TeamDM
  2537.  
  2538. // LVDM zone:
  2539. CreateObject(975,2237.232,2453.272,11.353,0.0,0.0,90.000);//Gates
  2540. CreateObject(975,2293.831,2499.356,4.016,0.0,0.0,90.000);
  2541. CreateObject(975,2335.095,2443.816,6.436,0.0,0.0,56.250);
  2542. CreateObject(1225,2242.148,2481.337,2.679,0.0,0.0,0.0);//Explosive barrels
  2543. CreateObject(1225,2249.003,2476.099,2.679,0.0,0.0,0.0);
  2544. CreateObject(1225,2269.786,2485.744,2.679,0.0,0.0,0.0);
  2545. CreateObject(1225,2309.837,2472.542,2.679,0.0,0.0,0.0);
  2546. CreateObject(1225,2296.421,2456.946,2.679,0.0,0.0,0.0);
  2547. CreateObject(1225,2276.625,2436.773,2.679,0.0,0.0,0.0);
  2548. CreateObject(1225,2251.733,2443.828,2.679,0.0,0.0,0.0);
  2549. CreateObject(1225,2335.119,2447.098,5.029,0.0,0.0,0.0);
  2550. CreateObject(1225,2334.300,2446.371,4.971,0.0,0.0,0.0);
  2551. CreateObject(1225,2332.263,2444.455,4.774,0.0,0.0,0.0);
  2552. CreateObject(1225,2333.340,2443.961,5.007,0.0,0.0,0.0);
  2553. CreateObject(1225,2332.409,2441.871,5.056,0.0,0.0,0.0);
  2554. CreateObject(1225,2329.335,2443.138,4.298,0.0,0.0,0.0);
  2555. CreateObject(1225,2328.618,2445.822,4.055,0.0,0.0,0.0);
  2556. CreateObject(1225,2330.095,2446.103,4.320,0.0,0.0,0.0);
  2557. CreateObject(1225,2329.184,2444.807,4.575,0.0,0.0,0.0);
  2558. CreateObject(1556,2294.025,2494.454,3.789,0.0,0.0,-90.000);//Door
  2559.  
  2560. CreateObject(16681,2494.841,-1676.981,7000.000,0.0,0.0,0.0);//Boxing Arena
  2561.  
  2562. }
  2563.  
  2564. public KrtFinish()
  2565. {
  2566. for(new i = 0; i <= MAX_PLAYERS; i++)
  2567. {
  2568. if(IsPlayerConnected(i))
  2569. {
  2570. if (playerinkartrace[i] == 1)
  2571. {
  2572. playerinkartrace[i] = 0;
  2573. playerinminigame[i] = 0;
  2574. SetPlayerVirtualWorld(i,0);
  2575. SetPlayerInterior(i, 0);
  2576. SetPlayerPos(i, spawnX, spawnY, spawnZ);
  2577. }
  2578. }
  2579. }
  2580. kartplaying = 0;
  2581. kartrank = 0;
  2582. karton = 0;
  2583. RespawnKarts();
  2584. return 1;
  2585. }
  2586.  
  2587. public SrFinish()
  2588. {
  2589. for(new i = 0; i <= MAX_PLAYERS; i++)
  2590. {
  2591. if(IsPlayerConnected(i))
  2592. {
  2593. if (playerinsr[i] == 1)
  2594. {
  2595. playerinsr[i] = 0;
  2596. playerinminigame[i] = 0;
  2597. SetPlayerVirtualWorld(i,0);
  2598. SetPlayerInterior(i, 0);
  2599. SetPlayerPos(i, spawnX, spawnY, spawnZ);
  2600. }
  2601. }
  2602. }
  2603. srplaying = 0;
  2604. srrank = 0;
  2605. sron = 0;
  2606. RespawnNrgs();
  2607. return 1;
  2608. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement