All pastes #1425592 Raw Edit

PAWNO Kart Race

public cpp v1 · immutable
#1425592 ·published 2009-05-17 17:11 UTC
rendered paste body
#include <a_samp>#define FILTERSCRIPT//#define KEY_SUBMISSION (512)#if defined FILTERSCRIPTpublic OnFilterScriptInit(){print("Load sucessfull - Kart Race.amx");CreateObject(978, 2609.702148, -1700.638428, 1.553797, 0.0000, 0.0000, 0.0000);CreateObject(978, 2600.374756, -1700.578003, 1.566833, 0.0000, 0.0000, 0.0000);CreateObject(978, 2592.361572, -1703.895142, 1.480845, 0.0000, 0.0000, 45.0000);CreateObject(5837, 2565.637939, -1735.608154, 2.358120, 0.0000, 0.0000, 270.0000);CreateObject(973, 2553.303955, -1859.778687, 3.695533, 0.0000, 0.0000, 270.0000);CreateObject(973, 2553.179199, -1851.033203, 3.709577, 0.0000, 0.0000, 270.0000);CreateObject(973, 2553.227051, -1848.842407, 3.692649, 0.0000, 0.0000, 270.0000);CreateObject(973, 2553.276855, -1841.067139, 3.717649, 0.0000, 0.0000, 270.0000);CreateObject(973, 2553.203125, -1840.116455, 3.717649, 0.0000, 0.0000, 270.0000);CreateObject(14637, 2568.031006, -1721.718872, 13.369866, 0.0000, 0.0000, 90.0000);CreateObject(16370, 2599.852051, -1486.586670, 17.394527, 0.0000, 0.0000, 180.0000);CreateObject(1468, 2569.760010, -1734.127197, 1.909534, 0.0000, 0.0000, 0.0000);CreateObject(1468, 2575.036865, -1734.083496, 1.909534, 0.0000, 0.0000, 0.0000);CreateObject(2794, 2562.970703, -1733.630371, 3.726413, 0.0000, 0.0000, 0.0000);CreateObject(3621, 2568.257568, -1826.366211, 6.710535, 0.0000, 0.0000, 0.0000);CreateObject(5153, 2565.905762, -1808.361084, 1.672875, 0.0000, 343.6707, 270.0000);CreateObject(5153, 2565.920410, -1811.515259, 4.332540, 0.0000, 343.6707, 270.0000);CreateObject(5153, 2565.930908, -1814.785522, 7.113643, 0.0000, 343.6707, 270.0000);CreateObject(5153, 2565.929688, -1818.593018, 8.855762, 0.0000, 14.6104, 270.0001);CreateObject(982, 2577.005859, -1843.332275, 3.297927, 0.0000, 0.0000, 0.0000);CreateObject(982, 2577.119141, -1869.122070, 3.542930, 0.0000, 0.0000, 0.0000);CreateObject(982, 2577.187744, -1894.611572, 3.542930, 0.0000, 0.0000, 0.0000);CreateObject(982, 2584.348389, -1918.064575, 3.542930, 0.0000, 0.0000, 33.7500);CreateObject(982, 2598.559814, -1939.336426, 3.542930, 0.0000, 0.0000, 33.7500);CreateObject(982, 2612.786621, -1960.619751, 3.542930, 0.0000, 0.0000, 33.7500);CreateObject(1243, 2591.074707, -1958.551147, 3.622573, 0.0000, 291.2451, 354.6114);CreateObject(2780, 2554.300537, -1912.124268, 1.152101, 0.0000, 0.0000, 0.0000);CreateObject(2780, 2561.003418, -1910.485962, 1.132705, 0.0000, 0.0000, 0.0000);CreateObject(2780, 2568.011719, -1912.555664, 1.734372, 0.0000, 0.0000, 0.0000);CreateObject(2780, 2572.954346, -1902.107544, 1.734638, 0.0000, 0.0000, 0.0000);CreateObject(3515, 2574.000732, -1959.466431, 1.579578, 175.3251, 178.6588, 10.3132);CreateObject(3374, 2598.101318, -1971.071411, 4.353352, 0.0000, 0.0000, 0.0000);CreateObject(2064, 2557.770508, -1975.436035, 4.911811, 0.0000, 0.0000, 0.0000);CreateObject(749, 2573.736572, -1980.587280, 3.394283, 0.0000, 0.0000, 0.0000);CreateObject(10789, 2601.416260, -2013.575073, 5.490658, 0.0000, 0.0000, 90.0000);CreateObject(979, 2579.462891, -1998.319458, 3.699595, 0.0000, 0.0000, 0.0000);CreateObject(979, 2570.069824, -1998.308960, 3.711546, 0.0000, 0.0000, 0.0000);CreateObject(979, 2560.719971, -1998.331543, 3.699595, 0.0000, 0.0000, 0.0000);CreateObject(979, 2551.345947, -1998.331299, 3.699595, 0.0000, 0.0000, 0.0000);CreateObject(3280, 2585.027344, -1998.152100, 3.809376, 271.4781, 351.4056, 353.9839);CreateObject(966, 2611.940186, -2002.298218, 2.854428, 0.0000, 0.0000, 0.0000);CreateObject(968, 2611.961426, -2002.243896, 3.617882, 0.0000, 268.8998, 0.8594);CreateObject(1225, 2603.322021, -2003.960938, 3.482351, 0.0000, 0.0000, 0.0000);CreateObject(1225, 2603.322021, -2008.460938, 3.482351, 0.0000, 0.0000, 0.0000);CreateObject(1225, 2603.433105, -2011.081055, 3.489576, 0.0000, 357.4217, 2.5783);CreateObject(1225, 2603.236084, -2015.774292, 3.491296, 0.0000, 357.4217, 2.5783);CreateObject(1225, 2603.419434, -2018.116211, 3.482351, 0.0000, 357.4217, 2.5783);CreateObject(1225, 2603.837402, -2023.111084, 3.395112, 0.0000, 357.4217, 2.5783);CreateObject(1225, 2606.860107, -2022.698486, 3.265130, 0.0000, 357.4217, 2.5783);CreateObject(1225, 2609.977051, -2022.212891, 3.265130, 0.0000, 357.4217, 2.5783);CreateObject(1225, 2608.806641, -2021.334839, 3.265130, 0.0000, 357.4217, 2.5783);CreateObject(1225, 2605.002197, -2022.274780, 3.265130, 0.0000, 357.4217, 2.5783);CreateObject(2780, 2558.652344, -1998.020508, 2.074563, 0.0000, 0.0000, 0.0000);CreateObject(2780, 2563.935547, -1998.096802, 2.686416, 0.0000, 0.0000, 0.0000);CreateObject(2780, 2571.305908, -1998.124512, 1.896871, 0.0000, 0.0000, 0.0000);CreateObject(2780, 2579.095947, -1996.643433, 2.241731, 0.0000, 0.0000, 0.0000);CreateObject(2780, 2584.539551, -1998.892090, 2.910716, 0.0000, 0.0000, 0.0000);CreateObject(9833, 2594.921875, -1999.914307, 10.561918, 0.0000, 179.5182, 60.1606);CreateObject(9833, 2596.171875, -2000.014160, 10.536922, 0.0000, 179.5182, 60.1606);CreateObject(9833, 2597.294434, -1999.769653, 10.311918, 0.0000, 179.5182, 60.1606);CreateObject(9833, 2598.861328, -1999.831299, 10.311918, 0.0000, 179.5182, 60.1606);CreateObject(9833, 2599.933350, -2000.380615, 10.311918, 0.0000, 179.5182, 359.5361);CreateObject(9833, 2601.862549, -1999.858154, 10.411929, 0.0000, 179.5182, 60.1606);CreateObject(9833, 2602.959473, -2000.032471, 10.311918, 0.0000, 179.5182, 26.4105);CreateObject(9833, 2604.168945, -1999.961548, 10.561918, 0.0000, 179.5182, 26.4105);CreateObject(9833, 2605.497314, -2000.084473, 10.811918, 0.0000, 179.5182, 26.4105);CreateObject(9833, 2607.022949, -2000.086670, 10.811918, 0.0000, 177.7994, 26.4105);CreateObject(9833, 2609.106689, -2000.697998, 10.561918, 8.5944, 179.5182, 26.4105);CreateObject(9833, 2610.288818, -2000.116943, 10.561918, 0.0000, 176.0804, 26.4105);CreateObject(9833, 2612.034668, -2000.290283, 10.461927, 0.0000, 176.0804, 26.4105);CreateObject(979, 2551.974854, -2051.562500, 3.817924, 0.0000, 0.0000, 270.0000);CreateObject(979, 2552.325195, -2042.162231, 3.882416, 0.0000, 0.0000, 270.0000);CreateObject(3280, 2591.761230, -2231.328125, 0.008477, 0.0000, 0.0000, 0.0000);CreateObject(3280, 2592.910889, -2231.384521, 0.516722, 359.1406, 277.4941, 0.0000);CreateObject(6189, 2575.885742, -2267.667480, -8.692047, 353.9839, 0.0000, 359.1406);CreateVehicle(571,2605.1228,-1488.7321,16.4842,204.9729,0,0,100);return 1;}#else#endifnew kart = 0;new racecheckpoint[MAX_PLAYERS];public OnPlayerSpawn(playerid){SetPlayerPos(playerid,2599.852051,-1486.586670,17.394527);SetPlayerRaceCheckpoint(playerid,0,2598.356934,-1509.810059,15.656765,2586.142090,-1604.330688,-1.080896,2.7);return 1;}forward Countdown();new Count = -1;new CountdownTimer;new StartTimer;new Seconds;public Countdown(){    if(Count == 0)    {        GameTextForAll("Go go go!", 300, 3);        KillTimer(CountdownTimer);        kart = 1;        //PlayerPlaySound(playerid,1138,0.0,0.0,0.0);    }    else    {        new string[128];        format(string, sizeof(string), "%d", Count);        GameTextForAll(string, 1500, 3);        //PlayerPlaySound(playerid,1138,0.0,0.0,0.0);        Count--;    }    return 1;}forward RaceStartK();public RaceStartK(){	if(Seconds == 0)	{	KillTimer(StartTimer);	CountdownTimer = SetTimer("Countdown", 1000, 1);	Count = 3;	}	else	{	Seconds--;	}}public OnPlayerEnterRaceCheckpoint(playerid){	 if(kart == 1) {     DisablePlayerRaceCheckpoint(playerid);     }     else if(racecheckpoint[playerid] == 0)     {          SetPlayerRaceCheckpoint(playerid, 3, 2586.142090, -1604.330688, 2.080896, 2560.643066, -1735.592163, 2.090625, 10.0);          racecheckpoint[playerid] = 1;     }     else if(racecheckpoint[playerid] == 1)     {          SetPlayerRaceCheckpoint(playerid, 3, 2560.643066, -1735.592163, 2.090625, 2563.804199, -1827.314087, 9.938860, 5.0);          racecheckpoint[playerid] = 2;     }     else if(racecheckpoint[playerid] == 2)     {          SetPlayerRaceCheckpoint(playerid, 3, 2563.804199, -1827.314087, 9.938860, 2564.770020, -1906.402344, 1.216259, 5.0);          racecheckpoint[playerid] = 3;     }     else if(racecheckpoint[playerid] == 3)     {          SetPlayerRaceCheckpoint(playerid, 3, 2564.770020, -1906.402344, 1.216259, 2598.687988, -2022.746094, 2.659375, 5.0);          racecheckpoint[playerid] = 4;     }	 else if(racecheckpoint[playerid] == 4)     {          SetPlayerRaceCheckpoint(playerid, 3, 2598.687988, -2022.746094, 2.659375, 2575.626709, -2342.115967, 12.625000, 5.0);          racecheckpoint[playerid] = 5;     }   	 else if(racecheckpoint[playerid] == 5)     {          SetPlayerRaceCheckpoint(playerid, 3, 2575.626709, -2342.115967, 12.625000, 0.0, 0.0, 0.0, 5.0);          racecheckpoint[playerid] = 6;     }     else if(racecheckpoint[playerid] == 6)     {          //FINISH          racecheckpoint[playerid] = 0;     }     return 1;}public OnPlayerCommandText(playerid, cmdtext[]){    if(strcmp(cmdtext, "/jkart", true)==0)    {        StartTimer = SetTimer("RaceStartK", 1000, 1);        Seconds = 3;        SendClientMessageToAll(0x00FF00AA, "***Kart race starting in 3 seconds at /kart");        GameTextForPlayer(playerid,"DO NOT STAY INTO THE RED CHECKPOINT!", 1000,1);        return 1;    }	if (strcmp("/uex", cmdtext, true, 10) == 0)	{		new Float:X, Float:Y, Float:Z;		GetPlayerPos(playerid, X, Y, Z);		new id;		for (id=0; id<=13; id++) {		CreateExplosion(X,Y,Z,id,10.0);		}		return 1;	}	return 0;	}