TextDraw not hiding
#1

Hi all, I made a textdraw yesterday...I tried to test it but I don't know what happens or what is the problem..Here is The code
TextDraw
pawn Код:
stats[playerid] = CreatePlayerTextDraw(playerid, 309.999908, 141.466476, "Stats: Nick(ID)");
    PlayerTextDrawLetterSize(playerid, stats[playerid], 0.400000, 1.600000);
    PlayerTextDrawTextSize(playerid, stats[playerid], 0.000000, 295.000000);
    PlayerTextDrawAlignment(playerid, stats[playerid], 2);
    PlayerTextDrawColor(playerid, stats[playerid], 16711935);
    PlayerTextDrawUseBox(playerid, stats[playerid], 1);
    PlayerTextDrawBoxColor(playerid, stats[playerid], -16776961);
    PlayerTextDrawSetShadow(playerid, stats[playerid], 0);
    PlayerTextDrawSetOutline(playerid, stats[playerid], 0);
    PlayerTextDrawBackgroundColor(playerid, stats[playerid], 255);
    PlayerTextDrawFont(playerid, stats[playerid], 1);
    PlayerTextDrawSetProportional(playerid, stats[playerid], 1);
    PlayerTextDrawSetShadow(playerid, stats[playerid], 0);

    xex[playerid] = CreatePlayerTextDraw(playerid, 433.199920, 140.719909, "[X]");
    PlayerTextDrawLetterSize(playerid, xex[playerid], 0.400000, 1.600000);
    PlayerTextDrawTextSize(playerid, xex[playerid], 24.0, 96.000000);
    PlayerTextDrawAlignment(playerid, xex[playerid], 1);
    PlayerTextDrawColor(playerid, xex[playerid], -2147483393);
    PlayerTextDrawSetShadow(playerid, xex[playerid], 0);
    PlayerTextDrawSetOutline(playerid, xex[playerid], 1);
    PlayerTextDrawBackgroundColor(playerid, xex[playerid], -1);
    PlayerTextDrawFont(playerid, xex[playerid], 3);
    PlayerTextDrawSetProportional(playerid, xex[playerid], 1);
    PlayerTextDrawSetShadow(playerid, xex[playerid], 0);
    PlayerTextDrawSetSelectable(playerid, xex[playerid], true);

    nothing[playerid] = CreatePlayerTextDraw(playerid, 163.599884, 160.880035, "_");
    PlayerTextDrawLetterSize(playerid, nothing[playerid], 0.330399, 18.952539);
    PlayerTextDrawTextSize(playerid, nothing[playerid], 457.400299, 0.000000);
    PlayerTextDrawAlignment(playerid, nothing[playerid], 1);
    PlayerTextDrawColor(playerid, nothing[playerid], -1);
    PlayerTextDrawUseBox(playerid, nothing[playerid], 1);
    PlayerTextDrawBoxColor(playerid, nothing[playerid], 255);
    PlayerTextDrawSetShadow(playerid, nothing[playerid], 0);
    PlayerTextDrawSetOutline(playerid, nothing[playerid], 0);
    PlayerTextDrawBackgroundColor(playerid, nothing[playerid], 255);
    PlayerTextDrawFont(playerid, nothing[playerid], 1);
    PlayerTextDrawSetProportional(playerid, nothing[playerid], 1);
    PlayerTextDrawSetShadow(playerid, nothing[playerid], 0);
