SA-MP Forums Archive
Checkpoint ID - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Checkpoint ID (/showthread.php?tid=88879)



Checkpoint ID - JadedJ - 29.07.2009

How do I Identify checkpoints so that the OnPlayerEnterCheckpoint callback does'nt trigger them all?


Re: Checkpoint ID - Geekzor - 29.07.2009

i dont know what do u mean with this but please explain a bit more...


Re: Checkpoint ID - JadedJ - 29.07.2009

This is part of a drag racing filterscript I made it compiles but when I use it in my gamemode I encounter a bug. When I do a race (other than drag race) as soon as I enter a race checkpoint all my race checkpoints are disabled and I get 2 client messages WINNER and LOSER

Код:
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;
}