GetVehicleVelocity problem
#1

So.. I want to make an automatic speedtrap system.
This is the code from my speedo
pawn Код:
new String[128];
new Float:X, Float:Y, Float:Z, Float:Speed;
new vehicle = GetPlayerVehicleID(i);
GetVehicleVelocity(GetPlayerVehicleID(i), X, Y, Z);
Speed = floatmul(floatsqroot(floatadd(floatadd(floatpower(X, 2), floatpower(Y, 2)),  floatpower(Z, 2))), 230);
format(String,sizeof(String),"~b~ D-Board~n~~r~Fuel: ~w~%i~n~~r~km/h: ~w~%i", Gas[vehicle], floatround(Speed, floatround_floor));
And this is the speedtrap system. I setted it to sent cops a message but the speed is always 0.

pawn Код:
new carid = GetPlayerVehicleID(playerid);
new Float:X, Float:Y, Float:Z, Float:viteza;
new vehicle = GetPlayerVehicleID(carid);
GetVehicleVelocity(GetPlayerVehicleID(carid), X, Y, Z);
viteza = floatmul(floatsqroot(floatadd(floatadd(floatpower(X, 2), floatpower(Y, 2)),  floatpower(Z, 2))), 230);
format(str,sizeof(str), "[RADAR] Car bla bla with speed %d!",viteza);//here the speed is 0
SendClientMessage(i, TEAM_BLUE_COLOR, str);
Reply


Messages In This Thread
GetVehicleVelocity problem - by pantelimonfl - 12.02.2011, 07:54
Re: GetVehicleVelocity problem - by pantelimonfl - 12.02.2011, 12:22
Re: GetVehicleVelocity problem - by Vince - 12.02.2011, 12:28
Re: GetVehicleVelocity problem - by pantelimonfl - 12.02.2011, 12:46
AW: Re: GetVehicleVelocity problem - by Nero_3D - 12.02.2011, 13:33
Re: GetVehicleVelocity problem - by pantelimonfl - 12.02.2011, 16:28
Re: GetVehicleVelocity problem - by pantelimonfl - 12.02.2011, 17:13
Re: GetVehicleVelocity problem - by pantelimonfl - 13.02.2011, 14:43
AW: GetVehicleVelocity problem - by Nero_3D - 13.02.2011, 15:17
Re: GetVehicleVelocity problem - by pantelimonfl - 13.02.2011, 18:45

Forum Jump:


Users browsing this thread: 2 Guest(s)