09.05.2010, 13:27
assim?
new Stats[MAX_PLAYERS];
new CheckPoints[12][3] = //4 = 4 coordenadas | 3 = 3 "valores" (X,Y,Z)
{
{3116.8188,-2054.5698,3.5096},
{3125.7852,-1768.5270,3.5096},
{3345.8813,-1770.8011,5.4053},
{3477.7815,-1811.6428,3.4826},
{3620.3569,-1988.3201,5.6010},
{3517.7246,-2004.3265,3.4800},
{3508.9717,-2166.2795,3.4780},
{3501.0178,-2393.7158,3.4574},
{3406.2468,-2494.4087,3.4574},
{3310.3005,-2359.6292,3.4574},
{3118.5750,-2352.3428,3.4574},
{3124.1780,-2053.6074,3.4574}
};
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/partida", true) == 0)
{
if(IsPlayerAdmin(playerid))
{
for(new i = 0; i < GetMaxPlayers(); i++)
{
if(IsPlayerConnected(i))
{
SetPlayerRaceCheckpoint(i, 0, Checkpoints[1][1], Checkpoints[1][2], Checkpoints[1][3], Checkpoints[2][1], Checkpoints[2][2], Checkpoints[2][3], 10);
Stats[i] = 1;
return 1;
}
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "Apenas Para Admins");
}
}
public OnPlayerEnterCheckpoint(playerid)
{
switch(Stats[playerid])
{
case 1:
{
DisablePlayerRaceCheckpoint(playerid);
SetPlayerRaceCheckpoint(playerid, 0, Checkpoints[2][1], Checkpoints[2][2], Checkpoints[2][3], Checkpoints[3][1], Checkpoints[3][2], Checkpoints[3][3], 10);
Stats[i] = 2;
return 1;
}
case 2:
{
DisablePlayerRaceCheckpoint(playerid);
SetPlayerRaceCheckpoint(playerid, 0, Checkpoints[3][1], Checkpoints[3][2], Checkpoints[3][3], Checkpoints[4][1], Checkpoints[4][2], Checkpoints[4][3], 10);
Stats[i] = 3;
return 1;
}
case 3:
{
DisablePlayerRaceCheckpoint(playerid);
SetPlayerRaceCheckpoint(playerid, 1, Checkpoints[4][1], Checkpoints[4][2], Checkpoints[4][3], Checkpoints[4][1], Checkpoints[4][2], Checkpoints[4][3]-5, 10);
Stats[i] = 4;
return 1;
}
case 4:
{
DisablePlayerRaceCheckpoint(playerid);
GameTextForPlayer(playerid, "~b~Voce ~y~ganhou ~w~a ~r~corrida~w~, e ~g~ganhou $10000 ~w~por isso!", 3000, 1);
GivePlayerMoney(playerid, 10000);
return 1;
}
}
new Stats[MAX_PLAYERS];
new CheckPoints[12][3] = //4 = 4 coordenadas | 3 = 3 "valores" (X,Y,Z)
{
{3116.8188,-2054.5698,3.5096},
{3125.7852,-1768.5270,3.5096},
{3345.8813,-1770.8011,5.4053},
{3477.7815,-1811.6428,3.4826},
{3620.3569,-1988.3201,5.6010},
{3517.7246,-2004.3265,3.4800},
{3508.9717,-2166.2795,3.4780},
{3501.0178,-2393.7158,3.4574},
{3406.2468,-2494.4087,3.4574},
{3310.3005,-2359.6292,3.4574},
{3118.5750,-2352.3428,3.4574},
{3124.1780,-2053.6074,3.4574}
};
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/partida", true) == 0)
{
if(IsPlayerAdmin(playerid))
{
for(new i = 0; i < GetMaxPlayers(); i++)
{
if(IsPlayerConnected(i))
{
SetPlayerRaceCheckpoint(i, 0, Checkpoints[1][1], Checkpoints[1][2], Checkpoints[1][3], Checkpoints[2][1], Checkpoints[2][2], Checkpoints[2][3], 10);
Stats[i] = 1;
return 1;
}
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "Apenas Para Admins");
}
}
public OnPlayerEnterCheckpoint(playerid)
{
switch(Stats[playerid])
{
case 1:
{
DisablePlayerRaceCheckpoint(playerid);
SetPlayerRaceCheckpoint(playerid, 0, Checkpoints[2][1], Checkpoints[2][2], Checkpoints[2][3], Checkpoints[3][1], Checkpoints[3][2], Checkpoints[3][3], 10);
Stats[i] = 2;
return 1;
}
case 2:
{
DisablePlayerRaceCheckpoint(playerid);
SetPlayerRaceCheckpoint(playerid, 0, Checkpoints[3][1], Checkpoints[3][2], Checkpoints[3][3], Checkpoints[4][1], Checkpoints[4][2], Checkpoints[4][3], 10);
Stats[i] = 3;
return 1;
}
case 3:
{
DisablePlayerRaceCheckpoint(playerid);
SetPlayerRaceCheckpoint(playerid, 1, Checkpoints[4][1], Checkpoints[4][2], Checkpoints[4][3], Checkpoints[4][1], Checkpoints[4][2], Checkpoints[4][3]-5, 10);
Stats[i] = 4;
return 1;
}
case 4:
{
DisablePlayerRaceCheckpoint(playerid);
GameTextForPlayer(playerid, "~b~Voce ~y~ganhou ~w~a ~r~corrida~w~, e ~g~ganhou $10000 ~w~por isso!", 3000, 1);
GivePlayerMoney(playerid, 10000);
return 1;
}
}