
#include <a_samp>

new Text:tcar_StatusHUL[4],
	Text:tcar_StatusENG[4],
	Text:tcar_StatusWHL[4],
	Text:tcar_StatusBAT[4],
	Text:tcar_FuelBackground,
	Text:tcar_Heading,
	PlayerText:tcar_PLAYER_Fuel[MAX_PLAYERS] = PlayerText:-1;

public OnFilterScriptInit()
{
	print("Textdraw file generated by");
	print("    Zamaroht's textdraw editor was loaded.");

	// Create the textdraws
	new dcol[] = {645857408,-2621312,-9830272,-16777088};
	for(new i; i<4; i++)
	{
		tcar_StatusENG[i] = TextDrawCreate(625.000000, 114.000000, "ENG");
		TextDrawAlignment(tcar_StatusENG[i], 2);
		TextDrawBackgroundColor(tcar_StatusENG[i], 255);
		TextDrawFont(tcar_StatusENG[i], 1);
		TextDrawLetterSize(tcar_StatusENG[i], 0.200000, 0.899999);
		TextDrawColor(tcar_StatusENG[i], -128);
		TextDrawSetOutline(tcar_StatusENG[i], 0);
		TextDrawSetProportional(tcar_StatusENG[i], 1);
		TextDrawSetShadow(tcar_StatusENG[i], 1);
		TextDrawUseBox(tcar_StatusENG[i], 1);
		TextDrawBoxColor(tcar_StatusENG[i], dcol[i]);
		TextDrawTextSize(tcar_StatusENG[i], 0.000000, 10.000000);

		tcar_StatusHUL[i] = TextDrawCreate(625.000000, 127.000000, "HUL");
		TextDrawAlignment(tcar_StatusHUL[i], 2);
		TextDrawBackgroundColor(tcar_StatusHUL[i], 255);
		TextDrawFont(tcar_StatusHUL[i], 1);
		TextDrawLetterSize(tcar_StatusHUL[i], 0.200000, 1.000000);
		TextDrawColor(tcar_StatusHUL[i], -128);
		TextDrawSetOutline(tcar_StatusHUL[i], 0);
		TextDrawSetProportional(tcar_StatusHUL[i], 1);
		TextDrawSetShadow(tcar_StatusHUL[i], 1);
		TextDrawUseBox(tcar_StatusHUL[i], 1);
		TextDrawBoxColor(tcar_StatusHUL[i], dcol[i]);
		TextDrawTextSize(tcar_StatusHUL[i], 0.000000, 10.000000);

		tcar_StatusWHL[i] = TextDrawCreate(625.000000, 141.000000, "WHL");
		TextDrawAlignment(tcar_StatusWHL[i], 2);
		TextDrawBackgroundColor(tcar_StatusWHL[i], 255);
		TextDrawFont(tcar_StatusWHL[i], 1);
		TextDrawLetterSize(tcar_StatusWHL[i], 0.200000, 1.000000);
		TextDrawColor(tcar_StatusWHL[i], -128);
		TextDrawSetOutline(tcar_StatusWHL[i], 0);
		TextDrawSetProportional(tcar_StatusWHL[i], 1);
		TextDrawSetShadow(tcar_StatusWHL[i], 1);
		TextDrawUseBox(tcar_StatusWHL[i], 1);
		TextDrawBoxColor(tcar_StatusWHL[i], dcol[i]);
		TextDrawTextSize(tcar_StatusWHL[i], 0.000000, 10.000000);

		tcar_StatusBAT[i] = TextDrawCreate(625.000000, 155.000000, "BAT");
		TextDrawAlignment(tcar_StatusBAT[i], 2);
		TextDrawBackgroundColor(tcar_StatusBAT[i], 255);
		TextDrawFont(tcar_StatusBAT[i], 1);
		TextDrawLetterSize(tcar_StatusBAT[i], 0.200000, 1.000000);
		TextDrawColor(tcar_StatusBAT[i], -128);
		TextDrawSetOutline(tcar_StatusBAT[i], 0);
		TextDrawSetProportional(tcar_StatusBAT[i], 1);
		TextDrawSetShadow(tcar_StatusBAT[i], 1);
		TextDrawUseBox(tcar_StatusBAT[i], 1);
		TextDrawBoxColor(tcar_StatusBAT[i], dcol[i]);
		TextDrawTextSize(tcar_StatusBAT[i], 0.000000, 10.000000);
	}

	tcar_FuelBackground = TextDrawCreate(607.000000, 114.000000, "~w~");
	TextDrawAlignment(tcar_FuelBackground, 2);
	TextDrawBackgroundColor(tcar_FuelBackground, 255);
	TextDrawFont(tcar_FuelBackground, 1);
	TextDrawLetterSize(tcar_FuelBackground, 0.500000, 5.599999);
	TextDrawColor(tcar_FuelBackground, -1);
	TextDrawSetOutline(tcar_FuelBackground, 0);
	TextDrawSetProportional(tcar_FuelBackground, 1);
	TextDrawSetShadow(tcar_FuelBackground, 1);
	TextDrawUseBox(tcar_FuelBackground, 1);
	TextDrawBoxColor(tcar_FuelBackground, -2139062144);
	TextDrawTextSize(tcar_FuelBackground, 0.000000, 11.000000);

	tcar_Heading = TextDrawCreate(615.000000, 100.000000, "Fahrzeug");
	TextDrawAlignment(tcar_Heading, 2);
	TextDrawBackgroundColor(tcar_Heading, 255);
	TextDrawFont(tcar_Heading, 1);
	TextDrawLetterSize(tcar_Heading, 0.220000, 1.000000);
	TextDrawColor(tcar_Heading, -128);
	TextDrawSetOutline(tcar_Heading, 0);
	TextDrawSetProportional(tcar_Heading, 1);
	TextDrawSetShadow(tcar_Heading, 1);

	new playerid;
	tcar_PLAYER_Fuel[playerid] = CreatePlayerTextDraw(playerid, 607.000000, 167.000000, "~f~");
	PlayerTextDrawAlignment(playerid, tcar_PLAYER_Fuel[playerid], 2);
	PlayerTextDrawBackgroundColor(playerid, tcar_PLAYER_Fuel[playerid], 255);
	PlayerTextDrawFont(playerid, tcar_PLAYER_Fuel[playerid], 1);
	PlayerTextDrawLetterSize(playerid, tcar_PLAYER_Fuel[playerid], 0.500000, -6.199999);
	PlayerTextDrawColor(playerid, tcar_PLAYER_Fuel[playerid], -1);
	PlayerTextDrawSetOutline(playerid, tcar_PLAYER_Fuel[playerid], 0);
	PlayerTextDrawSetProportional(playerid, tcar_PLAYER_Fuel[playerid], 1);
	PlayerTextDrawSetShadow(playerid, tcar_PLAYER_Fuel[playerid], 1);
	PlayerTextDrawUseBox(playerid, tcar_PLAYER_Fuel[playerid], 1);
	PlayerTextDrawBoxColor(playerid, tcar_PLAYER_Fuel[playerid], 645857408);
	PlayerTextDrawTextSize(playerid, tcar_PLAYER_Fuel[playerid], 0.000000, 6.000000);

	return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
	if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
	{
	    TextDrawShowForPlayer(playerid, tcar_StatusENG[0]);
		TextDrawShowForPlayer(playerid, tcar_StatusHUL[0]);
		TextDrawShowForPlayer(playerid, tcar_StatusWHL[0]);
		TextDrawShowForPlayer(playerid, tcar_StatusBAT[0]);
		TextDrawShowForPlayer(playerid, tcar_FuelBackground);
		TextDrawShowForPlayer(playerid, tcar_Heading);
		PlayerTextDrawShow(playerid, tcar_PLAYER_Fuel[playerid]);
	}
	else if(oldstate == PLAYER_STATE_DRIVER || oldstate == PLAYER_STATE_PASSENGER)
	{
	    TextDrawHideForPlayer(playerid, tcar_StatusENG[0]);
		TextDrawHideForPlayer(playerid, tcar_StatusHUL[0]);
		TextDrawHideForPlayer(playerid, tcar_StatusWHL[0]);
		TextDrawHideForPlayer(playerid, tcar_StatusBAT[0]);
		TextDrawHideForPlayer(playerid, tcar_FuelBackground);
		TextDrawHideForPlayer(playerid, tcar_Heading);
		PlayerTextDrawHide(playerid, tcar_PLAYER_Fuel[playerid]);
	}
	return 1;
}
