SA-MP Forums Archive
Checkpoint - 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)
+--- Thread: Checkpoint (/showthread.php?tid=574937)



Checkpoint - dundolina - 22.05.2015

How to make the checkpoint to be in the air? I add but he is on the ground. Or how i can make it to be from the ground to air?


Re: Checkpoint - Evocator - 22.05.2015

Its a Race Checkpoint.

https://sampwiki.blast.hk/wiki/SetPlayerRaceCheckpoint
https://sampwiki.blast.hk/wiki/DisablePlayerCheckpoint
https://sampwiki.blast.hk/wiki/OnPlayerEnterRaceCheckpoint
https://sampwiki.blast.hk/wiki/IsPlayerInRaceCheckpoint

And i recommend streamer.


Re: Checkpoint - dundolina - 22.05.2015

I dont understand nothing. Can you make it for me, it's a job checkpoints.

Код:
#define pilotCheckPoint1 1468.6799,1585.4291,49.1005
#define pilotCheckPoint2 1141.6888,1558.6499,101.9031
#define pilotCheckPoint3 939.1237,1835.2043,52.7981
#define pilotCheckPoint4 1160.9729,2221.1306,61.2828
#define pilotCheckPoint5 1575.9364,2270.8740,73.6554
#define pilotCheckPoint6 1874.6361,2180.3340,87.7429
#define pilotCheckPoint7 1953.6245,1433.3972,53.9461
#define pilotTakePoint 1480.4420,1223.4127,11.7393



Re: Checkpoint - Sawalha - 22.05.2015

you just follow the function parameters explained in the page
pawn Код:
SetPlayerRaceCheckpoint(playerid, 3, 1468.6799,1585.4291,49.1005, 1141.6888,1558.6499,101.9031, 2.0);
this is a checkpoint where it's type is 3 (Air normal type) placed on the coordinate of definition "pilotCheckPoint1"
the next coordinates are the position where the arrow will face (which is usually supposed to be the next checkpoint, "pilotCheckPoint2")
2.0 is the diameter value (size of the checkpoint)


Re: Checkpoint - dundolina - 22.05.2015

I fly thru the checkpoint and the checkpoint is still there and nothing happend..

Код:
#define pilotCheckPoint1 1468.6799,1585.4291,49.1005
#define pilotCheckPoint2 1141.6888,1558.6499,101.9031
#define pilotCheckPoint3 939.1237,1835.2043,52.7981
#define pilotCheckPoint4 1160.9729,2221.1306,61.2828
#define pilotCheckPoint5 1575.9364,2270.8740,73.6554
#define pilotCheckPoint6 1874.6361,2180.3340,87.7429
#define pilotCheckPoint7 1953.6245,1433.3972,53.9461
#define pilotTakePoint 1480.4420,1223.4127,11.7393



