GetPlayerSpeed, No timers-Player Speed instantly
#1

Finally the Velocity functions are here.

Код:
stock GetPlayerSpeed(playerid,bool:kmh) // by misco
{
  new Float:Vx,Float:Vy,Float:Vz,Float:rtn;
  if(IsPlayerInAnyVehicle(playerid)) GetVehicleVelocity(GetPlayerVehicleID(playerid),Vx,Vy,Vz); else GetPlayerVelocity(playerid,Vx,Vy,Vz);
  rtn = floatsqroot(floatabs(floatpower(Vx + Vy + Vz,2)));
  return kmh?floatround(rtn * 100 * 1.61):floatround(rtn * 100);
}
(edited)
Example usage:
Код:
if (!strcmp("/myspeed", cmdtext, true))
	{
		new str[128];
		format(str,128,"My speed is %d km/h and %d mph !",GetPlayerSpeed(playerid,true),GetPlayerSpeed(playerid,false));
		SendClientMessage(playerid,0xFFFFFFAA,str);
		return 1;
	}
Returned values seems real.
Reply


Messages In This Thread
GetPlayerSpeed, No timers-Player Speed instantly - by misco - 02.09.2009, 20:12
Re: GetPlayerSpeed, No timers-Player Speed instantly - by [HUN]Gamestar - 02.09.2009, 20:19
Re: GetPlayerSpeed, No timers-Player Speed instantly - by Double-O-Seven - 02.09.2009, 20:35
Re: GetPlayerSpeed, No timers-Player Speed instantly - by [NL]Bank - 02.09.2009, 20:37
Re: GetPlayerSpeed, No timers-Player Speed instantly - by Fireburn - 02.09.2009, 20:38
Re: GetPlayerSpeed, No timers-Player Speed instantly - by Rac3r - 02.09.2009, 20:39
Re: GetPlayerSpeed, No timers-Player Speed instantly - by ғαιιοцт - 02.09.2009, 20:39
Re: GetPlayerSpeed, No timers-Player Speed instantly - by Rac3r - 02.09.2009, 20:42
Re: GetPlayerSpeed, No timers-Player Speed instantly - by JaTochNietDan - 02.09.2009, 20:44
Re: GetPlayerSpeed, No timers-Player Speed instantly - by Jay_ - 02.09.2009, 20:56
Re: GetPlayerSpeed, No timers-Player Speed instantly - by misco - 02.09.2009, 21:08
Re: GetPlayerSpeed, No timers-Player Speed instantly - by Double-O-Seven - 03.09.2009, 14:32
Re: GetPlayerSpeed, No timers-Player Speed instantly - by Rainmaker - 03.09.2009, 14:34
Re: GetPlayerSpeed, No timers-Player Speed instantly - by Double-O-Seven - 03.09.2009, 14:38
Re: GetPlayerSpeed, No timers-Player Speed instantly - by Harry_Gaill - 03.09.2009, 15:18
Re: GetPlayerSpeed, No timers-Player Speed instantly - by Westie - 03.09.2009, 15:23
Re: GetPlayerSpeed, No timers-Player Speed instantly - by Harry_Gaill - 03.09.2009, 15:29
Re: GetPlayerSpeed, No timers-Player Speed instantly - by Zeex - 03.09.2009, 18:26
Re: GetPlayerSpeed, No timers-Player Speed instantly - by Rainmaker - 03.09.2009, 18:37
Re: GetPlayerSpeed, No timers-Player Speed instantly - by Zeex - 03.09.2009, 18:41
Re: GetPlayerSpeed, No timers-Player Speed instantly - by BeckzyBoi - 04.09.2009, 13:57
Re: GetPlayerSpeed, No timers-Player Speed instantly - by Gamer_Z - 04.09.2009, 16:11
Re: GetPlayerSpeed, No timers-Player Speed instantly - by misco - 04.09.2009, 22:54
Re: GetPlayerSpeed, No timers-Player Speed instantly - by Zeex - 04.09.2009, 23:06
Re: GetPlayerSpeed, No timers-Player Speed instantly - by NeedAName - 05.09.2009, 00:37
Re: GetPlayerSpeed, No timers-Player Speed instantly - by Norn - 05.09.2009, 04:15
Re: GetPlayerSpeed, No timers-Player Speed instantly - by misco - 05.09.2009, 08:04
Re: GetPlayerSpeed, No timers-Player Speed instantly - by lavamike - 05.09.2009, 11:06
Re: GetPlayerSpeed, No timers-Player Speed instantly - by papagei9 - 06.09.2009, 08:13
Re: GetPlayerSpeed, No timers-Player Speed instantly - by Frankylez - 06.09.2009, 08:36
Re: GetPlayerSpeed, No timers-Player Speed instantly - by wofka13 - 02.06.2010, 20:21
Re: GetPlayerSpeed, No timers-Player Speed instantly - by IcyBlight - 04.06.2010, 10:45

Forum Jump:


Users browsing this thread: 1 Guest(s)