TextDraw problem.
#1

Quote:

C:\Documents and Settings\Admin\Desktop\Backupai\Backupai\GangWars\ gamemodes\GangWars.pwn(5532) : warning 213: tag mismatch
C:\Documents and Settings\Admin\Desktop\Backupai\Backupai\GangWars\ gamemodes\GangWars.pwn(5547) : warning 213: tag mismatch
C:\Documents and Settings\Admin\Desktop\Backupai\Backupai\GangWars\ gamemodes\GangWars.pwn(5551) : warning 213: tag mismatch
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


3 Warnings.

Lines

5532 if ( InfoText[ playerid ] == INVALID_TEXT_DRAW )
5547 if ( InfoText[ playerid ] != INVALID_TEXT_DRAW )
5551 InfoText[ playerid ] = INVALID_TEXT_DRAW;
Reply
#2

Did you : new Text: InfoText[MAX_PLAYERS]; ??
Reply
#3

Yes. 8chars
Reply
#4

As always: Post the lines.
Reply
#5

Its posted in 1post
Reply
#6

Nah, I mean the full part, not just the three lines.
+ The "new" part.
Reply
#7

Код:
//===========================[TextDraw  creating]===========================================
//===========================[CREDITS: Ellis / FanKurT]===========================================
stock ShowInfoText( playerid, text[ ], time, sound = true )
{
	// Funkcija: ShowInfoText( playerid, text[ ] )
	// Parodys юaidлjui kvadratukа, su informacija

	if ( InfoText[ playerid ] == INVALID_TEXT_DRAW )
	{
	    InfoText[ playerid ] = CreateInfoText( text );
	    TextDrawShowForPlayer( playerid, InfoText[ playerid ] );
	    SetTimerEx           ( "HideInfoText", time, false, "d", playerid );
	}

	if ( sound )
		PlayerPlaySound( playerid, 1057, 0.0, 0.0, 0.0 );
}
public HideInfoText( playerid )
{
	// Funkcija: HideInfoText( playerid )
	// Paslлps info tekstа юaidлjui

	if ( InfoText[ playerid ] != INVALID_TEXT_DRAW )
	{
	    TextDrawHideForPlayer( playerid, InfoText[ playerid ] );
	    TextDrawDestroy      ( InfoText[ playerid ] );
	    InfoText[ playerid ] = INVALID_TEXT_DRAW;
	}

	return true;
}
Reply
#8

Try:

pawn Код:
//===========================[TextDraw  creating]===========================================
//===========================[CREDITS: Ellis / FanKurT]===========================================
stock ShowInfoText( playerid, text[ ], time, sound = true )
{
    // Funkcija: ShowInfoText( playerid, text[ ] )
    // Parodys юaidлjui kvadratukа, su informacija
    switch(InfoText[ playerid ])
    {
        case INVALID_TEXT_DRAW:
        {
            InfoText[ playerid ] = CreateInfoText( text );
            TextDrawShowForPlayer( playerid, InfoText[ playerid ] );
            SetTimerEx           ( "HideInfoText", time, false, "d", playerid );
        }
    }
    if ( sound ) PlayerPlaySound( playerid, 1057, 0.0, 0.0, 0.0 );
}
public HideInfoText( playerid )
{
    // Funkcija: HideInfoText( playerid )
    // Paslлps info tekstа юaidлjui
    switch( InfoText[ playerid ])
    {
        case INVALID_TEXT_DRAW: {}
        default:
        {
            TextDrawHideForPlayer( playerid, InfoText[ playerid ] );
            TextDrawDestroy      ( InfoText[ playerid ] );
            InfoText[ playerid ] = INVALID_TEXT_DRAW;
        }
    }
    return true;
}
Reply
#9

tag mistach at.

InfoText[ playerid ] = INVALID_TEXT_DRAW;
Reply
#10

Meh, this is only fixable like this:

pawn Код:
//===========================[TextDraw  creating]===========================================
//===========================[CREDITS: Ellis / FanKurT]===========================================
stock ShowInfoText( playerid, text[ ], time, sound = true )
{
    // Funkcija: ShowInfoText( playerid, text[ ] )
    // Parodys юaidлjui kvadratukа, su informacija

    if ( InfoTextOn[ playerid ] == 0 )
    {
        InfoText[ playerid ] = CreateInfoText( text );
        TextDrawShowForPlayer( playerid, InfoText[ playerid ] );
        InfoText[ playerid ] = 1;
        SetTimerEx           ( "HideInfoText", time, false, "d", playerid );
    }

    if ( sound )
        PlayerPlaySound( playerid, 1057, 0.0, 0.0, 0.0 );
}
public HideInfoText( playerid )
{
    // Funkcija: HideInfoText( playerid )
    // Paslлps info tekstа юaidлjui

    if ( InfoTextOn[ playerid ] == 1 )
    {
        TextDrawHideForPlayer( playerid, InfoText[ playerid ] );
        TextDrawDestroy      ( InfoText[ playerid ] );
        InfoTextOn[ playerid ] = 0;
    }

    return true;
}
and add at top:

pawn Код:
new InfoTextOn[MAX_PLAYERS];
Should work then.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)