if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 513)
   {
     if (IsPlayerInRangeOfPoint(playerid, 7.0,pilotCheckPoint1))
     {
          SetPlayerRaceCheckpoint(playerid, 3, 1468.6799,1585.4291,49.1005, 1141.6888,1558.6499,101.9031, 5.0);
  	 }
     if (IsPlayerInRangeOfPoint(playerid, 7.0,pilotCheckPoint2))
     {
          SetPlayerRaceCheckpoint(playerid, 3, 1141.6888,1558.6499,101.9031, 939.1237,1835.2043,52.7981, 5.0);
  	 }
     if (IsPlayerInRangeOfPoint(playerid, 7.0,pilotCheckPoint3))
     {
          SetPlayerRaceCheckpoint(playerid, 3, 939.1237,1835.2043,52.7981, 1160.9729,2221.1306,61.2828, 5.0);
  	 }
     if (IsPlayerInRangeOfPoint(playerid, 7.0,pilotCheckPoint4))
     {
          SetPlayerRaceCheckpoint(playerid, 3, 1160.9729,2221.1306,61.2828, 1575.9364,2270.8740,73.6554, 5.0);
  	 }
     if (IsPlayerInRangeOfPoint(playerid, 7.0,pilotCheckPoint5))
     {
          SetPlayerRaceCheckpoint(playerid, 3, 1575.9364,2270.8740,73.6554, 1874.6361,2180.3340,87.7429, 5.0);
     }
     if (IsPlayerInRangeOfPoint(playerid, 7.0,pilotCheckPoint6))
     {
          SetPlayerRaceCheckpoint(playerid, 3, 1874.6361,2180.3340,87.7429, 1953.6245,1433.3972,53.9461, 5.0);
     }
     if (IsPlayerInRangeOfPoint(playerid, 7.0,pilotCheckPoint7))
     {
          SetPlayerRaceCheckpoint(playerid, 3, 1953.6245,1433.3972,53.9461, 1480.4420,1223.4127,11.7393, 5.0);
     }
     if (IsPlayerInRangeOfPoint(playerid, 7.0,pilotTakePoint))
     {
         SendClientMessage(playerid,COLOR_YELLOW,"Ти завърши работата като пилот и получи $7000 и 3 EP!");
         GivePlayerMoney(playerid, 7000);
         PlayerInfo[playerid][pPilot1] = 1;
         PlayerInfo[playerid][Exp]+= 3;
         SetPlayerVirtualWorld(playerid, 0);
         	     if(PlayerInfo[playerid][pDonateRank] == 4 || PlayerInfo[playerid][pTimeVip] == 1)
    	{
         SendClientMessage(playerid,COLOR_YELLOW,"VIP LEVEL 4 + 1EP.");
         PlayerInfo[playerid][Exp]+= 1;
         }
         	     if(PlayerInfo[playerid][pDonateRank] == 5 || PlayerInfo[playerid][pTimeVip] == 1)
    	{
         SendClientMessage(playerid,COLOR_YELLOW,"VIP LEVEL 5 + 2EP.");
         PlayerInfo[playerid][Exp]+= 2;
         }
         	     if(PlayerInfo[playerid][pDonateRank] >= 6 || PlayerInfo[playerid][pTimeVip] == 1)
    	{
          SendClientMessage(playerid,COLOR_YELLOW,"VIP LEVEL 6 + 3EP.");
         PlayerInfo[playerid][Exp]+= 3;
         }
                  	     if(PlayerInfo[playerid][pDonateRank] == 7 || PlayerInfo[playerid][pTimeVip] == 1)
    	{
          SendClientMessage(playerid,COLOR_YELLOW,"VIP LEVEL 7 + 4EP.");
         PlayerInfo[playerid][Exp]+= 4;
         }
	     if(PlayerInfo[playerid][pDonateRank] <= 3 || PlayerInfo[playerid][pTimeVip] == 1)
    	{
 	     PlayerInfo[playerid][pPilot] = 60*60;
      }
	     if(PlayerInfo[playerid][pDonateRank] == 4 || PlayerInfo[playerid][pTimeVip] == 1)
    	{
 	     PlayerInfo[playerid][pPilot] = 30*60;
      }
      	     if(PlayerInfo[playerid][pDonateRank] == 5 || PlayerInfo[playerid][pTimeVip] == 1)
    	{
 	     PlayerInfo[playerid][pPilot] = 30*60;
      }
      	     if(PlayerInfo[playerid][pDonateRank] >= 6 || PlayerInfo[playerid][pTimeVip] == 1)
    	{
 	     PlayerInfo[playerid][pPilot] = 20*60;
      }
            	     if(PlayerInfo[playerid][pDonateRank] == 7 || PlayerInfo[playerid][pTimeVip] == 1)
    	{
 	     PlayerInfo[playerid][pPilot] = 10*60;
      }
         SetPlayerColor(playerid, TeamInfo[PlayerInfo[playerid][pMember]][TeamColor]);
         RemovePlayerFromVehicle(playerid);
         DisablePlayerCheckpoint(playerid);
         SetPlayerVirtualWorld(playerid, 0);
         pilot[playerid] = 0;
         }
	 }



Re: Checkpoint - PowerPC603 - 22.05.2015

Use https://sampwiki.blast.hk/wiki/OnPlayerEnterRaceCheckpoint instead of checking distances to a checkpoint.
Otherwise your timer must be very fast to check for a distance of 7 meters.
Using a plane, you fly much too fast to be able to check if you're in range.

On one timer-iteration, you may be 9 meters in front of it.
The next iteration, you may find yourself 10 meters behind it.

It will rarely trigger.

Use the callbacks, they exist for a reason.