isplayerinrangeofpoint - 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 (
/showthread.php?tid=158557)
isplayerinrangeofpoint -
Matthew_Johnston - 10.07.2010
Hay Mates.
Just a Quick Question, How would I Go about using "isplayerinrangeofpoint" For an Interior, /enter isnt ABSOLUTELY Neccesary, But Would i use
public isplayerinrangeofpoint ?
Or like
/enter
}
isplayerinrangeofpoint(aHDAHVSHDBASD)
(AFFECT)
Or What? Just a Quick awsnser is needed to get me started, Oh and please Try not to use DCMD, I Dont wanna learn that shit :P
Re: isplayerinrangeofpoint -
Mystique - 10.07.2010
Код:
if(strcmp(cmdtext, "/enter", true) ==0)
{
if(IsPlayerInRangeOfPoint(playerid, range, x,y,z))
{
Teleports etc.
}
return 1;
}
Re: isplayerinrangeofpoint -
Calgon - 10.07.2010
You need to capitalize it correctly, please refer to the wiki for the correct parameters for the actual function, instead of wasting your time and posting a thread.
https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint
As you see, it shows a pretty useful example, it's used in conjunction with SendClientMessage. Using the example command, you could add some code to set the player's position to somewhere else, i.e: to enter a building.
Re: isplayerinrangeofpoint -
Cameltoe - 10.07.2010
I prefer the IsPlayerInRange but that's up to each person.
Re: isplayerinrangeofpoint -
Calgon - 10.07.2010
Quote:
Originally Posted by Cameltoe
I prefer the IsPlayerInRange but that's up to each person.
|
He's not writing a command to compare the distance between players, he's writing a command to compare the distance between a position and the player. IsPlayerInRange isn't a native, either.
Re: isplayerinrangeofpoint -
Cameltoe - 10.07.2010
I just mentioned it
maybe he wants to check it out.
Anyway IsPlayerInRange isn't between players, it's almost the same as IsPlayerInRangeOfPoint only shorter and with more options
pawn Код:
IsPlayerInRange
Returns 1 if if they are, 0 if they aren't
Parameters:
(playerid, Float: Range, Float: Z_Range, Float:tar_x, Float:tar_y, Float:tar_z)
playerid The playerid you want to query
Float:Range The range the player can be in
Float:Z_Range The height range the player can be in
Float:tar_x The x value for the point
Float:tar_y The y value for the point
Float:tar_z The z value for the point
Returns 1 if they are in the range, 0 if they aren't
IsPlayerInRange(2, 2.0, 2.0, 4.0, 4.0, 4.0);