gate fix
#9

Try this but change the end cords!! And post any errors warnings! Its not tested!


forward GateCheck(); // add this at rhe top of the script...
new gate; // add this at rhe top of the script...

SetTimer("GateCheck", 1000, 1 ); // add this in public OnGameModeInit()
gate = CreateObject( 985 , 2494.270751 , 2350.783447 , 10.867918 , 0.000000 , 0.000000 , 0.000000 ); // add this in public OnGameModeInit()


Код:
public GateCheck()
{
  for(new i = 0; i <= MAX_PLAYERS; i++)
  {
  if(IsPlayerConnected(i))
  {
  if(PlayerToPoint(25.0, i,1708.531250, 1616.638062, 10.721598))
  {
  MoveObject(gate,1708.531250, 1616.638062, 10.721598, 4.0); // Chnge the cords to the end position here...
  }
 else
  {
  MoveObject(gate, 2494.270751 , 2350.783447 , 10.867918, 4.0);
  }
  }
  }
  return 1;
}

PlayerToPoint(Float:radius, playerid, Float:X, Float:Y, Float:Z)
{
  for(new i = 0; i <= MAX_PLAYERS; i++)
  {
  if(IsPlayerConnected(i))
  {
  #pragma unused playerid
  new Float:oldpos[3], Float:temppos[3];
  GetPlayerPos(i, oldpos[0], oldpos[1], oldpos[2]);
  temppos[0] = (oldpos[0] -X);
  temppos[1] = (oldpos[1] -Y);
  temppos[2] = (oldpos[2] -Z);
  if(((temppos[0] < radius) && (temppos[0] > -radius)) && ((temppos[1] < radius) && (temppos[1] > -radius)) && ((temppos[2] < radius) && (temppos[2] > -radius)))
  {
  return true;
  }
  }
  }
  return false;
}
Reply


Messages In This Thread
gate fix - by laser50 - 13.05.2009, 06:30
Re: gate fix - by matrix_smq - 13.05.2009, 06:52
Re: gate fix - by Cabby - 13.05.2009, 06:54
Re: gate fix - by laser50 - 13.05.2009, 10:56
Re: gate fix - by Weirdosport - 13.05.2009, 11:05
Re: gate fix - by Cabby - 13.05.2009, 11:07
Re: gate fix - by Dak_Cobain - 13.05.2009, 11:12
Re: gate fix - by laser50 - 13.05.2009, 11:51
Re: gate fix - by robanswe - 13.05.2009, 15:19
Re: gate fix - by Cabby - 13.05.2009, 16:22

Forum Jump:


Users browsing this thread: 1 Guest(s)