SA-MP Forums Archive
IsPlayerInRangeOfPoint Problem! - 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: IsPlayerInRangeOfPoint Problem! (/showthread.php?tid=133150)



IsPlayerInRangeOfPoint Problem! - Kyle - 11.03.2010

I have a code, And it detected wheather im on the pipe in area 51 to bug abuse the pipe is in the air a little higher than walking height. But if im on the floor near the pipe it kicks me even though im not on the pipe. How do i do it so if its in that height of the pip and near it?

Here is my code


for(new i = 0; i < MAX_PLAYERS; i++)
{
new Float, Float:y, Float:z;
GetPlayerPos(i,x,y,z);

if(IsPlayerInRangeOfPoint(i, 7.0, 264.1581,1820.8364,9.4387))
{
new oname[30];
new string[156];
GetPlayerName(i,oname,30);
format(string,sizeof(string),"[SERVER] %s(%d) Has Been Kicked! - Bug Abuse!",oname,i);
SendClientMessageToAll(COLOR_ADMIN,string);
Kick(i);
}


Re: IsPlayerInRangeOfPoint Problem! - Chris. - 11.03.2010

Could you possibly do something like this?

pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
    new Float:x, Float:y, Float:z;
    GetPlayerPos(i,x,y,z);
 
    if(IsPlayerInRangeOfPoint(i, 7.0, 264.1581,1820.8364,9.4387))
    {
        if(z>9 && z<10) // or if(z==9.4387) but I'm not completely sure that would work.
        {
            new oname[30];
            new string[156];
            GetPlayerName(i,oname,30);
            format(string,sizeof(string),"[SERVER] %s(%d) Has Been Kicked! - Bug Abuse!",oname,i);
            SendClientMessageToAll(COLOR_ADMIN,string);
            Kick(i);
        }
    }
}



Re: IsPlayerInRangeOfPoint Problem! - MenaceX^ - 11.03.2010

You could use IsPlayerInArea.


Re: IsPlayerInRangeOfPoint Problem! - Deat_Itself - 11.03.2010

Quote:
Originally Posted by MenaceX^
You could use IsPlayerInArea.
yeah but then you should make IsPlayerInArea yourself or find it .As it is not the SAMP native


Re: IsPlayerInRangeOfPoint Problem! - deather - 11.03.2010

IsPlayerInRangeOfPoint will not consider the Z axis. From 0 to infinity the z axis is ignored by that native. So you would have to use IsPlayerInArea


Re: IsPlayerInRangeOfPoint Problem! - MenaceX^ - 11.03.2010

Quote:
Originally Posted by _Saif_
Quote:
Originally Posted by MenaceX^
You could use IsPlayerInArea.
yeah but then you should make IsPlayerInArea yourself or find it .As it is not the SAMP native
So?...


Re: IsPlayerInRangeOfPoint Problem! - Kyle - 11.03.2010

I cant use isplayerinarea as its a problem, If you know the Area-51 Pipe Bug where you jump over it and it teles you to the jetpack bit.




Re: IsPlayerInRangeOfPoint Problem! - shady91 - 11.03.2010

why not just make it set there position somewere instead of kicking them.


Re: IsPlayerInRangeOfPoint Problem! - ¤Adas¤ - 11.03.2010

Quote:
Originally Posted by |)�Ω�{−}�R� � Dare To Die
IsPlayerInRangeOfPoint will not consider the Z axis. From 0 to infinity the z axis is ignored by that native. So you would have to use IsPlayerInArea
You are a lame... It will consider the Z axis!!! Why do you post untested things?