How to make this
#2

Under OnPlayerCommandText:
pawn Код:
if (strcmp("/yourcommand", cmdtext, true) == 0)
{
if(PlayerToPoint(RADIUS, playerid, X, Y, Z))
{
// Do the thing that should be done
}
else
{
// Here if player aint on market
}
return 1;
}
End of code:
pawn Код:
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;
}
In the first code, replace RADIUS, X, Y and Z
Reply


Messages In This Thread
How to make this - by TehNobody - 28.05.2009, 12:59
Re: How to make this - by Gozerr - 28.05.2009, 13:17
Re: How to make this - by TehNobody - 28.05.2009, 13:20
Re: How to make this - by lol2112 - 28.05.2009, 13:22
Re: How to make this - by TehNobody - 28.05.2009, 13:24
Re: How to make this - by lol2112 - 28.05.2009, 13:28

Forum Jump:


Users browsing this thread: 1 Guest(s)