Hi, undzwar zeigt mein speedometer immer 0 an...
new Text:speedometer[MAX_PLAYERS];
forward Speed();
public OnGameModeInit()
{
SetTimer("Speed",1000,true); // Speedometer Timer
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
speedometer[playerid] = TextDrawCreate(320,400," ");
TextDrawAlignment(speedometer[playerid],2);
TextDrawSetShadow(speedometer[playerid],1);
TextDrawShowForPlayer(playerid,speedometer[playerid]);
return 1;
}
public Speed()
{
for (new i;i < MAX_PLAYERS;i++)
{
new Float:X,Float:Y,Float:Z,Float:Speed1,Speed2,string[128];
GetVehicleVelocity(GetPlayerVehicleID(i),X,Y,Z);
Speed1 = floatsqroot(((X*X)+(Y*Y))+(Z*Z))*136.666667;
Speed2 = floatround(Speed1,floatround_floor);
format(string,sizeof(string),"Speed: %d",Speed2);
TextDrawSetString(speedometer[i],string);
}
}