Random checkpoint help
#1

I'm trying to make a new FS for garbage truck driving and it works fine but now since i added random checkpoints instead of going to 1 checkpoint to complete the mission the checkpoints are not showing up.


Whats the problem?

Here is the command to start my mission:

Код:
if (strcmp("/garbage", cmdtext, true, 10) == 0) {
    if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 455) {
      if (truckjobrunning >=1) {
        SendClientMessage(playerid,COLOR_RED,"You are already doing the truck driving Mission!");
				return 1;
			}
      truckjobrunning = 1;
			new rand = random(sizeof(checkpoints));
			SetPlayerCheckpoint(playerid,checkpoints[rand][0],checkpoints[rand][1],checkpoints[rand][2],checkpoints[rand][3]);
      GameTextForPlayer(playerid, "~g~You started the job, good luck!", 3000, 3);
      new name[MAX_PLAYER_NAME], string[48];
      GetPlayerName(playerid, name, sizeof(name));
      format(string, sizeof(string), "%s is now doing the Truck mission.", name );
      SendClientMessageToAll(COLOR_RED, string);
      return 1;
    }
    SendClientMessage(playerid, COLOR_RED,"You have to be in a truck to start the job");
    return 1;
  }
Here are my checkpoints:

Код:
new Float: checkpoints[][5] =
{
  { 2798.1702,-1576.2926,10.9272 },
  { 2060.4375,-2091.2126,13.5469 },
  { 070.8125,-2384.6160,13.5469 },
  { 900.7358,-1204.0779,16.9832 },
  { 800.1103,-1542.8258,13.5526 }
};

The checkpoints simply won't show up. They show as a red dot on the minimap, but the checkpoint is not visible.
Reply
#2

(playerid,Float,Float:y,Float:z,Floatize)

there you go
Reply
#3

Quote:
Originally Posted by ⒮⒠⒱⒠⒩⒮⒯⒜⒭
(playerid,Float,Float:y,Float:z,Floatize)

there you go

Thanks for the reply, But i do not understand, can you explain a little bit?
Reply
#4

Sure, this is how it should be
pawn Код:
new Float: checkpoints[5][4] =
{
  { 2798.1702,-1576.2926,10.9272, 10.0 },
  { 2060.4375,-2091.2126,13.5469, 10.0 },
  { 070.8125,-2384.6160,13.5469, 10.0 },
  { 900.7358,-1204.0779,16.9832, 10.0 },
  { 800.1103,-1542.8258,13.5526, 10.0 }
};
10.0 is the size of your checkpoint, in your case it was nothing
Reply
#5

Thanks a lot man.
Reply


Forum Jump:


Users browsing this thread: