Textdraw won't hide
#1

Well, I made a test command for my paycheck system, but my textdraw won't hide. When I create it on OnPlayerConnect, I managed to hide it. But, when I show it again when a player gets his paycheck, it shows up but won't hide again.

pawn Код:
public GivePlayerPaycheck(playerid, ammount)
{
    new string[80]
    pInfo[playerid][pPaycheck] += ammount;
    format(string ,sizeof(string), "[Paycheck] + $ %i [Total: $ %i", ammount, pInfo[playerid][pPaycheck]);
    TextDrawShowForPlayer(playerid, PaycheckTD[playerid]);
    TextDrawSetString(PaycheckTD[playerid], string);
    SetTimerEx("HidePaycheckTD", 5000, false, "i", playerid);
    return 1;
}

public HidePaycheckTD(playerid)
{
    TextDrawHideForPlayer(playerid, PaycheckTD[playerid]);
    return 1;  
}
Reply
#2

Don't think you need to reshow it using TextDrawSetString, but this should fix it (Sleepy, 1:07 Am -_-):

pawn Код:
public GivePlayerPaycheck(playerid, ammount)
{
    new string[80]
    pInfo[playerid][pPaycheck] += ammount;
    format(string ,sizeof(string), "[Paycheck] + $ %i [Total: $ %i", ammount, pInfo[playerid][pPaycheck]);
    TextDrawHideForPlayer(playerid, PaycheckTD[playerid]);
    TextDrawSetString(PaycheckTD[playerid], string);
    TextDrawShowForPlayer(playerid, PaycheckTD[playerid]);
    SetTimerEx("HidePaycheckTD", 5000, false, "i", playerid);
    return 1;
}
Reply
#3

I managed to get it working. I forgot to kill the timer lol.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)