Checkpoints
#1

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.
Reply
#2

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

Yes but how i do onplayerenter how i make new chekpoin?
Reply
#4

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..
}
Reply
#5

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
Reply
#6

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)