Textdraw
#1

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;
    }
Reply
#2

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;
}
Reply
#3

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;
}
Reply
#4

Код:
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
Reply
#5

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

Anyone?
Reply
#7

Last try..
Reply
#8

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
Reply
#9

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;
}
Reply
#10

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


Forum Jump:


Users browsing this thread: 1 Guest(s)