Hallo, und zwar habe ich ein Problem, mir wird nur 0km/h angezeigt
getPlayerSpeed(playerid)
{
new Float:x,Float:y,Float:z, Float:rtn;
if(IsPlayerInAnyVehicle(playerid))
{
GetVehicleVelocity(GetPlayerVehicleID(playerid),x,y,z);
}
else
{
GetPlayerVelocity(playerid,x,y,z);
}
rtn = floatsqroot(x*x + y*y + z*z);
return floatround(rtn * 100 * 1.61);
}
Unter OnPlayerStateChange
if(newstate==PLAYER_STATE_DRIVER)
new string[128];
format(string,sizeof(string),"%i km/h",getPlayerSpeed(playerid));
Textdraw2[playerid] = CreatePlayerTextDraw(playerid, 370.625000, 168.583389, string);
PlayerTextDrawLetterSize(playerid, Textdraw2[playerid], 0.449999, 1.600000);
PlayerTextDrawAlignment(playerid, Textdraw2[playerid], 1);
PlayerTextDrawColor(playerid, Textdraw2[playerid], -1);
PlayerTextDrawSetShadow(playerid, Textdraw2[playerid], 0);
PlayerTextDrawSetOutline(playerid, Textdraw2[playerid], 1);
PlayerTextDrawBackgroundColor(playerid, Textdraw2[playerid], 51);
PlayerTextDrawFont(playerid, Textdraw2[playerid], 1);
PlayerTextDrawSetProportional(playerid, Textdraw2[playerid], 1);
PlayerTextDrawShow(playerid,PlayerText:Textdraw2[playerid]);
Ist jetzt mein erstes Tacho, drum nicht wundern^^