Textdraw gets stuck on the screen, sometimes.
#1

Hi, anyone know what is wrong? sometimes the textdraw doesnt disappear again
and i have to relog before it goes away

pawn Код:
new PlayerText:Textdraw2[MAX_PLAYERS];


public ShowPlayerFishText(playerid)
{
    Textdraw2[playerid] = CreatePlayerTextDraw(playerid,150.000000, 350.000000, "   ");
    PlayerTextDrawBackgroundColor(playerid,Textdraw2[playerid], 255);
    PlayerTextDrawFont(playerid,Textdraw2[playerid], 1);
    PlayerTextDrawLetterSize(playerid,Textdraw2[playerid], 0.400000, 1.000000);
    PlayerTextDrawColor(playerid,Textdraw2[playerid], -1);
    PlayerTextDrawSetOutline(playerid,Textdraw2[playerid], 1);
    PlayerTextDrawSetProportional(playerid,Textdraw2[playerid], 1);
    PlayerTextDrawSetSelectable(playerid,Textdraw2[playerid], 0);

    PlayerTextDrawShow(playerid,Textdraw2[playerid]);
    return 1;
}


public HidePlayerFishText(playerid)
{
    if(IsPlayerConnected(playerid))
    {
        PlayerTextDrawHide(playerid,Textdraw2[playerid]);
        PlayerTextDrawDestroy(playerid,Textdraw2[playerid]);
    }
    return 1;
}
pawn Код:
forward FishTimer(playerid);
public FishTimer(playerid)
{
    if(IsWaterInFrontOfPlayer(playerid,9.0) || IsPlayerInWater(playerid))
    {
        if(Fishing[playerid] == 1)
        {
            ShowPlayerFishText(playerid);
            PlayerTextDrawHide(playerid,Textdraw2[playerid]);
            PlayerTextDrawSetString(playerid,Textdraw2[playerid],"              ~y~YOU'VE HOOKED SOMETHING!~n~                ~w~PRESS ~r~~k~~PED_LOCK_TARGET~ ~w~TO REEL IT IN.");
            PlayerTextDrawShow(playerid, Textdraw2[playerid]);
            FishCaught[playerid] = 1;
            SetTimerEx("FishReelinTimer", 3000, false, "i", playerid);
        }
    }
    return 1;
}


    if(PRESSED(KEY_AIM))
    {
        if (FishCaught[playerid] == 0 && Fishing[playerid] == 1)
        {
            SendClientMessage(playerid, COLOR_GREY, "You reel in your line.");
            RemovePlayerAttachedObject(playerid,0);
            HidePlayerFishText(playerid);
            FishCaught[playerid] = 0;
            Fishing[playerid] = 0;
            return 1;
        }
    }
Reply
#2

if you call ShowPlayerFishText twice it will save Textdraw2[playerid] twice and the first will never vanish again
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)