GetPlayerVelocity

GetPlayerVelocity

Description:
Function GetPlayerVelocity get the velocity (speed) of a player on the X, Y and Z axes.
Function GetPlayerVelocity was added in 0.3a and will not work in earlier versions!


Parameters:
(playerid, Float:X, Float:Y, Float:Z)
int playerid The player to get the speed from.
float X A float variable in which to store the velocity on the X axis, passed by reference.
float Y A float variable in which to store the velocity on the Y axis, passed by reference.
float Z A float variable in which to store the velocity on the Z axis, passed by reference.


Return Values:
The function itself doesn't return a specific value. The X, Y and Z velocities are stored in the specified variables.


Examples:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (!strcmp("/velocity", cmdtext))
    {
        new Float:Velocity[3], string[80];
	GetPlayerVelocity(playerid, Velocity[0], Velocity[1], Velocity[2]);
        format(string, sizeof(string), "You are going at a velocity of X: %f, Y: %f, Z: %f", Velocity[0], Velocity[1], Velocity[2]);
        SendClientMessage(playerid, 0xFFFFFFFF, string);
	return 1;
    }
}


Related Functions
The following functions may be useful, as they are related to this function in one way or another.