Simple question.
#1

PHP код:
if(playertextid == INVALID_TEXT_DRAW
What's wrong with it ?
Reply
#2

Global Textdraw
A global textdraw is the easiest to create and requires only one variable. This variable is needed to modify the textdraw and to show it to the players later on. The declaration for such a textdraw needs to be a global variable in most cases. The textdraw variable also needs to be prefixed with the Text: tag and should be initialized with the value Text:INVALID_TEXT_DRAW. If you omit the initialization, the textdraw may conflict with others as you add more textdraws.
new Text:gMyText = Text:INVALID_TEXT_DRAW;

Per-Player Textdraw
A per-player textdraw is exactly the same as a regular 'global' textdraw, but only creates the textdraw for a single player. This is useful for textdraws that are unique to each player, such as a 'stats' bar showing their kills or score. This can be used to avoid going over the global-textdraw limit, as you can create 256 (as of 0.3e R2) textdraws per player. They are also easier to manage, as they automatically destroy themselves when the player disconnects.
new PlayerText:gMyPlayerText[MAX_PLAYERS] = {PlayerText:INVALID_TEXT_DRAW, ...};
IMPORTANT NOTE: An array is still needed for the variable, as the ID of the textdraws may differ from player to player, as other players may have more or less textdraws created than the other.
The function names only differ slightly, with 'TextDraw' becoming 'PlayerTextDraw', with one exception: CreatePlayerTextDraw ('TextDrawSetString' becomes 'PlayerTextDrawSetString').

Source: wiki.sa-mp.com
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)