SA-MP Forums Archive
TextDraw Problem - 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: TextDraw Problem (/showthread.php?tid=158695)



TextDraw Problem - zallomallo - 10.07.2010

In "my" script, players in stealth mode get a countdown until their stealth time is over. However when 2+ players are using this, it updates for everyone. Meaning one second it'll be your countdown time, then another player, then back, and so on. How can I made a TextDrawSetString for only one player?


Re: TextDraw Problem - Carlton - 10.07.2010

You have to create a textdraw to each player. I don't wan't make a full code for you but here's a short example.

pawn Код:
new Text:MyHealthTxt[MAX_PLAYERS];

public OnGameModeInit() {
     for(new i = 0; i < GetMaxPlayers(); i ++ ) {
          MyHealthTxt[i] = TextDrawCreate(...);
          // Etc...
     }
     return 1;
}

public OnPlayerOnStealthMode(playerid) {
     
     TextDrawSetString(MyHealthTxt[playerid], Number);
     TextDrawShowForPlayer(playerid, MyHealthTxt[playerid]);
}



Re: TextDraw Problem - zallomallo - 10.07.2010

The thing is, I don't need TextDrawShowForPlayer for it to show, sadly. If it wasn't like this, I could simply set it to the player's specific variable before each showing.