11.04.2011, 18:55
This is my code:
Defines...
Start the timer...
The timer code...
Help!
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);
Код:
public OnPlayerSpawn(playerid) { if (IsInDM[playerid] == 0) { SetTimerEx("RefreshAltitudeMeter", 100, true, "i", playerid); } return 1; }
Код:
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; }