Das Slot geht um ein Tacho.
enum OldSpeedoPos
{
Float:sX,
Float:sY,
Float:sZ
}
new SavePlayerPos[SLOTS][OldSpeedoPos];
for(new i=0; i<SLOTS; i++)
{
box = TextDrawCreate(500.000000,372.000000,"_");
TextDrawUseBox(box,1);
TextDrawBoxColor(box,0x00000066);
TextDrawTextSize(box,610.000000,80.000000);
// TextDrawAlignment(box,0);
TextDrawBackgroundColor(box,0x00000033);
TextDrawFont(box,3);
TextDrawLetterSize(box,1.000000,4.000000);
TextDrawColor(box,0xffffffff);
//TextDrawSetOutline(box,1);
//TextDrawSetProportional(box,1);
// TextDrawSetShadow(box,1);
kmh = TextDrawCreate(500.000000,380.000000," ");
TextDrawAlignment(kmh,0);
TextDrawBackgroundColor(kmh,0x000000ff);
TextDrawFont(kmh,1);
TextDrawLetterSize(kmh,0.20, 0.85);
TextDrawColor(kmh,0xffffffff);
TextDrawSetOutline(kmh,1);
TextDrawSetProportional(kmh,1);
TextDrawSetShadow(kmh,1);
hoehe = TextDrawCreate(500.000000,392.000000," ");
TextDrawAlignment(hoehe,0);
TextDrawBackgroundColor(hoehe,0x000000ff);
TextDrawFont(hoehe,1);
TextDrawLetterSize(hoehe,0.20, 0.85);
TextDrawColor(hoehe,0xffffffff);
TextDrawSetOutline(hoehe,1);
TextDrawSetProportional(hoehe,1);
TextDrawSetShadow(hoehe,1);
zustand = TextDrawCreate(500.000000,400.000000," ");
TextDrawAlignment(zustand,0);
TextDrawBackgroundColor(zustand,0x000000ff);
TextDrawFont(zustand,1);
TextDrawLetterSize(zustand,0.20, 0.85);
TextDrawColor(zustand,0xffffffff);
TextDrawSetOutline(zustand,1);
TextDrawSetProportional(zustand,1);
TextDrawSetShadow(zustand,1);
}
new Float:Speedo_X,Float:Speedo_Y,Float:Speedo_Z;
new Float:Speedo_HP;
for(new i=0; i<SLOTS; i++)
{
if(IsPlayerConnected(i) && IsPlayerInAnyVehicle(i) && !IsANoTachoVehicle(GetPlayerVehicleID(i)))
{
GetPlayerPos(i, Speedo_X, Speedo_Y, Speedo_Z);
GetPlayerVehicleID(i);
GetVehicleHealth(GetPlayerVehicleID(i), Speedo_HP);
new str2[256],str3[256],str4[256];
if(SpeedoON == 0)
{
TextDrawShowForPlayer(i, box); TextDrawShowForPlayer(i, kmh);
TextDrawShowForPlayer(i, hoehe); TextDrawShowForPlayer(i, zustand);
SpeedoON = 1;
}
new Float:speed_x,Float:speed_y,Float:speed_z,Float:final_speed,final_speed_int;
new veh = GetPlayerVehicleID(i);
GetVehicleVelocity(veh, speed_x, speed_y, speed_z);
final_speed = floatsqroot(((speed_x*speed_x)+(speed_y*speed_y))+(speed_z*speed_z))*120.0; // 136.666667 = kmph // 85.4166672= mph
final_speed_int = floatround(final_speed,floatround_round);
new kmh_anzahl = final_speed_int;
if(kmh_anzahl >= 150)
{
format(str2,sizeof(str2),"~y~KM/H: ~w~%d",kmh_anzahl);
TextDrawSetString(kmh, str2);
}
else if(kmh_anzahl >= 100)
{
format(str2,sizeof(str2),"~y~KM/H: ~w~%d",kmh_anzahl);
TextDrawSetString(kmh, str2);
}
else if(kmh_anzahl >= 50)
{
format(str2,sizeof(str2),"~y~KM/H: ~w~%d",kmh_anzahl);
TextDrawSetString(kmh, str2);
}
else
{
format(str2,sizeof(str2),"~y~KM/H: ~w~%d",kmh_anzahl);
TextDrawSetString(kmh, str2);
}
new vehicleid = GetPlayerVehicleID(i);
format(str3,sizeof(str3),"~y~Tank: ~w~%d / %d Liter", Gas[vehicleid],GetGasMax(GetVehicleModel(vehicleid)));
TextDrawSetString(hoehe, str3);
if(Speedo_HP >= 551)
{
format(str4,sizeof(str4),"~y~Zustand: ~w~%.2f", Speedo_HP);
TextDrawSetString(zustand, str4);
}
else if(Speedo_HP >= 361)
{
format(str4,sizeof(str4),"~y~Zustand: ~w~%.2f", Speedo_HP);
TextDrawSetString(zustand, str4);
}
else
{
format(str4,sizeof(str4),"~y~Zustand: ~w~%.2f", Speedo_HP);
TextDrawSetString(zustand, str4);
}
}
SavePlayerPos[sX] = Speedo_X, SavePlayerPos[sY] = Speedo_Y, SavePlayerPos[sZ] = Speedo_Z;
}
for(new i=0; i<SLOTS; i++)
{
if(!IsPlayerInAnyVehicle(i))
{
TextDrawHideForPlayer(i, box); TextDrawHideForPlayer(i, kmh);
TextDrawHideForPlayer(i, hoehe); TextDrawHideForPlayer(i, zustand);
TextDrawShowForPlayer(i, Copyright);
SpeedoON = 0;
}
}
Das sind erstmal die pawn zeilen wo das mit Slots ist.
MFG
TRONIIX