Is player on the marker or something like this help !! :((
#1

Hello, i have a problem cos' I want to make a command like /enter to the 24/7, and I made that command but I can even type /enter when I am inside Police Department How can I do something like is player on icon, I heard about something like if player to point but I don't know how it works So I want this command to work only on the specific position, otherwise I want it to show a message you are not near 24/7 ! or something like this Please help me, thx
Reply
#2

* BUMP * Please anybody I am sure you know how to do this maybe a proper code to if player to point or something ?? please
Reply
#3

On top:
pawn Код:
forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
In the bottom:
pawn Код:
public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
{
  if(IsPlayerConnected(playerid)) {
    new Float:oldposx, Float:oldposy, Float:oldposz, 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;
  }
}
And to check if someone is close to a certain XYZ:
pawn Код:
if PlayerToPoint(playerid,2432.5648,2453.5468,5.234,10) { SendClientMessage(playerid,0xffffffff,"You are in a 10 cordinates distance from 2432.5648,2453.5468,5.234"); }
so just put your marker's XYZ instead of the XYZ I wrote

Hope it helped you
Reply
#4

Thanks yes you were helpfull ) Thank you
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)