SA-MP Forums Archive
bug in textdraw if shows up - 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)
+--- Thread: bug in textdraw if shows up (/showthread.php?tid=426583)



bug in textdraw if shows up - dash5487 - 29.03.2013

hello how are you ?
i found this code in samp fourm but its work good for only 1 player if 2 player has joined and if player 1 showsup a textdraw (like /stats) and it wil shows up correctly and if player 1 use /stats again it will off but the problem is if player 1 has already used stats and if 2 at the same time shows up textdraw using /stats , and if player 1 wants to turn off textdraw and do /stats the textdraw wont off for him and player2 as well

PHP код:
create a variablelike:
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;

i did used for(new i=0; i<=MAX_PLAYERS; i++) but i dont know how to use it correctly or is there any otehr way to solve it !

p.s : i will goto english class room


Re: bug in textdraw if shows up - dash5487 - 29.03.2013

no one can help me ? ~g~ !


Re: bug in textdraw if shows up - MP2 - 29.03.2013

Quote:
Originally Posted by dash5487
Посмотреть сообщение
no one can help me ? ~g~ !
Not when you bump.