repere toi à la phrase "You have joined the race, go to the start!"
c'est bien la phrase qui apparait quand on tape /join, il me semble ?
donc, remplacer ton:
if(Racemode == 3)
{
SetRaceCheckpoint(playerid,LCurrentCheckpoint,LCurrentCheckpoint-1);
CurrentCheckpoint[playerid]=LCurrentCheckpoint;
}
else SetRaceCheckpoint(playerid,0,1);
RaceParticipant[playerid]=1;
CurrentLap[playerid]=0;
SendClientMessage(playerid, COLOR_GREEN, "You have joined the race, go to the start!");
Participants++;
par:
au début de la commmande join:
new PState=GetPlayerState(playerid);
new string[256];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
if(!IsPlayerInAnyVehicle(playerid))
{
SendClientMessage(playerid, COLOR_RED, "Choose a car and type /join to join the race!");
return 1;
}
if(PState != PLAYER_STATE_DRIVER)
{
SendClientMessage(playerid, COLOR_RED, "Choose a car and type /join to join the race!");
return 1;
}
puis plus bas:
if(Racemode == 3)
{
SetRaceCheckpoint(playerid,LCurrentCheckpoint,LCurrentCheckpoint-1);
CurrentCheckpoint[playerid]=LCurrentCheckpoint;
}
else SetRaceCheckpoint(playerid,0,1);
RaceParticipant[playerid]=1;
CurrentLap[playerid]=0;
//SendClientMessage(playerid, COLOR_GREEN, "You have joined the race, go to the start!");
Participants++;
format(string, sizeof(string), "<%s> Join the race", name);
SendClientMessageToAll(COLOR_YELLOW, string);
new target;
SetVehiclePos(GetPlayerVehicleID(playerid), RaceCheckpoints[target][0],RaceCheckpoints[target][1],RaceCheckpoints[target][2]); // téléporte le véhicule avec le joueur
par contre, tu vas devoir maintenant jouer avec les:
RaceParticipant[playerid]=3; // (values: 0 - not in race, 1 - joined, 2 - arrived to start CP, 3 - /ready, 4 - racing, 5 - Last CP)
ReadyRefresh();