29.07.2009, 11:15
How do I Identify checkpoints so that the OnPlayerEnterCheckpoint callback does'nt trigger them all?
public OnPlayerEnterRaceCheckpoint(playerid) { if(challenger[targetid]!=playerid) { DisablePlayerRaceCheckpoint(playerid); DisablePlayerRaceCheckpoint(challenger[targetid]); GivePlayerMoney(playerid,stakes[targetid]); SendClientMessage(playerid,COLOR_GREEN,"WINNER!!!"); SendClientMessage(challenger[targetid],COLOR_RED,"LOSER!!!!"); challenger[targetid]=0; stakes[targetid]=0; return 1; } if(challenger[targetid]==playerid) { DisablePlayerRaceCheckpoint(playerid); DisablePlayerRaceCheckpoint(challenger[playerid]); GivePlayerMoney(playerid,stakes[playerid]); SendClientMessage(playerid,COLOR_GREEN,"WINNER!!!"); SendClientMessage(challenger[playerid],COLOR_RED,"LOSER!!!!"); challenger[playerid]=0; stakes[playerid]=0; return 1; } return 1; }