deactivate textdraw -
Zeus666 - 27.10.2018
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
Re: deactivate textdraw -
RogueDrifter - 27.10.2018
https://sampwiki.blast.hk/wiki/TextDraw
read this
Re: deactivate textdraw -
Zeus666 - 27.10.2018
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
Re: deactivate textdraw -
RogueDrifter - 27.10.2018
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).
Re: deactivate textdraw -
cSharp - 27.10.2018
Quote:
Originally Posted by Zeus666
I created a stock for deleteplayerid
|
no. you wrote a function.
https://sampforum.blast.hk/showthread.php?tid=570635
Re: deactivate textdraw -
TheToretto - 27.10.2018
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.
Re: deactivate textdraw -
RogueDrifter - 27.10.2018
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.
Re: deactivate textdraw -
Zeus666 - 27.10.2018
PHP код:
PlayerTextDrawHide or PlayerTextDrawDestroy
? i want them to reappear
Re: deactivate textdraw -
d3Pedro - 27.10.2018
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.
Re: deactivate textdraw -
Zeus666 - 28.10.2018
PHP код:
CMD:abcd(playerid)
{
if(pInfo[playerid][yes] == 1)
{
CreatePlayerTD(playerid);
foreach(Player,i)
{
PlayerTextDrawShow(playerid, DebugInfo[i]);
}
PlayerTextDrawShow(playerid, DebugBox[playerid]);
PlayerTextDrawShow(playerid, DebugText[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);