09.11.2011, 18:20
Como Prometido:
Crйditos: [O.z]Caroline
pawn Код:
#include a_samp
new Float:Check[8][3] =
{
{1528.9465,-1390.9324,339.4098},
{1536.5879,-1427.7552,351.7839},
{1580.4338,-1526.8713,367.2534},
{1658.4342,-1572.5601,383.2133},
{1688.0394,-1684.3677,390.6830},
{1290.1179,-1917.1096,324.8062},
{1333.8574,-1817.7743,327.0307},
{1356.3107,-1877.1770,369.6375}
},
aCheckpoint[500],
Corrida[500]
;
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext,"/corrida", true))
{
Corrida[playerid] = 1;
SetPlayerPos(playerid, Check[aCheckpoint[playerid]][0], Check[aCheckpoint[playerid]][1], Check[aCheckpoint[playerid]][2]);
SetPlayerRaceCheckpoint(playerid, 0, Check[aCheckpoint[playerid]][0], Check[aCheckpoint[playerid]][1], Check[aCheckpoint[playerid]][2], Check[aCheckpoint[playerid]+1][0], Check[aCheckpoint[playerid]+1][1], Check[aCheckpoint[playerid]+1][2], 10.0);
return 1;
}
return 0;
}
public OnPlayerEnterRaceCheckpoint(playerid)
{
if(Corrida[playerid] == 1)
{
if(aCheckpoint[playerid] == sizeof(Check)-1)
{
SendClientMessage(playerid, -1," Chegou.");
for(new e, j = GetMaxPlayers(); e != j; ++e)
{
if(IsPlayerConnected(e))
{
if(e != playerid &&
aCheckpoint[e] != 0)
{
SendClientMessage(e, -1, "Perdeu");
aCheckpoint[e] = 0;
}
DisablePlayerRaceCheckpoint(e);
}
}
return 1;
}
DisablePlayerRaceCheckpoint(playerid);
SetPlayerRaceCheckpoint(playerid, 0, Check[aCheckpoint[playerid]][0], Check[aCheckpoint[playerid]][1], Check[aCheckpoint[playerid]][2], Check[aCheckpoint[playerid]+1][0], Check[aCheckpoint[playerid]+1][1], Check[aCheckpoint[playerid]+1][2], 10.0);
aCheckpoint[playerid]++;
}
return 1;
}