02.07.2011, 04:11
Try this:
How to use:
PHP код:
stock GetCenterPoint(Float:Pos1, Float:Pos2)
{
new Float:dist;
if(Pos1 > Pos2) { dist = Pos1+((Pos1-Pos2)/2); }
else { dist = Pos2+((Pos2-Pos1)/2); }
return dist;
}
PHP код:
public OnPlayerDeath(playerid, killerid, reason)
{
new Float:F[3], Float:FF[3];
GetPlayerPos(playerid, F[0], F[1], F[2]);
GetPlayerPos(killerid, FF[0], FF[1], FF[2]);
new Float:X = GetCenterPoint(F[0], FF[0]);
new Float:Y = GetCenterPoint(F[1], FF[1]);
printf("Medium point: %f X & %f Y", X, Y);
return 1;
}