Arrest command issues
#6

Quote:
Originally Posted by DarkLored
Посмотреть сообщение
Here is the call back that i am using for it and sorry for late reply i was sleeping at the time

pawn Код:
public Float:GetDistanceBetweenPlayers(p1,p2)
{
   new Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2;
   if (!IsPlayerConnected(p1) || !IsPlayerConnected(p2)){
   return -1.00;
}
   GetPlayerPos(p1,x1,y1,z1);
   GetPlayerPos(p2,x2,y2,z2);
   return floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));

}
I have created this simple function, this is easier than the one you have, I have created this function when I was developing my own CnR server but I lost interest but I still have the script in case someone needs some snippet.

pawn Код:
GetDistanceBetweenPlayers(playerid, otherid, Float:dist)
{
    new
        Float:Pos[3]
    ;
    if( IsPlayerConnected( targetid ) && IsPlayerConnected( otherid ) )
    {
        GetPlayerPos( otherid, Pos[ 0 ], Pos[ 1 ], Pos[ 2 ] );
        IsPlayerInRangeOfPoint( playerid, dist, Pos[ 0 ], Pos[ 1 ], Pos[ 2 ] );
        return true;
    }
    return false;
}
pawn Код:
if( !GetDistanceBetweenPlayers(playerid, otherid, Float:dist) ) //if the player is not near.
if( GetDistanceBetweenPlayers(playerid, otherid, Float:dist) ) //if the player is near.
Reply


Messages In This Thread
Arrest command issues - by DarkLored - 14.03.2014, 03:18
Re: Arrest command issues - by CuervO - 14.03.2014, 03:42
Re: Arrest command issues - by Ceathor - 14.03.2014, 06:32
Re: Arrest command issues - by mahardika - 14.03.2014, 06:55
Re: Arrest command issues - by DarkLored - 14.03.2014, 22:38
Re: Arrest command issues - by Patrick - 14.03.2014, 22:47
Re: Arrest command issues - by DarkLored - 14.03.2014, 22:53
Re: Arrest command issues - by DarkLored - 14.03.2014, 23:18
Re: Arrest command issues - by DarkLored - 15.03.2014, 01:20
Re: Arrest command issues - by CuervO - 15.03.2014, 01:35
Re: Arrest command issues - by DarkLored - 15.03.2014, 01:38
Re: Arrest command issues - by Ceathor - 15.03.2014, 02:15
Re: Arrest command issues - by DarkLored - 15.03.2014, 02:45

Forum Jump:


Users browsing this thread: 2 Guest(s)