#include <a_samp>
forward Flughoehe();
forward IsPlayerInPlane(playerid);
public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" Flug-Höhen script by Frankenstein");
	print("--------------------------------------\n");
	return 1;
}
public OnFilterScriptExit()
{
	return 1;
}
public Flughoehe()
{
	new Text:anzeige;
 	for (new i; i < MAX_PLAYERS; i++)
 	{
    	if(IsPlayerConnected(i))
    	{
        	if(IsPlayerInPlane(i))
        	{
            	new Float:x,Float:y,Float:z;
            	GetPlayerPos(i,x,y,z);
            	new string[256];
            	format(string, sizeof(string),"Flughoehe: %.2f Meter", z );
            	TextDrawDestroy(anzeige);
            	anzeige = TextDrawCreate(50.0, 420.0, string);
            	TextDrawLetterSize(anzeige, 0.5, 2.5);
            	TextDrawShowForPlayer(i,anzeige);
            	textdrawwahr[i] = 1;
          	}
          	else if(textdrawwahr[i] == 1)
          	{
              	TextDrawDestroy(anzeige);
              	textdrawwahr[i] = 0;
        	}
}
public IsPlayerInPlane(playerid)
{
	new heli[10] = {417, 425, 447, 465, 469, 487, 488, 497, 548, 563};
	new plane[12] = {460, 464, 476, 511, 512, 513, 519, 520, 553, 577, 592, 593};
	new model = GetVehicleModel(GetPlayerVehicleID(playerid));
	for(new i=0; i < 10; i++)
    	if(model == heli[i])
        	return 1;
	for(new i=0; i < 12; i++)
    	if(model == plane[i])
        	return 1;
	return 0;
}
		
		
		
	

