24.04.2010, 21:22
Bem, eu nгo testei, hoje de manhг andei a procura, e so agora encontrei:
Vamos lб:
Topo do GM:
Agora no OnPlayerCommandText:
No OnPlayerEnterCheckpoint:
__________________________________________________ __________________________________________________ ____________
Crйditos a: pspleo
Topico de origem: http://forum.sa-mp.com/index.php?top...0760#msg340760
PS: Sу postei este Tuto para, claro, vcs saberem como se faz, mas tb para eu n o perder, pois perdi horas a procura dele
Vamos lб:
Topo do GM:
pawn Код:
new Stats[MAX_PLAYERS];
new Float:Checkpoints[4][3] = //4 = 4 coordenadas | 3 = 3 "valores" (X,Y,Z)
{
{X,Y,Z},
{X,Y,Z},
{X,Y,Z},
{X,Y,Z}
};
pawn Код:
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");
}
}
Код:
Checkpoints[1][1] ---> Coordenada 1, valor 1 Checkpoints[1][2] ---> Coordenada 1, valor 2 Checkpoints[1][3] ---> Coordenada 1, valor 3 .....
pawn Код:
{
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, "You have won the race!!", 3000, 1);
GivePlayerMoney(playerid, 10000);
return 1;
}
}
}
Код:
DisablePlayerRaceCheckpoint(playerid); ----> Tira os CP's jб existentes SetPlayerRaceCheckpoint(playerid, 0, Checkpoints[2][1], Checkpoints[2][2], Checkpoints[2][3], Checkpoints[3][1], Checkpoints[3][2], Checkpoints[3][3], 10); Cria um novo CP GameTextForPlayer(playerid, "You have won the race!!", 3000, 1); ---> Indica que o Player Ganhou a corrida
__________________________________________________ __________________________________________________ ____________
Crйditos a: pspleo
Topico de origem: http://forum.sa-mp.com/index.php?top...0760#msg340760
PS: Sу postei este Tuto para, claro, vcs saberem como se faz, mas tb para eu n o perder, pois perdi horas a procura dele