Hi ich habe mich an einem Tacho versucht der folgende funktionen hat; ModelID,Zustand,KMH
Ich habe ein Prob mit der Abfrage des Zustands habs so gemacht aber es steht da ca 1.0000000
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
{
Textdraw0 = TextDrawCreate(618.000000, 346.000000, "_");
TextDrawBackgroundColor(Textdraw0, 255);
TextDrawFont(Textdraw0, 1);
TextDrawLetterSize(Textdraw0, 0.539999, 1.000000);
TextDrawColor(Textdraw0, -1);
TextDrawSetOutline(Textdraw0, 0);
TextDrawSetProportional(Textdraw0, 0);
TextDrawSetShadow(Textdraw0, 1);
TextDrawUseBox(Textdraw0, 1);
TextDrawBoxColor(Textdraw0, 170);
TextDrawTextSize(Textdraw0, 467.000000, 0.000000);
TextDrawSetSelectable(Textdraw0, 0);
Textdraw1 = TextDrawCreate(618.000000, 378.000000, "_");
TextDrawBackgroundColor(Textdraw1, 255);
TextDrawFont(Textdraw1, 1);
TextDrawLetterSize(Textdraw1, 0.539999, 1.000000);
TextDrawColor(Textdraw1, -1);
TextDrawSetOutline(Textdraw1, 0);
TextDrawSetProportional(Textdraw1, 0);
TextDrawSetShadow(Textdraw1, 1);
TextDrawUseBox(Textdraw1, 1);
TextDrawBoxColor(Textdraw1, 170);
TextDrawTextSize(Textdraw1, 467.000000, 2.000000);
TextDrawSetSelectable(Textdraw1, 0);
Textdraw2 = TextDrawCreate(618.000000, 362.000000, "_");
TextDrawBackgroundColor(Textdraw2, 255);
TextDrawFont(Textdraw2, 1);
TextDrawLetterSize(Textdraw2, 0.539999, 1.000000);
TextDrawColor(Textdraw2, -1);
TextDrawSetOutline(Textdraw2, 0);
TextDrawSetProportional(Textdraw2, 0);
TextDrawSetShadow(Textdraw2, 1);
TextDrawUseBox(Textdraw2, 1);
TextDrawBoxColor(Textdraw2, 170);
TextDrawTextSize(Textdraw2, 467.000000, 0.000000);
TextDrawSetSelectable(Textdraw2, 0);
Textdraw4 = TextDrawCreate(470.000000, 361.000000, "Km/h:");
TextDrawBackgroundColor(Textdraw4, 255);
TextDrawFont(Textdraw4, 1);
TextDrawLetterSize(Textdraw4, 0.500000, 1.000000);
TextDrawColor(Textdraw4, -1);
TextDrawSetOutline(Textdraw4, 0);
TextDrawSetProportional(Textdraw4, 1);
TextDrawSetShadow(Textdraw4, 1);
TextDrawSetSelectable(Textdraw4, 0);
new Float:health,string[128],vehicleid;
vehicleid=GetPlayerVehicleID(playerid);
health=GetVehicleHealth(vehicleid,health);
format(string,sizeof(string),"Zustand: %0f%",health);
Textdraw5 = TextDrawCreate(470.000000, 377.000000, string);
TextDrawBackgroundColor(Textdraw5, 255);
TextDrawFont(Textdraw5, 1);
TextDrawLetterSize(Textdraw5, 0.500000, 1.000000);
TextDrawColor(Textdraw5, -1);
TextDrawSetOutline(Textdraw5, 0);
TextDrawSetProportional(Textdraw5, 1);
TextDrawSetShadow(Textdraw5, 1);
TextDrawSetSelectable(Textdraw5, 0);
TextDrawShowForPlayer(playerid, Textdraw0);
TextDrawShowForPlayer(playerid, Textdraw1);
TextDrawShowForPlayer(playerid, Textdraw2);
TextDrawShowForPlayer(playerid, Textdraw4);
TextDrawShowForPlayer(playerid, Textdraw5);
}
if(newstate == PLAYER_STATE_ONFOOT)
{
TextDrawHideForAll(Textdraw0);
TextDrawDestroy(Textdraw0);
TextDrawHideForAll(Textdraw1);
TextDrawDestroy(Textdraw1);
TextDrawHideForAll(Textdraw2);
TextDrawDestroy(Textdraw2);
TextDrawHideForAll(Textdraw4);
TextDrawDestroy(Textdraw4);
TextDrawHideForAll(Textdraw5);
TextDrawDestroy(Textdraw5);
}
return 1;
}