TextDrawHideForPlayer
#1

Hello, I have a text draw when a player enter pickup it show it to him and set a timer when this timer finish the text draw must hide but it not here is the code
PHP код:
else if(pickupid == mafia || pickupid == bikers || pickupid == grove || pickupid == ballas || pickupid == rifas || pickupid == tirads)
{
    if(
PlayerInfo[playerid][pGang] == 0)
    {
    
TextDrawShowForPlayer(playeridText:Textdraw0);
    
TextDrawShowForPlayer(playeridText:Textdraw1);
    
SetTimerEx("hideText"3000false"i"playerid);
    return 
1;
    }
    return 
1;

And the timer
PHP код:
forward hideText(playerid);
public 
hideText(playerid)
{
    
TextDrawHideForPlayer(playeridText:Textdraw0);
    
TextDrawHideForPlayer(playeridText:Textdraw1);
        return 
1;

Please Help !
Reply
#2

r u getting any error or warning something? if not show the code of TextDraw
Reply
#3

No i don't get any errors here is the code
PHP код:
Textdraw0 TextDrawCreate(188.000000265.322265"usebox");
TextDrawLetterSize(Textdraw00.0000007.220365);
TextDrawTextSize(Textdraw0, -7.5000000.000000);
TextDrawAlignment(Textdraw01);
TextDrawColor(Textdraw00);
TextDrawUseBox(Textdraw0true);
TextDrawBoxColor(Textdraw0102);
TextDrawSetShadow(Textdraw00);
TextDrawSetOutline(Textdraw00);
TextDrawFont(Textdraw00);

Textdraw1 TextDrawCreate(2.000000291.200012"Click Lalt to join mafia gang");
TextDrawLetterSize(Textdraw10.4499991.600000);
TextDrawAlignment(Textdraw11);
TextDrawColor(Textdraw1, -1);
TextDrawSetShadow(Textdraw10);
TextDrawSetOutline(Textdraw12);
TextDrawBackgroundColor(Textdraw151);
TextDrawFont(Textdraw10);
TextDrawSetProportional(Textdraw11); 
Reply
#4

AnyOne o.O ?
Reply
#5

Are you using streamer? If so, which version? Use print function and try to debug. Remember that if you stay in pickup callback is called not once, but more times (It depends, something like once call in 5-8 seconds).
Reply
#6

So is there any issue to solve the function in pickup that called many times ?
Reply
#7

I have 2 propositions:

1. Change pickup type (https://sampwiki.blast.hk/wiki/PickupTypes - for example 2 or 3)
2. Use checkpoints for it (if you use streamer).
Reply
#8

I recommend using "onplayerkeystatechange" function, instead of using timer.
So you can hide the textdraw using keys (e.g LMB)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)