Pickup + Textdraw
#1

how to make when player stands on/near pickup, textdraw is shown. when he goes away, textdraw will disappear.
Reply
#2

Use PlayerToPoint

pawn Код:
stock PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
{
  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;
}
Example:

pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
  if(PlayerToPoint(Float:radi, i, Float:x, Float:y, Float:z)//Change Radi to the radius away from the pickup and x, y and Z as the pickup co-ordonates!
  {
    //Show the Textdraw. Although a Gametext would be easier.

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)