new gRacer[MAX_PLAYERS];
new gRaceid;
#define CP_LVRACE 27
#define CP_LVRACE2 28
#define CP_DRAG 29
#define CP_FULLTURN 30
#define CP_ENCLOSE 31
#define CP_FREEWAY 32
#define CP_AIRPORT 33
#define CP_BIGRACE 34
#define CP_CARTRACE 35
#define LVRACE 1
#define LVRACE2 2
#define DRAG 3
#define FULLTURN 4
#define ENCLOSE 5
#define FREEWAY 6
#define AIRPORT 7
#define BIGRACE 8
#define CARTRACE 9
{2057.2068,795.1260,2192.3413,900.7789}, //LVRACE1
{2219.2014,816.7987,2345.2524,907.6171}, //LVRACE2
{1339.7202,1574.3517,1711.5598,1860.3267}, //DRAG
{2723.2661,2263.8979,2951.1128,2508.8557}, //FULLTURN
{2020.0337,1104.0842,2239.7825,1387.2115}, //ENCLOSE
{1129.8506,1576.3555,1254.2544,1892.2421}, //FREEWAY
{1260.1062,1212.9619,1711.8167,1565.5458}, //
{1696.67,746.67,1896.67,946.67},//BIGRACE
{2323.6563,1848.8358,2523.6563,2048.8358} //CARTRACE
{2151.3589,851.8388,6.3631,18.0},//LVRACE1
{2292.0000,853.2295,6.3612,18.0},//LVRACE2
{1478.0313,1777.5648,10.4346,15.0},//DRAG
{2907.1707,2406.6133,10.4005,15.0},//FULLTURN
{2187.4380,1207.0509,10.2941,15.0},//ENCLOSE
{1239.1427,1695.1627,6.3168,20.0},//FREEWAY
{1335.4139,1311.4680,10.4433,20.0},//
{1796.67,846.67,10.0,20.0}, //BIGRACE
{2423.6563,1948.8358,5.2994,10.0} //CARTRACE
#define LVRACE_CHECKPOINTS 21
new Float:gLVRaceCheckpoints[LVRACE_CHECKPOINTS][4] = {
{2151.3589,851.8388,6.3631,15.0}, //LV RACE STARTING LINE
{1753.6545,850.6560,9.5190,15.0}, //first checkpoint
{1568.6921,833.5577,6.3990,15.0}, //second check
{1287.6051,905.6605,6.4374,15.0},
{1226.4041,1334.8127,6.3621,15.0},
{1209.0433,1502.7931,6.3621,15.0},
{1263.7335,1732.5851,8.0399,15.0},
{1401.9918,1872.6542,10.3007,15.0},
{1707.2323,1886.4031,10.2967,15.0},
{1728.4037,2053.3477,10.2970,15.0},
{1956.9373,2022.1593,10.2968,15.0},
{2176.9705,2137.1475,10.2968,15.0},
{2349.7729,2179.5166,10.3058,25.0}, //bigish
{2287.6816,2291.3613,10.3413,15.0},
{2271.7271,2413.7090,10.3006,15.0},
{2189.2878,2325.5537,10.2968,15.0},
{2074.8704,1758.3037,10.2968,15.0},
{2047.5907,1587.5190,10.2968,15.0},
{2061.5239,1531.0094,10.2968,15.0},
{2047.8118,1361.2373,10.2968,15.0},
{2046.0575,861.8326,6.3588,25.0} //FINISH!
};
#define LVRACE2_CHECKPOINTS 30
new Float:gLVRace2Checkpoints[LVRACE2_CHECKPOINTS][4] = {
{2292.0000,853.2295,6.3612,15.0},
{2672.6125,985.5797,6.3584,15.0},
{2680.1172,1379.5313,7.0318,15.0},
{2605.0435,1472.8322,10.4544,15.0},
{2548.1641,1451.3032,10.2968,15.0},
{2528.8911,1287.0098,10.2969,15.0},
{2515.0671,1193.8060,10.2967,15.0},
{2227.8516,1241.7512,10.2968,15.0},
{2246.8247,1412.3350,10.3007,15.0},
{2264.8145,1532.9839,10.2968,15.0},
{2260.0530,1533.0015,10.2991,15.0},
{2327.4248,1549.9917,10.2968,15.0},
{2341.7393,1612.9847,10.2969,15.0},
{2546.9839,1625.5905,10.2969,15.0},
{2506.9165,1741.3983,10.2959,15.0},
{2526.2810,2078.9180,10.2968,15.0},
{2511.9631,2135.4175,10.2967,15.0},
{2350.4355,1998.8438,10.2352,15.0},
{2293.0757,1894.1865,10.2968,15.0},
{2146.3867,1863.9653,10.3037,15.0},
{1981.5674,1712.7384,10.2960,15.0},
{1567.6030,1733.9701,10.2968,15.0},
{1471.7648,1872.7172,10.2978,15.0},
{1249.8389,1813.4238,12.2259,15.0},
{1007.4941,1789.1084,10.2966,15.0},
{1008.0173,1263.4282,10.2958,15.0},
{1170.4558,1176.4430,10.3949,15.0},
{1207.7604,1075.0952,6.4374,15.0},
{1514.8815,851.9245,6.4366,15.0},
{1973.7041,850.5347,6.3517,15.0}
};
#define DRAG_CHECKPOINTS 2
new Float:gDragCheckpoints[DRAG_CHECKPOINTS][4] = {
{1478.0313,1777.5648,10.4346,15.0},
{1477.4385,1320.3451,10.4456,15.0}
};
#define FULLTURN_CHECKPOINTS 23
new Float:gFullTurnCheckpoints[FULLTURN_CHECKPOINTS][4] = {
{2907.1707,2406.6133,10.4005,15.0}, //race1 start
{2848.6821,2234.1079,10.2948,15.0}, //check1
{2847.8733,2070.4319,10.2974,15.0},
{2828.0847,1975.5433,10.2960,15.0},
{2672.8003,1951.6693,11.3938,15.0},
{2489.7747,1969.3590,10.2975,15.0},
{2357.3093,1957.5857,10.3005,15.0},
{2297.6909,1893.1490,10.2949,15.0},
{2154.1106,1904.3524,10.2950,15.0},
{2148.8367,2057.1125,10.3039,15.0},
{2148.2568,2188.1633,10.2961,15.0},
{2191.7668,2327.8037,10.2952,15.0},
{2228.0015,2477.6013,10.3034,15.0},
{2251.4468,2513.2791,10.2949,15.0},
{2394.4265,2513.3110,10.3540,15.0},
{2474.9592,2513.0181,10.4309,15.0},
{2528.3340,2488.9541,10.4441,15.0},
{2527.4434,2378.1226,10.2993,15.0},
{2541.6848,2232.6526,10.2953,15.0},
{2641.8872,2290.1973,10.2947,15.0},
{2797.1089,2294.5388,10.3165,15.0},
{2902.7891,2299.5833,10.2947,15.0},
{2906.9424,2403.9465,10.3297,15.0} //FINISH
};
#define ENCLOSE_CHECKPOINTS 32
new Float:gEncloseCheckpoints[ENCLOSE_CHECKPOINTS][4] = {
{2187.4380,1207.0509,10.2941,15.0},
{2181.7495,1152.6239,11.4193,15.0},
{2139.0605,1073.6729,11.8901,15.0},
{2075.8535,1051.5021,10.2872,15.0},
{2069.7153,1145.7050,10.3039,15.0},
{2051.0618,1207.5472,10.2961,15.0},
{2046.2145,1423.3301,10.2961,15.0},
//{2066.0078,1465.9922,10.2960,15.0},
{2053.0798,1541.2687,10.2960,15.0},
{2049.4795,1701.5417,10.2961,15.0},
{2116.5435,1837.6656,10.2961,15.0},
{2128.8782,1966.9749,10.3211,15.0},
{2127.1077,2118.2327,10.2960,15.0},
{2127.8813,2224.1440,10.2959,15.0},
{2072.3218,2313.3286,10.2948,15.0},
{2028.2240,2408.7466,10.2969,15.0},
{2041.2173,2452.1567,10.2949,15.0},
{2121.9824,2452.9285,10.2960,15.0},
{2226.4033,2437.6785,10.2926,15.0},
{2214.7600,2362.1882,10.2961,15.0},
{2164.1077,2290.1396,10.2976,15.0},
{2147.2456,2122.8555,10.2961,15.0},
{2148.2808,1982.2407,10.2987,15.0},
{2135.8943,1841.2278,10.3001,15.0},
{2085.1406,1772.8593,10.2963,15.0},
{2048.5164,1689.2438,10.2961,15.0},
{2047.9674,1572.2931,10.2961,15.0},
{2048.4014,1506.6959,10.2961,15.0},
{2064.2258,1440.9530,10.2962,15.0},
{2091.5720,1373.2731,10.2952,15.0},
{2149.9819,1373.5031,10.2968,15.0},
{2225.5425,1351.5120,10.4188,15.0},
{2227.3210,1278.1823,10.2961,15.0}
};
#define FREEWAY_CHECKPOINTS 30
new Float:gFreewayCheckpoints[FREEWAY_CHECKPOINTS][4] = {
{1239.1427,1695.1627,6.3168,20.0},
{1226.3138,1601.5934,6.3585,20.0},
{1224.6870,1334.1022,6.3585,20.0},
{1224.9535,1093.8094,6.4366,20.0},
{1373.5900,859.4901,6.4366,20.0},
{1480.3903,840.0465,6.4331,20.0},
{1657.9940,834.3144,6.3807,20.0},
{1900.6215,833.3372,7.5685,20.0},
{2064.5989,833.2748,6.3585,20.0},
{2181.0193,810.4846,6.3679,20.0},
{2295.9771,765.2249,10.3628,20.0},
{2378.4038,807.1584,7.1340,20.0},
{2486.1809,838.0077,6.3575,20.0},
{2652.8877,948.6396,6.3531,20.0},
{2706.2939,1125.8922,6.3586,20.0},
{2706.1467,1353.7439,6.3585,20.0},
{2709.1023,1671.8213,6.3623,20.0},
{2708.8352,2020.2767,6.3582,20.0},
{2723.1846,2165.8037,6.3683,20.0},
{2723.8447,2329.2424,6.3586,20.0},
{2668.4348,2447.2083,6.3586,20.0},
{2549.8311,2564.8225,4.5320,20.0},
{2443.1423,2605.3872,5.6154,20.0},
{2164.1670,2584.8892,6.3962,20.0},
{1894.5842,2507.6167,6.4288,20.0},
{1637.9525,2457.5022,6.4601,20.0},
{1471.5781,2454.2603,6.3585,20.0},
{1307.0748,2413.2354,6.3597,20.0},
{1227.7690,2095.6714,6.3650,20.0},
{1226.8463,1826.5822,6.3573,20.0}
};
#define AIRPORT_CHECKPOINTS 25
new Float:gAirportCheckpoints[AIRPORT_CHECKPOINTS][4] = {
{1335.4139,1311.4680,10.4433,20.0},
{1371.9209,1383.0455,10.4432,20.0},
{1384.8876,1524.5031,10.4359,20.0},
{1394.5297,1667.1444,10.4443,20.0},
{1455.2517,1726.9674,10.4432,20.0},
{1475.7906,1648.5292,10.4367,20.0},
{1483.4435,1395.6781,10.4493,20.0},
{1462.8909,1291.8767,10.4444,20.0},
{1404.7726,1293.1791,10.4431,20.0},
{1371.9209,1383.0455,10.4432,20.0},
{1384.8876,1524.5031,10.4359,20.0},
{1394.5297,1667.1444,10.4443,20.0},
{1455.2517,1726.9674,10.4432,20.0},
{1475.7906,1648.5292,10.4367,20.0},
{1483.4435,1395.6781,10.4493,20.0},
{1462.8909,1291.8767,10.4444,20.0},
{1404.7726,1293.1791,10.4431,20.0},
{1371.9209,1383.0455,10.4432,20.0},
{1384.8876,1524.5031,10.4359,20.0},
{1394.5297,1667.1444,10.4443,20.0},
{1455.2517,1726.9674,10.4432,20.0},
{1475.7906,1648.5292,10.4367,20.0},
{1483.4435,1395.6781,10.4493,20.0},
{1462.8909,1291.8767,10.4444,20.0},
{1345.2095,1292.1434,10.4436,20.0}
};
#define BIGRACE_CHECKPOINTS 49
new Float:gBigRaceCheckpoints[BIGRACE_CHECKPOINTS][4] = {
{1785.9952,835.1309,10.3989,20.0},
{1748.7905,592.3280,23.1088,20.0},
{1655.8180,300.5599,29.9665,20.0},
{1602.5116,84.5114,37.4224,20.0},
{1659.8989,-209.4461,36.1333,20.0},
{1703.2068,-535.7245,34.6773,20.0},
{1656.1987,-813.8826,57.1769,20.0},
{1480.3185,-939.5712,36.1594,20.0},
{1273.1168,-925.9265,41.8142,20.0},
{982.8207,-960.1788,39.7011,20.0},
{831.6349,-1037.8883,24.7237,20.0},
{662.5064,-1189.2892,16.9769,20.0},
{485.5088,-1292.9658,15.2061,20.0},
{233.4347,-1442.4016,12.9490,20.0},
{120.3996,-1540.2352,7.4581,20.0},
{-114.7264,-1481.0430,2.4241,20.0},
{-146.8491,-1276.3054,2.4224,20.0},
{-82.0342,-1059.7024,17.4668,20.0},
{-158.3678,-959.5782,29.1642,20.0},
{-327.2032,-861.2452,46.6156,20.0},
{-557.0703,-933.1094,58.5335,20.0},
{-822.7597,-1016.6412,83.7577,20.0},
{-923.0238,-1084.5415,97.4666,20.0},
{-1151.0997,-848.8531,68.1865,20.0},
{-1278.4388,-800.3773,69.0635,20.0},
{-1494.7966,-818.2109,63.2413,20.0},
{-1761.3132,-686.0138,24.1845,20.0},
{-1824.6887,-499.7647,14.6880,20.0},
{-1799.2300,-273.5194,21.1676,20.0},
{-1856.0400,-114.0783,6.2773,20.0},
{-1976.7888,-65.3713,28.1513,20.0},
{-2004.5599,88.7358,27.2661,20.0},
{-1983.5828,227.2421,29.0051,20.0},
{-1884.1584,213.5363,38.5251,20.0},
{-1773.9708,427.6877,38.2112,20.0},
{-1551.7379,654.5607,43.4852,20.0},
{-1290.0557,930.4116,45.4414,20.0},
{-1128.9037,1100.3394,37.9419,20.0},
{-995.8885,1157.3157,31.6097,20.0},
{-894.5283,881.2127,19.1746,20.0},
{-696.4014,674.8295,16.3628,20.0},
{-353.9913,548.7284,16.1551,20.0},
{36.5368,637.5943,6.8774,20.0},
{381.1325,754.3426,5.8594,20.0},
{707.5753,657.6094,9.4750,20.0},
{1037.1193,769.6460,10.4579,20.0},
{1278.9496,829.6976,7.6494,20.0},
{1590.3094,833.4753,6.4650,20.0},
{1795.2782,838.1002,10.3989,20.0}
};
#define CARTRACE_CHECKPOINTS 20
new Float:gCartRaceCheckpoints[CARTRACE_CHECKPOINTS][4] = {
{2423.6563,1948.8358,5.2994,10.0}, //start
{2422.6785,1893.6893,5.2991,10.0},
{2408.1357,1860.1967,5.2994,10.0},
{2378.6748,1850.6016,5.3001,10.0},
{2402.9751,1913.3027,5.2991,10.0},
{2379.1389,1951.3734,5.2997,10.0},
{2424.2876,1954.7008,5.2999,10.0},
{2422.6785,1893.6893,5.2991,10.0},
{2408.1357,1860.1967,5.2994,10.0},
{2378.6748,1850.6016,5.3001,10.0},
{2402.9751,1913.3027,5.2991,10.0},
{2379.1389,1951.3734,5.2997,10.0},
{2424.2876,1954.7008,5.2999,10.0},
{2422.6785,1893.6893,5.2991,10.0},
{2408.1357,1860.1967,5.2994,10.0},
{2378.6748,1850.6016,5.3001,10.0},
{2402.9751,1913.3027,5.2991,10.0},
{2379.1389,1951.3734,5.2997,10.0},
{2424.2876,1954.7008,5.2999,10.0},
{2424.2876,1954.7008,5.2999,10.0} //finish
};
if(strcmp(cmd, "/startrace", true) == 0 || strcmp(cmd, "/sr", true) == 0) {
if (getCheckpointType(playerid) >= 11 && IsPlayerInCheckpoint(playerid) == 1){
new tracknumber;
gRacer[playerid] = gRaceid;
if(gRaceid == 99) gRaceid=1;
gPosition[gRaceid] = 0;
switch (getCheckpointType(playerid))
{
case CP_LVRACE:
{
MAX_CHECKPOINTS[gRaceid] = LVRACE_CHECKPOINTS;
tracknumber = LVRACE;
gTrackName[gRaceid] = "LVRace";
}
case CP_LVRACE2:
{
MAX_CHECKPOINTS[gRaceid] = LVRACE2_CHECKPOINTS;
tracknumber = LVRACE2;
gTrackName[gRaceid] = "LVRaceII";
}
case CP_DRAG:
{
MAX_CHECKPOINTS[gRaceid] = DRAG_CHECKPOINTS;
tracknumber = DRAG;
gTrackName[gRaceid] = "DragRace";
}
case CP_FULLTURN:
{
MAX_CHECKPOINTS[gRaceid] = FULLTURN_CHECKPOINTS;
tracknumber = FULLTURN;
gTrackName[gRaceid] = "Full-Turn";
}
case CP_ENCLOSE:
{
MAX_CHECKPOINTS[gRaceid] = ENCLOSE_CHECKPOINTS;
tracknumber = ENCLOSE;
gTrackName[gRaceid] = "Enclose";
}
case CP_FREEWAY:
{
MAX_CHECKPOINTS[gRaceid] = FREEWAY_CHECKPOINTS;
tracknumber = FREEWAY;
gTrackName[gRaceid] = "Freeway";
}
case CP_AIRPORT:
{
MAX_CHECKPOINTS[gRaceid] = AIRPORT_CHECKPOINTS;
tracknumber = AIRPORT;
gTrackName[gRaceid] = "LVAirport";
}
case CP_BIGRACE:
{
MAX_CHECKPOINTS[gRaceid] = BIGRACE_CHECKPOINTS;
tracknumber = BIGRACE;
gTrackName[gRaceid] = "BigRace";
}
case CP_CARTRACE:
{
MAX_CHECKPOINTS[gRaceid] = CARTRACE_CHECKPOINTS;
tracknumber = CARTRACE;
gTrackName[gRaceid] = "CartRace";
}
}
for (new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i)){
if (IsPlayerInCheckpoint(i) && getCheckpointType(playerid) == getCheckpointType(i))
{
gRacer[i] = gRacer[playerid];
gStartedAt[i] = mktime();
gProgress[i] = 0;
gTrack[i] = tracknumber;
SetCheckpoint(i, 0);
SetCameraBehindPlayer(i);
SendClientMessage(i, 0xFFFF00AA, "<> Ãîíêà íà÷àëàñü! <>");
gCountdown[i] = 5;
TogglePlayerControllable(i, 0);
}
}
}
//new tmpbuf[256];
//format(tmpbuf, sizeof(tmpbuf), "Debug: raceid:%d, countdown:%d, track:%d", gRaceid, gCountdown[playerid], gTrack);
//SendClientMessage(playerid, 0xFFFF00AA, tmpbuf);
gRaceid++;
} else {
SendClientMessage(playerid, 0xFFFF00AA, "<> Âû íå âíóòðè ãîíî÷íîãî ÷åêïîéíòà! <>");
}
return 1;
}
if(strcmp(cmd, "/leaverace", true) == 0 || strcmp(cmd, "/lr", true) == 0) {
gProgress[playerid] = 0;
DisablePlayerCheckpoint(playerid);
gRacer[playerid] = 0;
TogglePlayerControllable(playerid, 1);
return 1;
}
if(strcmp(cmd, "/debug", true) == 0) {
new tmpbuf[256];
format(tmpbuf, sizeof(tmpbuf), "Debug: raceid:%d, countdown:%d, track:%d", gRaceid, gCountdown[playerid], gTrack);
SendClientMessage(playerid, 0xFFFF00AA, tmpbuf);
return 1;
}
return 0;
}
//------------------------------------------------------------------------------------------------------
public CountdownCheck()
{
for (new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
switch (gCountdown[i])
{
case -1:
{
//break;
}
case 5:
{
new tmpbuf[256];
format(tmpbuf, sizeof(tmpbuf),"%d", gCountdown[i]);
GameTextForPlayer(i, tmpbuf, 750, 5);
PlaySoundForPlayer(i, 1056);
SetCameraBehindPlayer(i);
gCountdown[i]--;
}
case 4,3,2,1:
{
new tmpbuf[256];
format(tmpbuf, sizeof(tmpbuf),"%d", gCountdown[i]);
GameTextForPlayer(i, tmpbuf, 750, 5);
PlaySoundForPlayer(i, 1056);
gCountdown[i]--;
}
case 0:
{
TogglePlayerControllable(i, 1);
PlaySoundForPlayer(i, 1057);
GameTextForPlayer(i,"~W~GO", 2000, 5);
SendClientMessage(i, COLOR_ORANGE, " Ãîíêà íà÷àëàñü! /leaverace äëÿ âûõîäà.");
gCountdown[i]--;
}
}
}
}
}
case CP_LVRACE: {
SendClientMessage(playerid, COLOR_GREEN, "TRACK: LVRace. /startrace");
}
case CP_LVRACE2: {
SendClientMessage(playerid, COLOR_GREEN, "TRACK: LVRaceII. /startrace");
}
case CP_DRAG: {
SendClientMessage(playerid, COLOR_GREEN, "TRACK: DragRace. /startrace");
}
case CP_FULLTURN: {
SendClientMessage(playerid, COLOR_GREEN, "TRACK: Full-Turn. /startrace");
}
case CP_ENCLOSE: {
SendClientMessage(playerid, COLOR_GREEN, "TRACK: Enclose. /startrace");
}
case CP_FREEWAY: {
SendClientMessage(playerid, COLOR_GREEN, "TRACK: Freeway. /startrace");
}
case CP_AIRPORT: {
SendClientMessage(playerid, COLOR_GREEN, "TRACK: LVAirport. /startrace");
}
case CP_BIGRACE: {
SendClientMessage(playerid, COLOR_GREEN, "TRACK: BigRace. /startrace");
}
case CP_CARTRACE: {
SendClientMessage(playerid, COLOR_GREEN, "TRACK: CartRace. /startrace");
}
else if(gRacer[playerid] >= 1){
if (gProgress[playerid] == MAX_CHECKPOINTS[gRacer[playerid]]-1)
{
gPosition[gRacer[playerid]]++;
new playername[MAX_PLAYER_NAME], finishmessage[256], finishtime[256];
new Float:fMinutes, Minutes, Seconds, sSeconds[3];
format(string, sizeof(string), "gPosition=%d; gRacer=%d; gProgress=%d", gPosition[gRacer[playerid]], gRacer[playerid], gProgress[playerid]);
SendClientMessage(playerid,COLOR_WHITE,string);
new finishedin = mktime() - gStartedAt[playerid];
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
if (finishedin > 0) {
fMinutes = finishedin/60;
Minutes = floatround(fMinutes, floatround_floor);
Seconds = finishedin-(Minutes*60);
if (Seconds < 10)
{
format(sSeconds, sizeof(sSeconds), "0%d", Seconds);
} else {
format(sSeconds, sizeof(sSeconds), "%d", Seconds);
}
format(finishtime, sizeof(finishtime),"-> %s finished %s in %d:%s", playername, gTrackName[gRacer[playerid]], Minutes, sSeconds);
for (new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i)){
if(gRacer[i] == gRacer[playerid]){
SendClientMessage(i,NICE_BLUE, finishtime);
} else {
SendClientMessage(i,COLOR_GREEN, finishtime);
}
}
}
}
DisablePlayerCheckpoint(playerid);
switch (gPosition[gRacer[playerid]]){
case 1:
{
format(finishmessage, sizeof(finishmessage),"%s has won the race!", playername);
for (new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i)){
if(gRacer[i] == gRacer[playerid]){
GameTextForPlayer(i, finishmessage, 3000, 5);
}
}
}
//SetPlayerScore(playerid,GetPlayerScore(playerid)+3);
//GivePlayerMoney(playerid, 15000);
//PlaySoundForPlayer(playerid, 1183);
//CheckAgainstHighScore(playerid, gTime);
}
case 2:
{
format(finishmessage, sizeof(finishmessage),"%s finished %dnd", playername, gPosition[gRacer[playerid]]);
for (new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i)){
if(gRacer[i] == gRacer[playerid]){
GameTextForPlayer(i, finishmessage, 3000, 5);
}
}
}
//SetPlayerScore(playerid,GetPlayerScore(playerid)+2);
//GivePlayerMoney(playerid, 10000);
//PlaySoundForPlayer(playerid, 1183);
}
case 3:
{
format(finishmessage, sizeof(finishmessage),"%s finished %drd", playername, gPosition[gRacer[playerid]]);
for (new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i)){
if(gRacer[i] == gRacer[playerid]){
GameTextForPlayer(i, finishmessage, 3000, 5);
}
}
}
//SetPlayerScore(playerid,GetPlayerScore(playerid)+1);
//GivePlayerMoney(playerid, 7500);
//PlaySoundForPlayer(playerid, 1183);
}
default:
{
format(finishmessage, sizeof(finishmessage),"%s finished %dth", playername, gPosition[gRacer[playerid]]);
for (new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i)){
if(gRacer[i] == gRacer[playerid]){
GameTextForPlayer(i, finishmessage, 3000, 5);
}
}
}
//SetPlayerScore(playerid,GetPlayerScore(playerid)+1);
//GivePlayerMoney(playerid, 5000);
//PlaySoundForPlayer(playerid, 1183);
}
}
gProgress[playerid] = 0;
DisablePlayerCheckpoint(playerid);
gRacer[playerid] = 0;
} else {
gProgress[playerid]++;
SetCheckpoint(playerid, gProgress[playerid]);
PlaySoundForPlayer(playerid, 1137);
}
}
}
public SetCheckpoint(playerid, i)
{
DisablePlayerCheckpoint(playerid);
switch (gTrack[playerid]){
case LVRACE: SetPlayerCheckpoint(playerid,gLVRaceCheckpoints[i][0],gLVRaceCheckpoints[i][1],gLVRaceCheckpoints[i][2],gLVRaceCheckpoints[i][3]);
case LVRACE2: SetPlayerCheckpoint(playerid,gLVRace2Checkpoints[i][0],gLVRace2Checkpoints[i][1],gLVRace2Checkpoints[i][2],gLVRace2Checkpoints[i][3]);
case DRAG: SetPlayerCheckpoint(playerid,gDragCheckpoints[i][0],gDragCheckpoints[i][1],gDragCheckpoints[i][2],gDragCheckpoints[i][3]);
case FULLTURN: SetPlayerCheckpoint(playerid,gFullTurnCheckpoints[i][0],gFullTurnCheckpoints[i][1],gFullTurnCheckpoints[i][2],gFullTurnCheckpoints[i][3]);
case ENCLOSE: SetPlayerCheckpoint(playerid,gEncloseCheckpoints[i][0],gEncloseCheckpoints[i][1],gEncloseCheckpoints[i][2],gEncloseCheckpoints[i][3]);
case FREEWAY: SetPlayerCheckpoint(playerid,gFreewayCheckpoints[i][0],gFreewayCheckpoints[i][1],gFreewayCheckpoints[i][2],gFreewayCheckpoints[i][3]);
case AIRPORT: SetPlayerCheckpoint(playerid,gAirportCheckpoints[i][0],gAirportCheckpoints[i][1],gAirportCheckpoints[i][2],gAirportCheckpoints[i][3]);
case BIGRACE: SetPlayerCheckpoint(playerid,gBigRaceCheckpoints[i][0],gBigRaceCheckpoints[i][1],gBigRaceCheckpoints[i][2],gBigRaceCheckpoints[i][3]);
case CARTRACE: SetPlayerCheckpoint(playerid,gCartRaceCheckpoints[i][0],gCartRaceCheckpoints[i][1],gCartRaceCheckpoints[i][2],gCartRaceCheckpoints[i][3]);
//case : SetPlayerCheckpoint(playerid,gCheckpoints[i][0],gCheckpoints[i][1],gCheckpoints[i][2],gCheckpoints[i][3]);
}
}