TextDraw not showing up
#3

You're making a textdraw only for one player and you're not using TextDrawShowForPlayer.

Add this anywhere:
pawn Код:
new Text:SpeedTD[MAX_PLAYERS]; // Speed TextDraw

Add this to OnPlayerConnect and remove the code that's in OnGameModeInit.
pawn Код:
SpeedTD[playerid] = TextDrawCreate(487.000000, 425.000000, "Speed");
TextDrawBackgroundColor(SpeedTD[playerid], 255);
TextDrawFont(SpeedTD[playerid], 1);
TextDrawLetterSize(SpeedTD[playerid], 0.500000, 1.300000);
TextDrawColor(SpeedTD[playerid], -1);
TextDrawSetOutline(SpeedTD[playerid], 1);
TextDrawSetProportional(SpeedTD[playerid], 1);

and the OnPlayerUpdate code:
pawn Код:
if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER) // Speed TextDraw
{
    TextDrawShowForPlayer(playerid, SpeedTD[playerid]);
    new string[64], speed = GetVehicleSpeed(GetPlayerVehicleID(playerid), 0);
    format(string, sizeof(string), "Speed: %d MPH", speed);
    TextDrawSetString(SpeedTD[playerid], string);
}
else TextDrawHideForPlayer(playerid, SpeedTD[playerid]);


This will work but I suggest you not to use OnPlayerUpdate, rather use a timer.
Reply


Messages In This Thread
TextDraw not showing up - by WinterAce - 15.12.2012, 15:50
Re: TextDraw not showing up - by Lordzy - 15.12.2012, 15:58
Re: TextDraw not showing up - by Mean - 15.12.2012, 15:58
Re: TextDraw not showing up - by [HK]Ryder[AN] - 15.12.2012, 15:58
Re: TextDraw not showing up - by WinterAce - 15.12.2012, 16:34
Re: TextDraw not showing up - by marsmubarak - 06.07.2013, 18:56
Re: TextDraw not showing up - by SwisherSweet - 06.07.2013, 19:01

Forum Jump:


Users browsing this thread: 2 Guest(s)