[HELP] 1 question - player speed
#2

pawn Код:
stock GetPlayerSpeed(playerid)
{
  new Float:PlayerPos[4];
  if(IsPlayerInAnyVehicle(playerid))
  {
    GetVehicleVelocity(GetPlayerVehicleID(playerid), PlayerPos[0], PlayerPos[1], PlayerPos[2]);
  }
  else
  {
    GetPlayerVelocity(playerid, PlayerPos[0], PlayerPos[1], PlayerPos[2]);
  }
  PlayerPos[3] = floatsqroot(floatpower(floatabs(PlayerPos[0]), 2.0) + floatpower(floatabs(PlayerPos[1]), 2.0) + floatpower(floatabs(PlayerPos[2]), 2.0)) * 253.3;
  return floatround(PlayerPos[3], float_round);
}
Usage:

pawn Код:
if(GetPlayerSpeed(playerid) == 30) return SendClientMessage(playerid, 0xffffffff, "You are going at a speed of 30....");
Reply


Messages In This Thread
[HELP] 1 question - player speed - by ben1 - 24.12.2009, 20:50
Re: [HELP] 1 question - player speed - by [HiC]TheKiller - 24.12.2009, 22:22
Re: [HELP] 1 question - player speed - by ben1 - 25.12.2009, 21:00
Re: [HELP] 1 question - player speed - by ben1 - 27.12.2009, 18:41
Re: [HELP] 1 question - player speed - by [HiC]TheKiller - 28.12.2009, 21:10
Re: [HELP] 1 question - player speed - by ben1 - 28.12.2009, 21:13
Re: [HELP] 1 question - player speed - by Dark_Kostas - 28.12.2009, 21:29
Re: [HELP] 1 question - player speed - by ben1 - 28.12.2009, 22:00
Re: [HELP] 1 question - player speed - by Blantas - 28.12.2009, 22:05

Forum Jump:


Users browsing this thread: 1 Guest(s)