SA-MP Forums Archive
Textdraw - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Textdraw (/showthread.php?tid=538965)



Textdraw - TLN - 25.09.2014

The textdraws aren't hiding, it did work a few days ago, but I have no idea why it's not working now..

pawn Код:
stock HideCommandsTextDraws(playerid)
{
    PlayerTextDrawHide(playerid, TDBox[playerid]);
    PlayerTextDrawHide(playerid, CommandsTD[playerid]);
    PlayerTextDrawHide(playerid, TextMessage[playerid]);
    return 1;
}
pawn Код:
if(PRESSED(KEY_FIRE))
    {
        if(CommandsS[playerid] == 1)
        {
            HideCommandsTextDraws(playerid);
            CommandsS[playerid] = 0;
        }
        return 1;
    }



Re: Textdraw - TunisianoGamer - 25.09.2014

It will never work only if [ if(CommandsS[playerid] == 1) ] , could you post the code , in wich action , stock , or command that CommandsS[playerid] change from state 0 to 1 otherwise remove that condition , here :
if(PRESSED(KEY_FIRE))
{
HideCommandsTextDraws(playerid);
return 1;
}


Re: Textdraw - TLN - 25.09.2014

It changes to 1 when you type /cmds.

pawn Код:
CMD:cmds(playerid, params[])
{
    if (APlayerData[playerid][LoggedIn] == true)
    {
        CommandsS[playerid] = 1;
        ShowCommandsTextDraws(playerid);
    }
    return 1;
}



Re: Textdraw - Goldac - 25.09.2014

Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if (PRESSED(KEY_FIRE))
    {
              TextDrawShowForPlayer(playerid, TDBox[playerid]);
              TextDrawShowForPlayer(playerid, CommandsTD[playerid]);
              TextDrawShowForPlayer(playerid, TextMessage[playerid]);
    }
    return 1;
}
it will like that probably


Re: Textdraw - TLN - 25.09.2014

I'm using player textdraws + that will show the textdraws. If you mean I should hide it like that, I already tried.


Re: Textdraw - TLN - 26.09.2014

Anyone?


Re: Textdraw - TLN - 27.09.2014

Last try..


Re: Textdraw - James_Braga - 27.09.2014

PHP код:
if(oldkeys == KEY_FIRE)
{
    if(
CommandsS[playerid])HideCommandsTextDraws(playerid);
    return 
1;
}
stock HideCommandsTextDraws(playerid)
{
    
CommandsS[playerid] = 0;
    
PlayerTextDrawHide(playeridTDBox[playerid]);
    
PlayerTextDrawHide(playeridCommandsTD[playerid]);
    
PlayerTextDrawHide(playeridTextMessage[playerid]);

try to use oldkeys


Re: Textdraw - iFiras - 27.09.2014

pawn Код:
if(PRESSED(KEY_FIRE))
{
        if(CommandsS[playerid] == 1)
        {
            CommandsS[playerid] = 0;
            PlayerTextDrawHide(playerid, TDBox[playerid]);
            PlayerTextDrawHide(playerid, CommandsTD[playerid]);
            PlayerTextDrawHide(playerid, TextMessage[playerid]);
        }
        return 1;
}



Re: Textdraw - TLN - 28.09.2014

Thank you both, I should've tried oldkeys before...