include <a_samp> #define COLOR_WHITE 0xFFFFFF00 #define COLOR_GREEN 0x33AA3300 public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp(\"/race1\", cmdtext, true, 26) == 0) //ez csak példa { new pName[MAX_PLAYER_NAME], string[128]; SetPlayerInterior(playerid,0); SetPlayerPos ( playerid, -2053.5017,-328.4658,35.3124 ); GetPlayerName(playerid, pName, sizeof(pName)); format(string, sizeof(string), \"%s elment versenyezni: Race 1 /race1\", pName,playerid); SendClientMessageToAll(COLOR_GREEN, string); SendClientMessage(playerid,COLOR_WHITE,\"Verseny indítása: /racestart.\"); return 1; } if (strcmp(\"/racestart\", cmdtext, true, 10) == 0) { if(IsPlayerInRangeOfPoint(playerid, 10.0, -2053.5017,-328.4658,35.3124)) //Én a teleportnál szoktam az indítást engedélyezni { new pName[MAX_PLAYER_NAME], string[128]; SetPlayerRaceCheckpoint(playerid, -1978.6884,-303.2546,36.3763); // a verseny 1. checkpointja SetPVarInt(playerid, \"Race1\", 1); GetPlayerName(playerid, pName, sizeof(pName)); format(string, sizeof(string), \"%s elindította a versenyt: Race 1 (/racestart)\", pName,playerid); SendClientMessageToAll(COLOR_GREEN, string); return 1; } else { SendClientMessage(playerid,COLOR_WHITE,\"Nem tudod elindítani a versenyt, túl messze vagy!(Írd be /race1)\"); } } return 0; } public OnPlayerEnterRaceCheckpoint(playerid){ //Race 1 switch(GetPVarInt(playerid, \"Race1\")) { case 1: { DisablePlayerRaceCheckpoint(playerid); switch(GetPVarInt(playerid, \"RACE\")) { case 0:SetPlayerRaceCheckpoint(playerid,0,-2053.5017,-328.4658,35.3124); //A kezdõ checkpoint, ezt használtuk a teleportnál is! case 1:SetPlayerRaceCheckpoint(playerid,0,-1978.6884,-303.2546,36.3763); //A következõ checkpoint case 2:SetPlayerRaceCheckpoint(playerid,0,-1931.4050,-232.2663,38.5504); //És így tovább, amíg el nem fogy, az utolsó után még kell egy case, ebbe irod bele, hogy az utolsó checkpoint áthaladása után mi történjen case 3:SetPlayerRaceCheckpoint(playerid,0,-1913.4541,-116.0949,38.2361); case 4:SetPlayerRaceCheckpoint(playerid,0,-1900.8875,59.7228,38.2422); case 5:SetPlayerRaceCheckpoint(playerid,0,-1872.7599,252.7376,39.0976); case 6:SetPlayerRaceCheckpoint(playerid,0,-1782.5299,437.5626,38.8623); case 7:SetPlayerRaceCheckpoint(playerid,0,-1665.2118,557.6477,38.4862); case 8:SetPlayerRaceCheckpoint(playerid,0,-1527.3658,703.1074,45.1549); case 9:SetPlayerRaceCheckpoint(playerid,0,-1394.5488,843.6237,47.3517); case 10:SetPlayerRaceCheckpoint(playerid,0,-1276.4740,967.5632,45.0317); case 11:SetPlayerRaceCheckpoint(playerid,0,-1192.5912,1056.6184,41.2119); case 12:SetPlayerRaceCheckpoint(playerid,0,-1104.9138,1178.9491,38.3373); case 13:SetPlayerRaceCheckpoint(playerid,0,-1086.2437,1334.7394,30.5447); case 14:SetPlayerRaceCheckpoint(playerid,0,-1122.7238,1469.2491,25.0582); case 15:SetPlayerRaceCheckpoint(playerid,0,-1168.5190,1624.8956,18.0027); case 16:SetPlayerRaceCheckpoint(playerid,0,-1326.3604,1701.6650,6.3481); case 17:SetPlayerRaceCheckpoint(playerid,0,-1534.8606,1722.4823,2.9056); case 18:SetPlayerRaceCheckpoint(playerid,0,-1642.1838,1769.5662,14.3397); case 19:SetPlayerRaceCheckpoint(playerid,0,-1687.1566,1819.3110,25.4436); case 20:SetPlayerRaceCheckpoint(playerid,0,-1689.7976,1847.0604,24.5486); case 21:SetPlayerRaceCheckpoint(playerid,0,-1669.1462,1995.4657,19.5529); case 22:SetPlayerRaceCheckpoint(playerid,0,-1662.6543,2053.1343,18.3984); case 23:SetPlayerRaceCheckpoint(playerid,0,-1706.1746,2152.3845,18.1049); case 24:SetPlayerRaceCheckpoint(playerid,0,-1833.8024,2220.9602,18.5170); case 25:SetPlayerRaceCheckpoint(playerid,0,-1897.0645,2351.5271,44.6894); case 26: { new string[64]; static Ranks; GetPlayerName(playerid, string, MAX_PLAYER_NAME); switch(++Ranks) { case 1: format(string, sizeof string, \"~r~%s ~b~nyerte a versenyt! (S-Cup1)\", string); case 2: format(string, sizeof string, \"~r~%s ~b~II.helyett lett! (S-Cup1)\", string); case 3: format(string, sizeof string, \"~r~%s ~b~III.helyezett lett! (S-Cup1)\", string); } DeletePVar(playerid, \"Race1\"); DeletePVar(playerid, \"RACE\"); SendClientMessageToAll(COLOR_GREEN, string); return GivePlayerMoney(playerid, Ranks * 100000); } } return SetPVarInt(playerid, \"RACE\", GetPVarInt(playerid, \"RACE\") + 1); } } return 1;}
case 0:SetPlayerRaceCheckpoint(playerid,0,-2053.5017,-328.4658,35.3124); //A kezdõ checkpoint, ezt használtuk a teleportnál is! case 1:SetPlayerRaceCheckpoint(playerid,0,-1978.6884,-303.2546,36.3763); //A következõ checkpoint case 2:SetPlayerRaceCheckpoint(playerid,0,-1931.4050,-232.2663,38.5504); //És így tovább, amíg el nem fogy, az utolsó után még kell egy case, ebbe irod bele, hogy az utolsó checkpoint áthaladása után mi történjen case 3:SetPlayerRaceCheckpoint(playerid,0,-1913.4541,-116.0949,38.2361); case 4:SetPlayerRaceCheckpoint(playerid,0,-1900.8875,59.7228,38.2422); case 5:SetPlayerRaceCheckpoint(playerid,0,-1872.7599,252.7376,39.0976); case 6:SetPlayerRaceCheckpoint(playerid,0,-1782.5299,437.5626,38.8623); case 7:SetPlayerRaceCheckpoint(playerid,0,-1665.2118,557.6477,38.4862); case 8:SetPlayerRaceCheckpoint(playerid,0,-1527.3658,703.1074,45.1549); case 9:SetPlayerRaceCheckpoint(playerid,0,-1394.5488,843.6237,47.3517); case 10:SetPlayerRaceCheckpoint(playerid,0,-1276.4740,967.5632,45.0317); case 11:SetPlayerRaceCheckpoint(playerid,0,-1192.5912,1056.6184,41.2119); case 12:SetPlayerRaceCheckpoint(playerid,0,-1104.9138,1178.9491,38.3373); case 13:SetPlayerRaceCheckpoint(playerid,0,-1086.2437,1334.7394,30.5447); case 14:SetPlayerRaceCheckpoint(playerid,0,-1122.7238,1469.2491,25.0582); case 15:SetPlayerRaceCheckpoint(playerid,0,-1168.5190,1624.8956,18.0027); case 16:SetPlayerRaceCheckpoint(playerid,0,-1326.3604,1701.6650,6.3481); case 17:SetPlayerRaceCheckpoint(playerid,0,-1534.8606,1722.4823,2.9056); case 18:SetPlayerRaceCheckpoint(playerid,0,-1642.1838,1769.5662,14.3397); case 19:SetPlayerRaceCheckpoint(playerid,0,-1687.1566,1819.3110,25.4436); case 20:SetPlayerRaceCheckpoint(playerid,0,-1689.7976,1847.0604,24.5486); case 21:SetPlayerRaceCheckpoint(playerid,0,-1669.1462,1995.4657,19.5529); case 22:SetPlayerRaceCheckpoint(playerid,0,-1662.6543,2053.1343,18.3984); case 23:SetPlayerRaceCheckpoint(playerid,0,-1706.1746,2152.3845,18.1049); case 24:SetPlayerRaceCheckpoint(playerid,0,-1833.8024,2220.9602,18.5170); case 25:SetPlayerRaceCheckpoint(playerid,0,-1897.0645,2351.5271,44.6894);