Posts: 1,290
Threads: 69
Joined: Dec 2006
Reputation:
0
Why use floatpower? Just multiply it by itself.
Posts: 1,047
Threads: 23
Joined: Jun 2009
why use GetPlayerVehicleID(playerid)... if the player is in a vehicle the player and vehicle are both moving lol....
btw will this work?:
pawn Код:
floatsqroot(Vx*Vx + Vy*Vy + Vz*Vz);
stock GetPlayerSpeed(playerid,bool:kmh) // by misco edit by gamer_z
{
new Float:Vx,Float:Vy,Float:Vz,Float:rtn;
GetPlayerVelocity(playerid,Vx,Vy,Vz);
rtn = floatsqroot(Vx*Vx + Vy*Vy + Vz*Vz);
return kmh?floatround(rtn * 100 * 1.61):floatround(rtn * 100);
}
i read everyones post and combined with mine idea lol..
Posts: 12
Threads: 1
Joined: Aug 2006
Reputation:
0
i have edited it last time. if you have better solution about this speed calculation be free and share it
Omg... Square of sum is not the same as sum of squares.
Posts: 2,265
Threads: 80
Joined: Jul 2008
Reputation:
0
I'm using it for a speedo, but if i drive down the road full speed then turn left it goes back to like 20mph lol.
Posts: 12
Threads: 1
Joined: Aug 2006
Reputation:
0
Was an previous speedo better(or accurate) ?
Posts: 41
Threads: 3
Joined: Apr 2008
Reputation:
0
Hm.. GetPlayerSpeed doesn't work for me. It returns everytime 0
Posts: 138
Threads: 23
Joined: Feb 2010
Reputation:
0
Bump.
I used this, and when I turn at some places, my speed increases unrealisticly much.
Like from 60 to 100 in a second.
It seems to be when turning north and when turning south, but I'm not sure.