Why i can't go to the next checkpoint
#1

Код:
#include <a_samp>
#include <zcmd>
#include <sscanf>

#define COLOR_ORANGE 0xFFA54F
#define COLOR_RED 0xCD3333

forward OnPlayerConnect(playerid);

public OnPlayerConnect(playerid)
{
  new Checkpoint[MAX_PLAYERS], bool:CoalJob[MAX_PLAYERS];
  Checkpoint[playerid] = 0, CoalJob[playerid] = false;
}

CMD:coalmine(playerid, params[])
{
  new bool:CoalJob[MAX_PLAYERS];
  new Vehicle = GetPlayerVehicleID(playerid);
  if(GetVehicleModel(Vehicle) == 573)
  {
  SendClientMessage(playerid, COLOR_ORANGE, "Go to all checkppoints.");
  SetPlayerRaceCheckpoint(playerid, 0, 817.1170,845.0590,10.4850, 765.4453,885.4069,-1.2558, 3);
  CoalJob[playerid] = true;
  }
  else
  {
  SendClientMessage(playerid, COLOR_RED, "You are not in a truck");
}
  return 1;
}

forward OnPlayerEnterCheckpoint(playerid);

public OnPlayerEnterCheckpoint(playerid)
{
  new Checkpoint[MAX_PLAYERS];
  new bool:CoalJob[MAX_PLAYERS];
  if(CoalJob[playerid] == true)
  switch(Checkpoint[playerid])
  {
  case 0:
  {
  SendClientMessage(playerid, COLOR_ORANGE, "Ти мина през парвия чекпойнт отиди при другия");
  Checkpoint[playerid] ++;
  SetPlayerRaceCheckpoint(playerid, 0, 765.4453,885.4069,-1.2558, 690.2831,979.4869,-12.7432, 3 );
  }
  case 1:
  {
  SendClientMessage(playerid, COLOR_ORANGE, "Ти мина през парвия чекпойнт отиди при другия");
  Checkpoint[playerid] ++;
  SetPlayerRaceCheckpoint(playerid, 0, 690.2831,979.4869,-12.7432, 731.7955,882.9299,-26.4920, 3);
  }
  case 2:
  {
  SendClientMessage(playerid, COLOR_ORANGE, "Ти мина през парвия чекпойнт отиди при другия");
  Checkpoint[playerid] ++;
  SetPlayerRaceCheckpoint(playerid, 0, 731.7955,882.9299,-26.4920, 628.5996,922.4578,-41.0336, 3);
  }
  case 3:
  {
  SendClientMessage(playerid, COLOR_ORANGE, "Ти мина през парвия чекпойнт отиди при другия");
  Checkpoint[playerid] ++;
  SetPlayerRaceCheckpoint(playerid, 0, 628.5996,922.4578,-41.0336, 521.0988,906.9174,-41.5109, 3);
  }
  case 4:
  {
  SendClientMessage(playerid, COLOR_ORANGE, "Ти мина през парвия чекпойнт отиди при другия");
  Checkpoint[playerid] ++;
  SetPlayerRaceCheckpoint(playerid, 0, 521.0988,906.9174,-41.5109, 765.4453,885.4069,-1.2558, 3);
  }
  case 5:
  {
  SendClientMessage(playerid, COLOR_ORANGE, "Ти мина през парвия чекпойнт отиди при другия");
  Checkpoint[playerid] ++;
  SetPlayerRaceCheckpoint(playerid, 0, 817.1170, 845.0590, 10.4850, 817.1170,845.0590,10.4850, 3);
  }
  case 6:
  {
  SendClientMessage(playerid, COLOR_ORANGE, "Ти мина през всияки чекпойнтове и взе 10000");
  GivePlayerMoney(playerid, 10000);
  SetPlayerCheckpoint(playerid, 817.1170,845.0590,10.4850, 3);
  CoalJob[playerid] = false;
  DisablePlayerCheckpoint(playerid);
  }
  }
  }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)