SA-MP Forums Archive
Checkpoints - 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: Checkpoints (/showthread.php?tid=22411)



Checkpoints - GregJ - 14.01.2008

I need help cos on wiki it only said on player spawn but what i wants:

- if playertopoint they can do /race (at arena or simila)
- setcheckpoint an when they get there anoter chekpoint another and so on
- plese help

thanks you.


Re: Checkpoints - mamorunl - 14.01.2008

Look at the natives in Pawno.. SetPlayerRaceCheckpoint, SetPlayerCheckpoint SetPlayerPos etc.. try it out


Re: Checkpoints - GregJ - 14.01.2008

Yes but how i do onplayerenter how i make new chekpoin?


Re: Checkpoints - eldiablo1337 - 14.01.2008

new CheckPoint[5]; // 5 checkpoints, can change to more / less

Then, when ever you want to set first check point, do

CheckPoint[0] = SetPlayerCheckPoint(...); // or set race check point

Then,

public OnPlayerEnterCheckpoint(playerid) // or enter race check point
{
if(IsPlayerInCheckPoint(playerid) == CheckPoint[0])
{
CheckPoint[1] = SetPlayerCheckPoint(...);
}
if(IsPlayerInCheckPoint(playerid == CheckPoint[1)
{
Check point 2 = set check point number 3
}
and so on..
}


Re: Checkpoints - GregJ - 15.01.2008

Strange what id o wrong?

At top I have
Код:
new Checkpoint1;
new Checkpoint2;
CommandText
Код:
if (strcmp("/race", cmdtext, true, 10) == 0)
	{
 Checkpoint1 = SetPlayerRaceCheckpoint(-1033.811401,-492.316864,32.007812); // or set race check point
	}
I tired onplayerentercheckpoint but dont work
so rtied racecheckpoint but no work still
Код:
if(IsPlayerInCheckpoint(playerid) == Checkpoint1)
  {
    Checkpoint2 = SetPlayerRaceCheckpoint(-1082.870483,-561.313903,32.615226);
		GameTextForPlayer(COLOR_RED, "1/2 checkpoints done");
  }
  if(IsPlayerInCheckpoint(playerid) == Checkpoint2)
  {
    GameTextForPlayer(COLOR_RED, "2/2 checkpoints done");
  }
Please helps thanks you


Re: Checkpoints - mamorunl - 19.05.2009

If you want to LEARN it, you should look up 'cases' (from the switch) and Arrays.

if you just want to copy it, you can modify Seif's code to your likings.