PlayerToPlayerDistance
#1

Hello everyone,

I wanted to make up a function with which i can calculate distance between two Players? Like there is a SAMP function Called GetPlayerDistanceFromPoint but its for getting distance from a point to the playerid but not between two players?

If you have function which has that , callback , include , FS or anything which can do it. Please post it over here. Or if you can make me a stock or a custom function for that , will be fucking awesome!

Thanks
Ballu Miaa
Reply
#2

PS :
I think there is no given function to get the Distance between two player's at the moment? or is it?
If not someone please code me a custom function/stock if you can! Thanks alot
Reply
#3

pawn Код:
stock IsPlayerNearPlayer(playerid,nearplayerid,Float:distance)
{
    new Float:x,Float:y,Float:z;
    GetPlayerPos(nearplayerid,x,y,z);
    return IsPlayerInRangeOfPoint(playerid,distance,x,y,z);
}
stock Float:GetPlayerDistanceToPlayer(playerid,nearplayerid)
{
    new Float:x,Float:y,Float:z;
    GetPlayerPos(nearplayerid,x,y,z);
    return GetPlayerDistanceFromPoint(playerid,x,y,z);
}
Reply
#4

Quote:
Originally Posted by Joe Staff
Посмотреть сообщение
pawn Код:
stock IsPlayerNearPlayer(playerid,nearplayerid,Float:distance)
{
    new Float:x,Float:y,Float:z;
    GetPlayerPos(nearplayerid,x,y,z);
    return IsPlayerInRangeOfPoint(playerid,distance,x,y,z);
}
stock Float:GetPlayerDistanceToPlayer(playerid,nearplayerid)
{
    new Float:x,Float:y,Float:z;
    GetPlayerPos(nearplayerid,x,y,z);
    return GetPlayerDistanceFromPoint(playerid,x,y,z);
}
Awesome! Thanks alot. Im sure it will work!
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)