Hallo Leute,
Ich weiß zwar nicht was die Textdraws gegen mich haben aber es buggt nun wieder ,aber wieder anders.
Nun blinkt es ab und zu mal start mal eher weniger.
Hier ein Kleines Video wo man das Prob sieht
Code:
new vehicleid;
vehicleid = GetPlayerVehicleID(playerid);
if(GetPlayerVehicleSeat(playerid) == 0)
{
if(GetVehicleModel(vehicleid) != 509 && GetVehicleModel(vehicleid) != 481 && GetVehicleModel(vehicleid) != 510)
{
new string[125];
if(Tank[vehicleid] <= 0) format(string,sizeof string,"~g~Tank: ~r~I~r~I~r~I~r~I~r~I~r~I~r~I~r~I~r~I~r~I",Tank[vehicleid]);
else if(Tank[vehicleid] <= 5)
{
format(string,sizeof string,"~w~Tank: ~y~I~r~I~r~I~r~I~r~I~r~I~r~I~r~I~r~I~r~I",Tank[vehicleid]);
PlayerPlaySound(playerid, 1085, 0.0,0.0,0.0);
}
else if(Tank[vehicleid] <= 10)
{
format(string,sizeof string,"~w~Tank: ~g~I~r~I~r~I~r~I~r~I~r~I~r~I~r~I~r~I~r~I",Tank[vehicleid]);
PlayerPlaySound(playerid, 1085, 0.0,0.0,0.0);
}
else if(Tank[vehicleid] <= 15) format(string,sizeof string,"~w~Tank: ~g~I~y~I~r~I~r~I~r~I~r~I~r~I~r~I~r~I~r~I",Tank[vehicleid]);
//Paar zeilen Entfernt
else if(Tank[vehicleid] <= 100) format(string,sizeof string,"~w~Tank: ~g~I~g~I~g~I~g~I~g~I~g~I~g~I~g~I~g~I~g~I",Tank[vehicleid]);
TextDrawSetString(pSpeedo[playerid][2],string);
}
else
{
new string[125], Float:Zustand[MAX_VEHICLES];
GetVehicleZustandProzent(vehicleid);
if(Zustand[vehicleid] <= 0) format(string,sizeof string,"~w~Zustand:~r~I",Zustand[vehicleid]);
else if(Zustand[vehicleid] <= 250)
{
format(string,sizeof string,"~w~Zustand:~r~I",Zustand[vehicleid]);
}
else if(Tank[vehicleid] <= 600) { format(string,sizeof string,"~w~Zustand:~y~I",Zustand[vehicleid]); }
else if(Tank[vehicleid] <= 1000) { format(string,sizeof string,"~w~Zustand:~g~I",Zustand[vehicleid]); }
TextDrawSetString(pSpeedo[playerid][3],string);
}
}
TextDrawSetString(pSpeedo[playerid][3], "~w~Zustand:~g~I");
public OnPlayerConnect(playerid)
{
{
if(pSpeedoOn[playerid] == 0)
{
pSpeedo[playerid][0] = TextDrawCreate(525.000000, 348.800000, "Carname");
TextDrawBackgroundColor(pSpeedo[playerid][0], 255);
TextDrawFont(pSpeedo[playerid][0], 1);
TextDrawLetterSize(pSpeedo[playerid][0], 0.449999, 1.000000);
TextDrawColor(pSpeedo[playerid][0], 0xFFFFFFFF);
TextDrawSetOutline(pSpeedo[playerid][0], 0);
TextDrawSetProportional(pSpeedo[playerid][0], 1);
TextDrawSetShadow(pSpeedo[playerid][0], 1);
TextDrawUseBox(pSpeedo[playerid][0], 1);
TextDrawBoxColor(pSpeedo[playerid][0], 101);
TextDrawTextSize(pSpeedo[playerid][0], 643.000000, -113.000000);
pSpeedo[playerid][1] = TextDrawCreate(525.000000, 361.1000000, "~w~Km/h:");
TextDrawBackgroundColor(pSpeedo[playerid][1], 255);
TextDrawFont(pSpeedo[playerid][1], 1);
TextDrawLetterSize(pSpeedo[playerid][1], 0.449999, 1.000000);
TextDrawColor(pSpeedo[playerid][1], 8913151);
TextDrawSetOutline(pSpeedo[playerid][1], 0);
TextDrawSetProportional(pSpeedo[playerid][1], 1);
TextDrawSetShadow(pSpeedo[playerid][1], 1);
TextDrawUseBox(pSpeedo[playerid][1], 1);
TextDrawBoxColor(pSpeedo[playerid][1], 101);
TextDrawTextSize(pSpeedo[playerid][1], 640.000000, 0.000000);
pSpeedo[playerid][2] = TextDrawCreate(525.000000, 373.4000000, "~w~Tank: ~g~I~g~I~g~I~g~I~g~I~g~I~g~I~g~I~g~I~g~I");
TextDrawBackgroundColor(pSpeedo[playerid][2], 255);
TextDrawFont(pSpeedo[playerid][2], 1);
TextDrawLetterSize(pSpeedo[playerid][2], 0.449999, 1.000000);
TextDrawColor(pSpeedo[playerid][2], 8913151);
TextDrawSetOutline(pSpeedo[playerid][2], 0);
TextDrawSetProportional(pSpeedo[playerid][2], 1);
TextDrawSetShadow(pSpeedo[playerid][2], 1);
TextDrawUseBox(pSpeedo[playerid][2], 1);
TextDrawBoxColor(pSpeedo[playerid][2], 101);
TextDrawTextSize(pSpeedo[playerid][2], 640.000000, 0.000000);
pSpeedo[playerid][3] = TextDrawCreate(525.000000, 385.700000, "~w~Zustand:~r~I");
TextDrawBackgroundColor(pSpeedo[playerid][3], 255);
TextDrawFont(pSpeedo[playerid][3], 1);
TextDrawLetterSize(pSpeedo[playerid][3], 0.450000, 1.000000);
TextDrawColor(pSpeedo[playerid][3], 8913151);
TextDrawSetOutline(pSpeedo[playerid][3], 0);
TextDrawSetProportional(pSpeedo[playerid][3], 1);
TextDrawSetShadow(pSpeedo[playerid][3], 1);
TextDrawUseBox(pSpeedo[playerid][3], 1);
TextDrawBoxColor(pSpeedo[playerid][3], 101);
TextDrawTextSize(pSpeedo[playerid][3], 640.000000, 0.000000);
pSpeedo[playerid][4] = TextDrawCreate(525.000000, 398.000000, "~g~M~w~otor: ~r~I");
TextDrawBackgroundColor(pSpeedo[playerid][4], 255);
TextDrawFont(pSpeedo[playerid][4], 1);
TextDrawLetterSize(pSpeedo[playerid][4], 0.300000, 0.949999);
TextDrawColor(pSpeedo[playerid][4], 8913151);
TextDrawSetOutline(pSpeedo[playerid][4], 0);
TextDrawSetProportional(pSpeedo[playerid][4], 1);
TextDrawSetShadow(pSpeedo[playerid][4], 1);
TextDrawUseBox(pSpeedo[playerid][4], 1);
TextDrawBoxColor(pSpeedo[playerid][4], 101);
TextDrawTextSize(pSpeedo[playerid][4], 567.000000, 0.000000);
pSpeedo[playerid][5] = TextDrawCreate(569.65000, 398.000000, " ~g~L~w~icht: ~r~I");
TextDrawBackgroundColor(pSpeedo[playerid][5], 255);
TextDrawFont(pSpeedo[playerid][5], 1);
TextDrawLetterSize(pSpeedo[playerid][5], 0.300000, 0.949999);
TextDrawColor(pSpeedo[playerid][5], 8913151);
TextDrawSetOutline(pSpeedo[playerid][5], 0);
TextDrawSetProportional(pSpeedo[playerid][5], 1);
TextDrawSetShadow(pSpeedo[playerid][5], 1);
TextDrawUseBox(pSpeedo[playerid][5], 1);
TextDrawBoxColor(pSpeedo[playerid][5], 101);
TextDrawTextSize(pSpeedo[playerid][5], 640.000000, -10.000000);
pSpeedoOn[playerid] = 1;
}
stock UpdateSpeedo(playerid)
{
if(!IsPlayerInAnyVehicle(playerid))
{
Speedo(playerid,0);
} else if(pSpeedoOn[playerid] == 2){
new veh = GetPlayerVehicleID(playerid);
new model= GetVehicleModel(veh);
new str[60];
new Float:speed;
new vehicleid = GetPlayerVehicleID(playerid);
TextDrawSetString(pSpeedo[playerid][0],CarName[model-400]);
GetVehicleSpeed(vehicleid , speed);
if(model == 509 || model == 510|| model == 481)
{
speed = floatround(speed *0.5);
} else {
speed = floatround(speed * 0.95);
}
format(str,sizeof(str),"~w~Km/H: ~w~%.0f",Float:speed);
TextDrawSetString(pSpeedo[playerid][1],str);
format(str,sizeof(str),"~w~Zustand:");
TextDrawSetString(pSpeedo[playerid][3],str);
}
}
stock Speedo(playerid,speedostate)
{
switch (speedostate)
{
case 0: //aus
{
if(pSpeedoOn[playerid] != 2) {return 0;}
KillTimer(pSpeedoT[playerid]);
for(new i=0;i<6;i++)
{
TextDrawHideForPlayer(playerid,pSpeedo[playerid][i]);
}
pSpeedoOn[playerid] = 1;
}
case 1: // An
{
if(pSpeedoOn[playerid] != 1) {return 0;}
pSpeedoT[playerid] = SetTimerEx("PlayerSpeedo",100,1,"d",playerid);
UpdateSpeedo(playerid);
for(new i=0;i<6;i++)
{
TextDrawShowForPlayer(playerid,pSpeedo[playerid][i]);
}
pSpeedoOn[playerid] = 2;
}
}
return 1;
}
forward PlayerSpeedo(playerid);
public PlayerSpeedo(playerid)
{
if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
if(pSpeedoOn[playerid] == 2)
{
for(new i=0;i<6;i++)
{
TextDrawHideForPlayer(playerid,pSpeedo[playerid][i]);
}
UpdateSpeedo(playerid);
for(new i=0;i<6;i++)
{
TextDrawShowForPlayer(playerid,pSpeedo[playerid][i]);
}
}
} else {
Speedo(playerid,0);
}
}