SA-MP Forums Archive
[SOLVED] Enable Textdraw when type a command and disable when type the ...... - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [SOLVED] Enable Textdraw when type a command and disable when type the ...... (/showthread.php?tid=91010)



[SOLVED] Enable Textdraw when type a command and disable when type the ...... - RyDeR` - 11.08.2009

How to Enable Textdraw when type a command and disable when type the same command ??


Re: Enable Textdraw when type a command and disable when type the same command how? - arnutisz - 11.08.2009

create a variable, like:
pawn Code:
new bool:textdrawon[MAX_PLAYERS];
OnPlayerConnect add:

pawn Code:
textdrawon[playerid] = false;
Then in your command add:

pawn Code:
if(textdrawon[playerid] == false)
{
  TextDrawShowForPlayer(...);
  textdrawon[playerid] = true;
}
else if(textdrawon[playerid] == true)
{
  TextDrawHideForPlayer(....);
  textdrawon[playerid] = false;
}



Re: Enable Textdraw when type a command and disable when type the same command how? - RyDeR` - 11.08.2009

Quote:
Originally Posted by Scott[LT
]
create a variable, like:
pawn Code:
new bool:textdrawon[MAX_PLAYERS];
OnPlayerConnect add:

pawn Code:
textdrawon[playerid] = false;
Then in your command add:

pawn Code:
if(textdrawon[playerid] == false)
{
  TextDrawShowForPlayer(...);
  textdrawon[playerid] = true;
}
else if(textdrawon[playerid] == true)
{
  TextDrawHideForPlayer(....);
  textdrawon[playerid] = false;
}
ty solved