Altitudemeter Fail?
#7

This is my code:


Defines...
Код:
new Text:Altitudemeter;
new AltitudeString[128];
Код:
Altitudemeter = TextDrawCreate(483.000000, 99.000000, "Altitude: 0.00 meters");
	TextDrawBackgroundColor(Altitudemeter, 255);
	TextDrawFont(Altitudemeter, 1);
	TextDrawLetterSize(Altitudemeter, 0.290000, 1.400000);
	TextDrawColor(Altitudemeter, -939523896);
	TextDrawSetOutline(Altitudemeter, 0);
	TextDrawSetProportional(Altitudemeter, 1);
	TextDrawSetShadow(Altitudemeter, 1);
Start the timer...
Код:
public OnPlayerSpawn(playerid)
{
	if (IsInDM[playerid] == 0)
        {
    	    SetTimerEx("RefreshAltitudeMeter", 100, true, "i", playerid);
        }
   return 1;
}
The timer code...
Код:
public RefreshAltitudeMeter(playerid)
{
	new playervehicleid;
	new Float:x, Float:y, Float:z;
 	if(IsPlayerInAnyVehicle(playerid))
    {
	    playervehicleid = GetPlayerVehicleID(playerid);
		GetVehiclePos(playervehicleid, x, y, z);

	    format(AltitudeString, sizeof(AltitudeString), "Altitude: %.2f meters", z);
	    
	    TextDrawSetString(Altitudemeter, AltitudeString);
	    TextDrawShowForPlayer(playerid, Altitudemeter);
     }
     else
     {
     	TextDrawHideForPlayer(playerid, Altitudemeter);
        return 1;
     }
	return 1;
}
Help!
Reply


Messages In This Thread
Altitudemeter Fail? - by johannetje2 - 11.04.2011, 18:07
Re: Altitudemeter Fail? - by Jefff - 11.04.2011, 18:13
Re: Altitudemeter Fail? - by johannetje2 - 11.04.2011, 18:41
Re: Altitudemeter Fail? - by woot - 11.04.2011, 18:45
Re: Altitudemeter Fail? - by WackoX - 11.04.2011, 18:45
Re: Altitudemeter Fail? - by Rivera - 11.04.2011, 18:47
Re: Altitudemeter Fail? - by johannetje2 - 11.04.2011, 18:55
Re: Altitudemeter Fail? - by Typhome - 11.04.2011, 18:59
Re: Altitudemeter Fail? - by johannetje2 - 11.04.2011, 19:10
Re: Altitudemeter Fail? - by Jefff - 11.04.2011, 20:35

Forum Jump:


Users browsing this thread: 1 Guest(s)