textdraw
#1

could anyone help me out, thanks

line 234:
Код:
Player_HUD_Txd[playerid][0] = CreatePlayerTextDraw(playerid, 43.323822, 430.227020, "XP:_54/100___LEVEL:_1");
Код:
(234) : warning 215: expression has no effect
(234) : error 001: expected token: ";", but found "["
(234) : error 029: invalid expression, assumed zero
(234) : warning 215: expression has no effect
(234) : error 001: expected token: ";", but found "]"
(234) : fatal error 107: too many error messages on one line
Reply
#2

The error happens in the first part, the array. Show us how you declared the Player_HUD_Txd array.
Reply
#3

Quote:
Originally Posted by NaS
Посмотреть сообщение
The error happens in the first part, the array. Show us how you declared the Player_HUD_Txd array.
Код:
new PlayerText:Player_HUD_Txd[3];
Reply
#4

Quote:
Originally Posted by Lukasz56
Посмотреть сообщение
Код:
new PlayerText:Player_HUD_Txd[3];
That is just one dimension. You access the array with 2 dimensions.

It should be:

Код:
new PlayerText:Player_HUD_Txd[MAX_PLAYERS][3];
Reply
#5

Quote:
Originally Posted by NaS
Посмотреть сообщение
That is just one dimension. You access the array with 2 dimensions.

It should be:

Код:
new PlayerText:Player_HUD_Txd[MAX_PLAYERS][3];
Thanks
Reply
#6

Quote:
Originally Posted by Lukasz56
Посмотреть сообщение
interesting , when i do this then it gives me more errors .
You probably have it somewhere else. You must check if these also access just one or two dimensions.
Reply
#7

Quote:
Originally Posted by NaS
Посмотреть сообщение
That is just one dimension. You access the array with 2 dimensions.

It should be:

Код:
new PlayerText:Player_HUD_Txd[MAX_PLAYERS][3];
[MAX_PLAYERS] in new PlayerText:Player_HUD_Txd[MAX_PLAYERS][3];

is useless because the textdraw is already created for the player.
Reply
#8

Thanks , i solved it
Reply
#9

Quote:
Originally Posted by Florin48
Посмотреть сообщение
[MAX_PLAYERS] in new PlayerText:Player_HUD_Txd[MAX_PLAYERS][3];

is useless because the textdraw is already created for the player.
Yes, but you need to store the ID of the TD per-player, since it may be different for each player. If ID 0 connects, the TDs might be ID 0, 1, 2 for him, but a second player might get different IDs if there is anything different in the order and overwrite the slots that were saved for ID 0. From then on ID 0's TextDraw IDs are lost and show/hide functions will show other TextDraws than intended.
That is where many TD related problems come from (mixing IDs, show/hide having no effect, etc).

If you are absolutely sure the IDs always have the same order, you can do that. But otherwise you should save them per-player, especially TextDraws that are created/destroyed during runtime.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)