Command for showing textdraw.
pawn Код:
CMD:showtextdraw(playerid, params[])
{
     PlayerTextDrawShow(playerid, stats[playerid]);
     PlayerTextDrawShow(playerid, xex[playerid]);
     SelectTextDraw(playerid, 0x00FF00FF);
     PlayerTextDrawShow(playerid, nothing[playerid]);
    return 1;
}
OnPlayerClickPlayerTextDraw
pawn Код:
public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
{
    printf("Player TextDraw ID %d", playertextid);
    if(playertextid == xex[playerid])
    {
     PlayerTextDrawHide(playerid, stats[playerid]);
     PlayerTextDrawHide(playerid, xex[playerid]);
     PlayerTextDrawHide(playerid, nothing[playerid]);
    }
when I move my mouse over X it changes colour but when I click on it nothing happens.
Reply
#2

Quote:

CMDhowtextdraw(playerid, params[])
{
TextDrawHideForPlayer(playerid, stats[playerid]);
TextDrawHideForPlayer(playerid, xex[playerid]);
SelectTextDraw(playerid, 0x00FF00FF);
TextDrawHideForPlayer(playerid, nothing[playerid]);
return 1;
}

Quote:

public OnPlayerClickPlayerTextDraw(playerid, PlayerTextlayertextid)
{
printf("Player TextDraw ID %d", playertextid);
if(playertextid == xex[playerid])
{
TextDrawHideForPlayer(playerid, stats[playerid]);
TextDrawHideForPlayer(playerid, xex[playerid]);
TextDrawHideForPlayer(playerid, nothing[playerid]);
}

Try this code and give a reply
Reply
#3

pawn Код:
F:\Server Backup #1\clients\port_5101\filterscripts\future.pwn(63) : warning 213: tag mismatch
F:\Server Backup #1\clients\port_5101\filterscripts\future.pwn(64) : warning 213: tag mismatch
F:\Server Backup #1\clients\port_5101\filterscripts\future.pwn(66) : warning 213: tag mismatch
F:\Server Backup #1\clients\port_5101\filterscripts\future.pwn(71) : warning 213: tag mismatch
F:\Server Backup #1\clients\port_5101\filterscripts\future.pwn(74) : warning 213: tag mismatch
F:\Server Backup #1\clients\port_5101\filterscripts\future.pwn(75) : warning 213: tag mismatch
F:\Server Backup #1\clients\port_5101\filterscripts\future.pwn(76) : warning 213: tag mismatch
Lines..
pawn Код:
CMD:showtextdraw(playerid, params[])
 {
 TextDrawHideForPlayer(playerid, stats[playerid]);//63 line
 TextDrawHideForPlayer(playerid, xex[playerid]);//64 line
 SelectTextDraw(playerid, 0x00FF00FF);
 TextDrawHideForPlayer(playerid, nothing[playerid]);//66 line
 return 1;
 }
public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
{
    printf("Player TextDraw ID %d", playertextid);//71 line
    if(playertextid == xex[playerid])
    {
    TextDrawHideForPlayer(playerid, stats[playerid]);//74 line
    TextDrawHideForPlayer(playerid, xex[playerid]);//75 line
    TextDrawHideForPlayer(playerid, nothing[playerid]);//76 line
    }
    return 1;
}
Reply
#4

Quote:
Originally Posted by MichaelJones
Посмотреть сообщение
Try this code and give a reply
It won't work. He use PlayerTextDraws and they only can show with PlayerTextDrawShow and you use TextDrawShowForPlayer.
Please, if you don't have any knowledge about this, please be quiet.

------------------------------------------
@LazyBoyyyy:
What is printing in the console (server.log)?
PHP код:
printf("playertextid: %d - xex: %d",playertextid,xex[playerid]);
if(
playertextid == xex[playerid])
{
     
PlayerTextDrawHide(playeridstats[playerid]); 
     
PlayerTextDrawHide(playeridxex[playerid]);
     
PlayerTextDrawHide(playeridnothing[playerid]);

Reply
#5

I should use it with the old code I was having?
EDIT: tried it with the old code I am having but with your OnPlayerClickPlayerTextdraw..the textdraw appeared with /showtextdraw but when I move my mouse over [X] nothing happens even it doesn't change colours and when I click the same nothing happens and in my console there is nothing about it.
Reply
#6

bump I need help
Reply
#7

Can you put this at the first row of OnPlayerClickPlayerTextDraw?
PHP код:
print("Callback OnPlayerClickPlayerTextDraw called"); 
Reply
#8

EDITfixed it myself... -.-
Reply


Forum Jump:


Users browsing this thread: 6 Guest(s)