Also
forward Speed(playerid);
public Speed(playerid){
new bool:kk;
new string[256];
if(IsPlayerConnected(playerid) && IsPlayerInAnyVehicle(playerid)){
/*new Float:x,Float:y,Float:z;
new Float: distance,value;
GetPlayerPos(i, x, y, z);
distance = floatsqroot(floatpower(floatabs(floatsub(x,SavePlayerPos[i][LastX])),2)+floatpower(floatabs(floatsub(y,SavePlayerPos[i][LastY])),2)+floatpower(floatabs(floatsub(z,SavePlayerPos[i][LastZ])),2));
value = floatround(distance * 3900); //Hier verändert man die Anzeige vom Tacho. 3900 ist eine realistische Zahl.*/
ErmittleGeschwindigkeit(playerid,bool:kk);
format(string, sizeof(string), "~w~%d Km/h",/*floatround(value/900)*/bool:kk);
TextDrawSetString(Speedometer[playerid], string);
//SavePlayerPos[i][LastX] = x;
//SavePlayerPos[i][LastY] = y;
//SavePlayerPos[i][LastZ] = z;}
}
return true;
}
stock ErmittleGeschwindigkeit(playerid,bool:kmh) {
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 kmh?floatround(rtn * 100 * 1.61):floatround(rtn * 100);
}
Sollte ja eig. funktionieren...
aber es bleibt auf 0...
Ongamemodeinit
for(new playerid=0;playerid<MAX_PLAYERS;playerid++) SetTimerEx("Speed",100,1,"i",playerid);
Was ist falsch..?
mfg.