08.07.2014, 18:02
Because only variable is the first public work in the case that the variable EVENT EVENTOKart runs but does not work that is underneath, which is the first that works?.
pawn Код:
public OnPlayerEnterRaceCheckpoint(playerid)
{
if(EVENTO[playerid] == 1)
{
if(PlayerToPoint(25.0,playerid,-1341.8914,-671.3342,1055.9453))
{
EVENTO[playerid] = 2;
DisablePlayerCheckpoint(playerid);
SetPlayerRaceCheckpoint(playerid,1,-1325.6431,-741.3735,1053.2600,0.0,0.0,0.0,10.0);
}
}
if(EVENTO[playerid] == 2)
{
if(PlayerToPoint(25.0,playerid,-1325.6431,-741.3735,1053.2600))
{
EVENTO[playerid] = 3;
DisablePlayerCheckpoint(playerid);
SetPlayerRaceCheckpoint(playerid,0,-1379.2018,-742.5480,1051.9008,0.0,0.0,0.0,10.0);
}
}
if(EVENTO[playerid] == 3)
{
if(PlayerToPoint(25.0,playerid,-1379.2018,-742.5480,1051.9008))
{
EVENTO[playerid] = 4;
DisablePlayerCheckpoint(playerid);
SetPlayerRaceCheckpoint(playerid,1,-1479.9423,-728.4960,1050.1608,0.0,0.0,0.0,10.0);
}
}
if(EVENTO[playerid] == 4)
{
if(PlayerToPoint(25.0,playerid,-1479.9423,-728.4960,1050.1608))
{
EVENTO[playerid] = 5;
DisablePlayerCheckpoint(playerid);
SetPlayerRaceCheckpoint(playerid,0,-1516.2136,-639.1937,1050.5753,0.0,0.0,0.0,10.0);
}
}
if(EVENTO[playerid] == 5)
{
if(PlayerToPoint(25.0,playerid,-1516.2136,-639.1937,1050.5753))
{
EVENTO[playerid] = 6;
DisablePlayerCheckpoint(playerid);
SetPlayerRaceCheckpoint(playerid,0,-1489.3101,-593.2374,1055.8838,0.0,0.0,0.0,10.0);
}
}
if(EVENTO[playerid] == 6)
{
if(PlayerToPoint(25.0,playerid,-1489.3101,-593.2374,1055.8838))
{
EVENTO[playerid] = 7;
DisablePlayerCheckpoint(playerid);
SetPlayerRaceCheckpoint(playerid,0,-1400.7007,-588.5723,1059.3887,0.0,0.0,0.0,10.0);
}
}
if(EVENTO[playerid] == 7)
{
if(PlayerToPoint(25.0,playerid,-1400.7007,-588.5723,1059.3887))
{
EVENTO[playerid] = 8;
DisablePlayerCheckpoint(playerid);
SetPlayerRaceCheckpoint(playerid,0,-1329.6940,-639.5583,1054.7239,0.0,0.0,0.0,10.0);
}
}
if(EVENTO[playerid] == 8)
{
if(PlayerToPoint(25.0,playerid,-1329.6940,-639.5583,1054.7239))
{
EVENTO[playerid] = 9;
DisablePlayerCheckpoint(playerid);
SetPlayerRaceCheckpoint(playerid,0,-1336.0325,-713.6648,1056.2169,0.0,0.0,0.0,10.0);
}
}
if(EVENTO[playerid] == 9)
{
if(PlayerToPoint(25.0,playerid,-1336.0325,-713.6648,1056.2169))
{
EVENTO[playerid] = 10;
DisablePlayerCheckpoint(playerid);
SetPlayerRaceCheckpoint(playerid,0,-1441.6010,-676.3769,1053.2877,0.0,0.0,0.0,10.0);
}
}
if(EVENTO[playerid] == 10)
{
if(PlayerToPoint(25.0,playerid,-1441.6010,-676.3769,1053.2877))
{
new string[80];
format(string, sizeof(string), "Player %s Ganhou o Evento de Moto Cross e 30000R$!",PlayerName(playerid));
SendClientMessageToAll(COLOR_LIGHTBLUE, string);
GivePlayerMoney(playerid, 30000);
SendClientMessage(playerid, -1, "Parabйns voce ganhou o evento de Moto Cross e 30000R$!!.");
for(new i=0; i<MAX_PLAYERS; i++)
{
if(PlayerInfo[i][pTrazerRally] == 1)
{
SetVehicleToRespawn(GetPlayerVehicleID(i));
DisablePlayerCheckpoint(i);
DisablePlayerRaceCheckpoint(i);
EVENTO[i] = 0;
NaPorraDoEventoCorridaR[i] = false;
PlayerInfo[i][pTrazerRally] = 0;
SpawnPlayer(i);
JogadoresRally = 0;
}
}
}
if(EVENTOKart[playerid] == 1)
{
if(PlayerToPoint(25.0,playerid,-1406.2811,-151.4562,1043.9351))
{
EVENTOKart[playerid] = 2;
DisablePlayerCheckpoint(playerid);
SetPlayerRaceCheckpoint(playerid,0,-1531.3348,-202.6146,1050.6754,0.0,0.0,0.0,10.0);
}
}
if(EVENTOKart[playerid] == 2)
{
if(PlayerToPoint(25.0,playerid,-1531.3348,-202.6146,1050.6754))
{
EVENTOKart[playerid] = 3;
DisablePlayerCheckpoint(playerid);
SetPlayerRaceCheckpoint(playerid,0,-1447.4982,-283.1577,1050.9650,0.0,0.0,0.0,10.0);
}
}
if(EVENTOKart[playerid] == 3)
{
if(PlayerToPoint(25.0,playerid,-1447.4982,-283.1577,1050.9650))
{
EVENTOKart[playerid] = 4;
DisablePlayerCheckpoint(playerid);
SetPlayerRaceCheckpoint(playerid,0,-1393.4679,-169.5603,1051.3174,0.0,0.0,0.0,10.0);
}
}
if(EVENTOKart[playerid] == 4)
{
if(PlayerToPoint(25.0,playerid,-1393.4679,-169.5603,1051.3174))
{
EVENTOKart[playerid] = 5;
DisablePlayerCheckpoint(playerid);
SetPlayerRaceCheckpoint(playerid,0,-1278.8666,-163.5749,1050.5654,0.0,0.0,0.0,10.0);
}
}
if(EVENTOKart[playerid] == 5)
{
if(PlayerToPoint(25.0,playerid,-1278.8666,-163.5749,1050.5654))
{
EVENTOKart[playerid] = 6;
DisablePlayerCheckpoint(playerid);
SetPlayerRaceCheckpoint(playerid,0,-1306.9504,-271.3575,1048.1936,0.0,0.0,0.0,10.0);
}
}
if(EVENTOKart[playerid] == 6)
{
if(PlayerToPoint(25.0,playerid,-1306.9504,-271.3575,1048.1936))
{
new string[80];
format(string, sizeof(string), "Player %s Ganhou o Evento de Kart e 30000R$!",PlayerName(playerid));
SendClientMessageToAll(COLOR_LIGHTBLUE, string);
GivePlayerMoney(playerid, 30000);
SendClientMessage(playerid, -1, "Parabйns voce ganhou o evento de Corrida de Kart e Prкmio de 30000R$!!.");
for(new i=0; i<MAX_PLAYERS; i++)
{
if(PlayerInfo[i][pTrazerKart] == 1)
{
SetVehicleToRespawn(GetPlayerVehicleID(i));
DisablePlayerCheckpoint(i);
DisablePlayerRaceCheckpoint(i);
EVENTOKart[i] = 0;
PlayerInfo[i][pTrazerKart] = 0;
SpawnPlayer(i);
JogadoresKart = 0;
NaPorraDoEventoCorridaR[i] = false;
}
}
}
}
}
return true;
}

