#include #include #define COLOR_GREEN 0x33AA33AA #define COLOR_GREY 0xAFAFAFAA #define COLOR_GREEN2 0x00CC00AA #define COLOR_RED 0xFF0000FF #define COLOR_YELLOW 0xFFFF00AA #define COLOR_WHITE 0xFFFFFFAA #define COLOR_BLUE 0x0000BBAA #define COLOR_LIGHTBLUE 0x33CCFFAA #define COLOR_ORANGE 0xFF9900AA #define COLOR_SYSTEM 0xC6BEBDFF #define CP_START 0 #define CP_FINISH 1 new osoby; new stawka; new race; new PlayerRace[MAX_PLAYERS]; new PlayerCheckpoint[MAX_PLAYERS]; new Float:sx, Float:sy, Float:sz; new Float:fx, Float:fy, Float:fz; new Odliczanie[MAX_PLAYERS]; new manager; new PlayersInRace; new Float:Angle; new Start[MAX_PLAYERS]; new VehModelID; new Czas[MAX_PLAYERS] = 6; new PlayerInFinish; main(){print("\n+----------------------------------+"); print("| 2 Fast 2 Furious GameMode |"); print("| Coded By |"); print("| Mruk |"); print("+----------------------------------+\n");} public OnGameModeInit(){ SetWorldTime(0); UsePlayerPedAnims(); SetGameModeText("2 Fast 2 Furious PL"); AddPlayerClass(265,1958.3783,1343.1572,15.3746,270.1425,0,0,24,300,-1,-1); AddPlayerClass(266,1958.3783,1343.1572,15.3746,270.1425,0,0,24,300,-1,-1); AddPlayerClass(267,1958.3783,1343.1572,15.3746,270.1425,0,0,24,300,-1,-1); AddPlayerClass(268,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1); AddPlayerClass(269,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1); AddPlayerClass(270,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1); AddPlayerClass(271,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1); AddPlayerClass(272,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1); AddPlayerClass(280,1958.3783,1343.1572,15.3746,270.1425,0,0,24,300,-1,-1); return 1; } public OnPlayerSpawn(playerid){ SetPlayerInterior(playerid, 0); GivePlayerMoney(playerid, 20000); } public OnPlayerCommandText(playerid, cmdtext[]){ new cmd[256]; new idx; new string[256]; cmd = strtok(cmdtext, idx); if(strcmp(cmd, "/race", true) == 0) { new tmp[256]; tmp = strtok(cmdtext, idx); if(!strlen(tmp)){ SendClientMessage(playerid, COLOR_RED, "** Wpisz: /race [stawka] [ilość osób jaka może wziąć udział w wyścigu (2-10)]"); return 1; } stawka = strval(tmp); tmp = strtok(cmdtext, idx); if(!strlen(tmp)){ SendClientMessage(playerid, COLOR_RED, "Wpisz: /race [stawka] [ilość osób jaka może wziąć udział w wyścigu (2-10)]"); return 1; } osoby = strval(tmp); /*if(osoby < 2 || osoby > 10){ SendClientMessage(playerid, COLOR_RED, "Ilość osób jaka może wziąć udział w wyścigu nie może być większa od 10 i mniejsza od 2."); return 1; }*/ if(race == 1){ SendClientMessage(playerid, COLOR_RED, "Aktualnie jest jakiś wyścig, spróbuj ponownie po jego zakończeniu."); return 1; } if(GetPlayerMoney(playerid) < stawka){ format(string, 256, "Nie masz $%d", stawka); SendClientMessage(playerid, COLOR_RED, string); return 1; } race = 1; PlayerRace[playerid] = 1; manager = 1; SendClientMessage(playerid, COLOR_RED, "Doskonale! Teraz podjedź do miejsca w którym ma się zaczynać wyścig i wpisz /start"); SendClientMessage(playerid, COLOR_RED, "następnie podjedź tam gdzie ma się kończyć wyści i wpisz /finish."); SendClientMessage(playerid, COLOR_GREEN, "Czas oczekiwania na graczy: 2min."); format(string, 256, "Stawka Wyścigu: %d", stawka); SendClientMessage(playerid, COLOR_GREEN, string); format(string, 256, "Limit osób które mogą uczestniczyć w wyścigu: %d", osoby); SendClientMessage(playerid, COLOR_GREEN, string); //SendClientMessage(playerid, COLOR_RED, "Jedź do Punktu Kontrolnego (Czerwony punkt na radarze)."); GivePlayerMoney(playerid, -stawka); return 1; } if(strcmp(cmd, "/start", true) == 0) { if(PlayerRace[playerid] == 0){ SendClientMessage(playerid, COLOR_RED, "Nie rozpoczełeś żadnego wyścigu."); return 1; } if(!IsPlayerInAnyVehicle(playerid)){ SendClientMessage(playerid, COLOR_GREY, "Musisz być w pojeździe."); return 1; } SendClientMessage(playerid, COLOR_BLUE, "Ok, więc TU, będzie się zaczynał wyścig. Teraz jeszcze zaznacz mete komendą /finish."); manager = 1; GetPlayerPos(playerid, sx,sy,sz); GetVehicleZAngle(GetPlayerVehicleID(playerid), Angle); for(new i=0; i= 4){ format(string, 256, "Zajełeś %d miejsce, nie wygrałeś żadnej gotówki.", PlayerInFinish); SendClientMessage(playerid, COLOR_GREEN, string); } if(PlayerInFinish == PlayersInRace){ race = 0; PlayersInRace = 0; PlayerRace[playerid] = 0; osoby = 0; stawka = 0; PlayerInFinish = 0; manager = 0; SendClientMessage(playerid, COLOR_GREEN, "Ogłoszenie: Właśnie skończył się bierzący wyścig. Można rozpocząć następny."); } } } return 1; } forward SetFinishCP(playerid); public SetFinishCP(playerid){ SetPlayerCheckpoint(playerid, fx,fy,fz, 5.5); PlayerCheckpoint[playerid] = CP_FINISH; } forward CountDown(playerid); public CountDown(playerid){ for(new i=0; i -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi))) { return 1; } } return 0; } GetXYOnSideOfVehicle(vehicleid, &Float:x, &Float:y, Float:distance) { new Float:a; GetVehiclePos(vehicleid, x, y, a); GetVehicleZAngle(vehicleid, a); a += 90.0; x += (distance * floatsin(-a, degrees)); y += (distance * floatcos(-a, degrees)); return 1; } strtok(const string[], &index) { new length = strlen(string); while ((index < length) && (string[index] <= ' ')) { index++; } new offset = index; new result[20]; while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1))) { result[index - offset] = string[index]; index++; } result[index - offset] = EOS; return result; }