#1

hi all, i have some problem with "yrace"; when a player type /join i would well like what him and her car are in the good position of the start of the race and the cars are lined up according to the number of participant.

I have some idea but it do not work


Код:
dcmd_join(playerid,params[])
{
  new Float:nx, Float:tx, Float:ny, Float:ty ;
  new Float:NormeAB;
  new Float:Angle;

  tx = RaceCheckpoints[0][0]; // X CP of start (target)
  ty = RaceCheckpoints[0][1]; // Y CP of start (target)
  nx = RaceCheckpoints[1][0]; // X first CP (next)
  ny = RaceCheckpoints[1][1]; // Y first CP (next)

			
  NormeAB = floatsqroot ((nx-tx)*(nx-tx) + (ny-ty)*(ny-ty));

			
  SetVehicleZAngle (Angle = asin ((ny-ty)/NormeAB));

			
  if (tx > nx)
  {
  Angle = 180.0 - Angle;
  }

			
  Angle = Angle - 90.0;
  TogglePlayerControllable(playerid, 0);
	if(RaceBuilders[playerid] != 0)
	{
	  SendClientMessage(playerid, COLOR_YELLOW, "You are currently building a race, can't join. Use /clearrace to exit build mode.");
	  return 1;
	} . . .
and :

Код:
#define DECALAGE_X 2
  #define DECALAGE_Y 2
  #define DECALAGE_Z 2
   new participants;
Код:
Participants++;
  SetPlayerPos(playerid,RaceCheckpoints[0][0]+participants*DECALAGE_X,RaceCheckpoints[0][1]+participants*DECALAGE_Y,RaceCheckpoints[0][2]+participants*DECALAGE_Z);
sorry for my bad english , i'm french :S
tk for your help
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)