PlayerToPoint Help
#4

pawn Код:
if (strcmp("/buyc4", cmdtext, true) == 0)
{
  if(PlayerToPoint(1.0,playerid,-2044.0804,149.9467,28.8359))
  {
    if (C4BUY[playerid]) return SendClientMessage(playerid, 0xFF0000AA, "You already have C4");
    else
    {
      C4BUY[playerid] = 1;
      return SendClientMessage(playerid, 0xFF0000AA, "You have purchased C4");
    }
  }
  SendClientMessage(playerid, 0xFF0000AA, "You are not at the right location to purchase C4");
  return 1;
}

PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
{
  if(IsPlayerConnected(playerid))
  {
    new Float:oldposx, Float:oldposy, Float:oldposz;
    new Float:tempposx, Float:tempposy, Float:tempposz;
    GetPlayerPos(playerid, oldposx, oldposy, oldposz);
    tempposx = (oldposx -x);
    tempposy = (oldposy -y);
    tempposz = (oldposz -z);
    if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
    {
      return 1;
    }
  }
  return 0;
}
There should be nothing wrong with that. Also, you don't need 5 lines to tell me that I forgot to scroll down.

And there is no need to make PlayerToPoint a public function.
Reply


Messages In This Thread
PlayerToPoint Help - by JoeDaDude - 15.06.2009, 10:17
Re: PlayerToPoint Help - by Blacklite - 15.06.2009, 10:36
Re: PlayerToPoint Help - by JoeDaDude - 15.06.2009, 10:39
Re: PlayerToPoint Help - by Blacklite - 15.06.2009, 20:51

Forum Jump:


Users browsing this thread: 1 Guest(s)