Is player on the marker or something like this help !! :(( - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Is player on the marker or something like this help !! :(( (
/showthread.php?tid=75144)
Is player on the marker or something like this help !! :(( -
*BueNoOo* - 29.04.2009
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
Re: Is player on the marker or something like this help !! :(( -
*BueNoOo* - 29.04.2009
* BUMP * Please anybody

I am sure you know how to do this

maybe a proper code to if player to point or something ?? please
Re: Is player on the marker or something like this help !! :(( -
OmeRinG - 29.04.2009
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
Re: Is player on the marker or something like this help !! :(( -
*BueNoOo* - 29.04.2009
Thanks yes you were helpfull

) Thank you