04.01.2017, 13:17
I really don't know how velocity works but I use this on my server to get the speed and players complained that the speedo is showing too much, example when Landstalker goes reverse the speed increase up to 55 very fast.
If you drive a glendale straight you reach 160 and on some roads 200.
Sultan goes 200+, those are the vehicles I tested.
If you drive a glendale straight you reach 160 and on some roads 200.
Sultan goes 200+, those are the vehicles I tested.
Код:
public Speedometer(playerid) { for(new i = 0; i < MAX_PLAYERS; i++) { new vehicleid,Float:speed_x,Float:speed_y,Float:speed_z,Float:final_speed,speed_string[16],final_speed_int; vehicleid = GetPlayerVehicleID(i); //new Float:vehicle_health,final_vehicle_health,health_string[256]; if(IsPlayerConnected(i) && IsPlayerInAnyVehicle(i)) { GetVehicleVelocity(vehicleid,speed_x,speed_y,speed_z); final_speed = floatsqroot(((speed_x*speed_x)+(speed_y*speed_y))+(speed_z*speed_z))*250.666667; // 250.666667 = kmph // 199,4166672= mph final_speed_int = floatround(final_speed,floatround_round); format(speed_string,256,"%i",final_speed_int); TextDrawSetString(speedo0[i], speed_string); } } return 1; }