Issue with race system
#1

Hi everyone! I'm having an issue with my 4 room based race system. The player has to make a room in the lobby, and then someone joins. All of this works for room 1 (id 0) but in any other room it does not teleport the loser, it does not remove the car of the winner, but it does remove the car of the loser. The code is the following:

Код:
new rID[4][MAX_PLAYERS];
new vrID[4][5];
enum gRoomInfo
{
	Creator[MAX_PLAYER_NAME],
	Wager,
	Vehicle,
	Interior,
	bool:Temp,
	bool:Active,
	Players,
	Rounds,
	VW,
}

new gRoom[4][gRoomInfo];
Код:
		else if(pRound[playerid] == gRoom[pRoom[playerid]][Rounds] - 1)
		{
		    new pRoomSub = pRoom[playerid];
		    SetTimerEx("EndRace", 5000, false, "i", pRoomSub);
		    for(new i; i <= gRoom[pRoom[playerid]][Players]; i++)
		    {
		        if(rID[pRoom[playerid]][i] == rID[pRoom[playerid]][playerid])
		        {
		            SendClientMessage(playerid, 0xFF0000AA, "[Server]: Congratulations! You won the race.");
		            GivePlayerMoney(playerid, gRoom[pRoom[playerid]][Wager]*(gRoom[pRoom[playerid]][Players] - 1));
				}
				else if(rID[pRoom[playerid]][i] != rID[pRoom[playerid]][playerid] && InRace[i] == true)
				{
				    SendClientMessage(i, 0xFF0000AA, "[Server]: You lost the race..");
				    GivePlayerMoney(i, -gRoom[pRoom[playerid]][Wager]);
				}
				if(rID[pRoomSub][i] >= 0 && rID[pRoomSub][i] <= gRoom[pRoomSub][Players] && InRace[i] == true)
				{
				    SetPlayerInterior(i, 0);
				    SetPlayerPos(i, 2692.4453,-1707.2877,11.8478);
				    SetPlayerVirtualWorld(i, gRoom[pRoomSub][VW]);
					DestroyVehicle(vrID[pRoom[playerid]][i]);
					DisablePlayerRaceCheckpoint(i);
					pCheckPoint[i] = 999;
					pRound[i] = 999;
					pRoom[i] = 999;
					rID[pRoomSub][i] = 999;
					InRace[i] = false;
				}
			}
		}
Can anyone help? Any other hints are also very welcome. Thank you!!
Reply
#2

Bump
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)