Problem.
#1

Hello all. I have a problem with textdraws. So, I have 2 textdraws -

Website,
Speedometer.

Website - after mini map
Speedometer - after money bar.

When I enter car, spedometer shows fuel and speed correct, but.. Website TD destroying for no reason, speedometer TD - not after money bar, but after mini map.. If you need, I can take ss. And strangest thing: When I delete website TD - speedometer deleted too?

Script:

TextDraws creating, at OnGameModeInit:

pawn Код:
foreach(Player, ID)
    {
        Spidometras[ ID ] = TextDrawCreate(26.000000, 318.000000, "Greitis");
        TextDrawBackgroundColor(Spidometras[ID], 255);
        TextDrawFont(Spidometras[ID], 2);
        TextDrawLetterSize(Spidometras[ID], 0.500000, 1.000000);
        TextDrawColor(Spidometras[ID], -65281);
        TextDrawSetOutline(Spidometras[ID], 1);
        TextDrawSetProportional(Spidometras[ID], 1);
    }
    Puslapis = TextDrawCreate( 85.000000, 422.000000, "GTA-RP.lt" );
    TextDrawAlignment( Puslapis, 2 );
    TextDrawBackgroundColor( Puslapis, 255 );
    TextDrawFont( Puslapis, 3 );
    TextDrawLetterSize( Puslapis, 0.629999, 2.200000 );
    TextDrawColor( Puslapis, -16776961 );
    TextDrawSetOutline( Puslapis, 1 );
    TextDrawSetProportional( Puslapis, 1 );


Speedometer in timer:

pawn Код:
if( IsPlayerInAnyVehicle( ID ) && GetPlayerState( ID ) == PLAYER_STATE_DRIVER )
            {
                new
                    Automobilis = GetPlayerVehicleID( ID ),
                    Modelis = GetVehicleModel( Automobilis )
                ;
                if( Modelis != 489 || Modelis != 510 || Modelis != 509 )
                {
                    if( ZaidejoGreitis( ID ) < 100 )
                    {
                        format( Stringas, 60, "~g~Greitis: ~g~%d~n~~g~Degalai: ~g~%d", ZaidejoGreitis( ID ), MasinuDB[ Masina ][ Degalai ] );
                        TextDrawSetString( Spidometras[ ID ], Stringas );
                        TextDrawShowForPlayer( ID, Spidometras[ ID ] );
                    }
                    else
                    {
                        format( Stringas, 70, "~g~Greitis: ~r~%d~n~~g~Degalai: ~g~%d", ZaidejoGreitis( ID ), MasinuDB[ Masina ][ Degalai ] );
                        TextDrawSetString( Spidometras[ ID ], Stringas );
                        TextDrawShowForPlayer( ID, Spidometras[ ID ] );
                    }
                }
                else
                {
                    format( Stringas, 27, "~g~Greitis: ~g~%d", ZaidejoGreitis( ID ) );
                    TextDrawSetString( Spidometras[ ID ], Stringas );
                    TextDrawShowForPlayer( ID, Spidometras[ ID ] );
                }
            }
        }
        else
        {
            TextDrawHideForPlayer( ID, Spidometras[ ID ] );
        }
    }
And

pawn Код:
public OnPlayerConnect(playerid)
{
    TextDrawShowForPlayer( playerid, Puslapis );
        .......
Reply
#2

Please, help.. ;xxx
Reply
#3

I have the same exact problem it's not a major priority for me, but i would like to know how to fix it hm...
Reply
#4

It may be related to a TextDraw bug I found sometime ago. Add this under OnGameModeInit

pawn Код:
while(TextDrawCreate(0,0,".")==Text:0)continue;
The issue lies with the TextDraw ID 0, it apparently isn't being saved appropriately or something. What this code does is remove any bugged areas of TextDraw.
Reply
#5

What exactly is the problem? Textdraws hiding whenever you do what?
Reply
#6

No, I can give you my server IP, you will come and see it.

Silent - THANK YOU!
Reply
#7

Sorry, but small problem with position.. Speedometer not after money bar, but.....:

Creating (not in local server):



In local server



Yes, I changed coordinates.
Reply
#8

Bump. ;>
Reply
#9

I have the same problem when using Foreach for textdraws....
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)