[Tutorial] How to make a moving gate on command
#9

gates donґt seem to work, i keep getting errorґs
I have no idea where to put
Код:
public CheckGate()
{
  new c_gate_status;
  for(new i;i<MAX_PLAYERS;i++)
  {
    if(!IsPlayerConnected(i)) continue;
    /* You would only use this if you're using SA-MP v0.2x or lower
    if(PlayerToPoint(10.0, i, closed_X, closed_Y, closed_Z))c_gate_status = 1;
    */
    if(IsPlayerInRangeOfPoint(i,10.0,closed_X,closed_Y,closed_Z))c_gate_status = 1;
  }
  if(c_gate_status)MoveObject(c_gate, open_X, open_Y, open_Z,Moving Speed);
  else MoveObject(c_gate, closed_X, closed_Y, closed_Z,Moving Speed);
}
and
Код:
PlayerToPoint(Float:radius, playerid, Float:X, Float:Y, Float:Z)
{
  new Float:oldpos[3], Float:temppos[3];
  GetPlayerPos(playerid, 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

Forum Jump:


Users browsing this thread: 1 Guest(s)