Hallo nochmal,
Also ich habe ein kleines Video vorbereitet um euch zu zeigen was genau mein Problem ist:
Also WIe man jetzt sooo schön gesehen hat, "blinkt" der Tacho. Lustig
Wenn ich den Tacho wieder rausnehme klappt alles einwandfrei. Genau so ist das auch mit der Uhrzeit (nehm ich die Uhrzeit raus, klappt alles)
Mein zweites (nicht ganz so großes Problem ist die KM/h anzeige Achtet mal f´drauf. Da schaff ich es tatsächlich mit dem Fahrrad auf 180 Sachen zu kommen
Hab hier mal meine beiden Scriptschnipsel:
public OnPlayerConnect(playerid)
{
clock();
return 1;
}
forward clock();
public clock()
{
new Text:Clock;
new hour,minute;
new string[10];
gettime(hour,minute);
format(string, sizeof string, "%s%d:%s%d", (hour < 10) ? ("0") : (""), hour, (minute < 10) ? ("0") : (""), minute);
TextDrawHideForAll(Clock);
Clock = TextDrawCreate( 546.0, 24.0, string);
TextDrawLetterSize(Clock, 0.6, 1.8);
TextDrawFont(Clock, 3); // Uhrschrift
TextDrawSetOutline(Clock, 2);
TextDrawShowForAll(Clock);
SetTimer("clock", 1000, 0);
return 1;
}
(UHR)
if(newstate == PLAYER_STATE_ONFOOT)
{
TextDrawHideForPlayer(playerid, Speed[playerid][Speedom]);
}
if(newstate == PLAYER_STATE_DRIVER)
{
new vehicle = GetPlayerVehicleID(playerid);
new VehicleModel = GetVehicleModel(GetPlayerVehicleID(playerid));
if( VehicleModel == 509 || VehicleModel == 481 || VehicleModel == 510 )
{
TogglePlayerControllable(playerid, true);
Vehicle[vehicle][Engine] = 1;
Motor[vehicle] = true;
} else if(Vehicle[vehicle][Engine] == 0)
{
GetVehicleParamsEx(vehicle,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vehicle,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
GameTextForPlayer(playerid,"~r~Benutze '~w~/motor~w~'",4000,3);
Motor[vehicle] = false;
SetTimerEx("VehicleCheckStatus",1000,true,"i",playerid);
}
}
public Speedometer(playerid)
{
new State = GetPlayerState(playerid);
if(State == PLAYER_STATE_DRIVER && IsPlayerInAnyVehicle(playerid))
{
if(Speed[playerid][ShowSpeed] == 1)
{
#define MULTIPLY_SPEED 4
new vehicleid = GetPlayerVehicleID(playerid);
new VehicleModel = GetVehicleModel(vehicleid);
new Float:x, Float:y, Float:z, Float:health, string[256];
GetPlayerPos(playerid, x, y, z); GetVehicleHealth(vehicleid, health);
new Float:Dis = floatsqroot(floatpower(floatabs(floatsub(Speed[playerid][OldCoordsX],x)),2) + floatpower(floatabs(floatsub(Speed[playerid][OldCoordsY],y)),2));
if(Vehicle[vehicleid][Fuel] <= 0){ RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, COLOR_YELLOW, "[FUEL]: There is no fuel in the vehicle."); }
if(VehicleModel==509||VehicleModel==481||VehicleModel==510) { SetVehicleHealth(GetPlayerVehicleID(playerid), 1000); Vehicle[vehicleid][Fuel] = 100; }
if(VehicleModel==520||VehicleModel==476||VehicleModel==593||VehicleModel==553||VehicleModel==513||VehicleModel==512||VehicleModel==577||VehicleModel==592||VehicleModel==511||VehicleModel==539||VehicleModel==464||VehicleModel==519) { Vehicle[vehicleid][Fuel] = 100; }
new speed = (floatround(Dis)*MULTIPLY_SPEED);
new Sspeed[15];
if( speed == 0) {
format(Sspeed,sizeof(Sspeed),"~G~%dm/h",(floatround(Dis)*MULTIPLY_SPEED));
} else if( speed >= 1 && speed <= 65 ){
format(Sspeed,sizeof(Sspeed),"~G~%dm/h",(floatround(Dis)*MULTIPLY_SPEED));
Vehicle[vehicleid][Fuel] -= 0.01;
} else if( speed >= 66 && speed <= 120 ){
format(Sspeed,sizeof(Sspeed),"~Y~%dm/h",(floatround(Dis)*MULTIPLY_SPEED));
Vehicle[vehicleid][Fuel] -= 0.02;
} else {
format(Sspeed,sizeof(Sspeed),"~R~%dm/h",(floatround(Dis)*MULTIPLY_SPEED));
Vehicle[vehicleid][Fuel] -= 0.03;
}
format(string,sizeof(string),"~B~Vehicle:~n~~w~%s~n~~B~Speed: %s~n~~B~Fuel: ~W~%.1f~n~~B~Health: ~W~%.1f~n~~B~Location:~n~~w~%s" ,VehiclesName[GetVehicleModel(vehicleid)-400], Sspeed, Vehicle[vehicleid][Fuel], health/10, ReturnPlayerZone(playerid));
TextDrawSetString(Speed[playerid][Speedom], string);
TextDrawShowForPlayer(playerid, Speed[playerid][Speedom]);
Speed[playerid][OldCoordsX] = x; Speed[playerid][OldCoordsY] = y;
} else { TextDrawHideForPlayer(playerid, Speed[playerid][Speedom]); }
}
return true;
}
Ich glaube das wars alles
Video füge ich später ein = Upload läuft noch