Getting a Center point from 2 Co-ordinates
#5

Try this:

PHP код:
stock GetCenterPoint(Float:Pos1Float:Pos2)
{
    new 
Float:dist;
    if(
Pos1 Pos2) { dist Pos1+((Pos1-Pos2)/2); }
    else { 
dist Pos2+((Pos2-Pos1)/2); }
    return 
dist;

How to use:

PHP код:
public OnPlayerDeath(playeridkilleridreason)
{
    new 
Float:F[3], Float:FF[3];
    
GetPlayerPos(playeridF[0], F[1], F[2]);
    
GetPlayerPos(killeridFF[0], FF[1], FF[2]);
    new 
Float:GetCenterPoint(F[0], FF[0]);
    new 
Float:GetCenterPoint(F[1], FF[1]);
    
printf("Medium point: %f X & %f Y"XY);
    return 
1;

Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)