Textdraw wont show up, I tried nearly everything..
#1

Hello there,

so, after a long break from samp, I started a new project, and everything was working fine, but then at some point, the speedometer's textdraw wont showup..

I've been trying to fix this bug for the past 2 hours, without any results.. I ******d, found some solutions, but none of them seem to work.

so, what I'm basically making is a speedometer, it contains a white bar, with inside that white bar, a text saying how fast you go, the faster you go, the more the value of the bar increases, and the value of the textdraw increases aswell.

but now, for some reason, the bar DOES show up, but the text saying how fast you go, doesn't...

pawn Код:
public Speedometer( playerid )
{
    // Speed //
    GetVehicleVelocity( GetPlayerVehicleID( playerid ), Velocity[ playerid ][ 0 ], Velocity[ playerid ][ 1 ], Velocity[ playerid ][ 2 ] );
    Player[ playerid ][ Sp ] = floatsqroot( ( ( Velocity[ playerid ][ 0 ] * Velocity[ playerid ][ 0 ] ) + ( Velocity[ playerid ][ 1 ] * Velocity[ playerid ][ 1 ] ) ) + ( Velocity[ playerid ][ 2 ] * Velocity[ playerid ][ 2 ] ) )*100;
    Player[ playerid ][ Speed ] = floatround( Player[ playerid ][ Sp ], floatround_round );
    format( SpStr[ playerid ], 15, "%i MPH", Player[ playerid ][ Speed ] );
    SetProgressBarValue( Progressbars[ playerid ][ SpeedoBar ], Player[ playerid ][ Speed ] );
    SetProgressBarValue( Progressbars[ playerid ][ NitroBar ], Player[ playerid ][ Nitro ] );
    ShowSpeedometer( playerid );
    TextDrawSetString( Textdraws[ playerid ][ SpDisplay ], SpStr[ playerid ]);
    if( Player[ playerid ][ Speed ] >= 150 )
    {
        TextDrawSetString( Textdraws[ playerid ][ SpDisplay ], "MAX!" );
    }
return 1;
}
that's the timer I got, it should work fine, I tried adding ShowTextDrawForPlayer( playerid, Textdraws[ playerid ][ SpDisplay ] ); without result..

pawn Код:
CreateTextdraws( playerid )
{
    Textdraws[ playerid ][ SpDisplay ] = TextDrawCreate( 512.000000, 422.000000, " " );
    TextDrawBackgroundColor( Textdraws[ playerid ][ SpDisplay ], 255 );
    TextDrawFont( Textdraws[ playerid ][ SpDisplay ], 2);
    TextDrawLetterSize( Textdraws[ playerid ][ SpDisplay ], 0.310000, 1.699999 );
    TextDrawColor( Textdraws[ playerid ][ SpDisplay ], 255 );
    TextDrawSetOutline( Textdraws[ playerid ][ SpDisplay ], 0 );
    TextDrawSetProportional( Textdraws[ playerid ][ SpDisplay ], 1 );
    TextDrawSetShadow( Textdraws[ playerid ][ SpDisplay ], 1 );
}
^^ a small function I use in OnPlayerConnect, it creates the textdraw when the player connects.

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    KillTimer( Player[ playerid ][ SpTimer ] );
    HideSpeedometer( playerid );
    if( newstate == 2 )
    {
        Player[ playerid ][ SpTimer ] = SetTimerEx( "Speedometer", 64, true, "i", playerid );
    }
    return 1;
}
state 2, for when the player enters a vehicle, it starts the timer.

I have no idea what's wrong here, it just wont showup the Textdraw..

EDIT: Solved, the bars where covering the textdraw, Thanks for helping me out steve
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)