TextDraw Problem
#1

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?
Reply
#2

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]);
}
Reply
#3

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)