deactivate textdraw
#1

Hi. I load my textdraws via

PHP код:
stock CreatePlayerTD 
My question is, is there a way to set them activated, but if you type /deactivate to deactivate them, and if you type again /deactivate to activate them? thanks

If so, how? I will try to script it, if I can't, I will ask for help again
Reply
#2

https://sampwiki.blast.hk/wiki/TextDraw
read this
Reply
#3

Quote:
Originally Posted by RogueDrifter
Посмотреть сообщение
PHP код:
CMD:yes(playerid)
{
if(
pInfo[playerid][yes] == 1)
{
CreatePlayerTD(playerid);
}
else{
DeletePlayerTD(playerid);
}
return 
1;

Would this work? I created a stock for deleteplayerid
Reply
#4

Or you can create it once the player connects and just show/hide it and destroy it when player disconnects (if it's not a player TD because those get destroyed automatically when player disconnects).
Reply
#5

Quote:
Originally Posted by Zeus666
Посмотреть сообщение
I created a stock for deleteplayerid
no. you wrote a function.
https://sampforum.blast.hk/showthread.php?tid=570635
Reply
#6

PHP код:
CMD:yes(playerid

if(
pInfo[playerid][yes]) 

CreatePlayerTD(playerid);
pInfo[playerid][yes] = false;

else{ 
DeletePlayerTD(playerid); 
pInfo[playerid][yes] = true;

return 
1

Fix the indentation, I'm on phone and I hope your variable is a boolean.
Reply
#7

Quote:
Originally Posted by TheToretto
Посмотреть сообщение
PHP код:
CMD:yes(playerid

if(
pInfo[playerid][yes]) 

CreatePlayerTD(playerid);
pInfo[playerid][yes] = false;

else{ 
DeletePlayerTD(playerid); 
pInfo[playerid][yes] = true;

return 
1

Fix the indentation, I'm on phone and I hope your variable is a boolean.
That's not what he was going for.
Reply
#8

PHP код:
PlayerTextDrawHide or PlayerTextDrawDestroy 
? i want them to reappear
Reply
#9

Quote:
Originally Posted by Zeus666
Посмотреть сообщение
PHP код:
PlayerTextDrawHide or PlayerTextDrawDestroy 
? i want them to reappear
PlayerTextDrawHide.
It is English? If I'm not wrong, guess the difference between Destroy and Hide.
Reply
#10

PHP код:
CMD:abcd(playerid)
{
    if(
pInfo[playerid][yes] == 1)
    {
    
CreatePlayerTD(playerid);
    foreach(
Player,i)
        {
    
PlayerTextDrawShow(playeridDebugInfo[i]);
        }
    
PlayerTextDrawShow(playeridDebugBox[playerid]);
    
PlayerTextDrawShow(playeridDebugText[playerid]);
    
pInfo[playerid][yes] = 0;
    }
       else{
    
HidePlayerTD(playerid);
    
pInfo[playerid][yes] = 1;
    }
    return 
1;

How can I set this below, for the up code? (below code is foreach)

PHP код:
                        PlayerTextDrawSetString(i,DebugInfo[i],strupdate);
                                
PlayerTextDrawSetString(i,Debug_GunInfo[i],strwep); 
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)