[Ajuda] error 028: invalid subscript (not an array or too many subscripts)
#1

Boa tarde para todos, estou tentando compilar um cуdigo e estou obtendo os seguintes erros:

Код:
error 028: invalid subscript (not an array or too many subscripts)
warning 215: expression has no effect
error 001: expected token: ";", but found "]"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line
A linha dos erros no cуdigo й apenas esta:
Код:
TextDrawSetString(TextoEvento[I], S);
A variбvel referente a TextoEvento й esta:
Код:
new Text:TextoEvento;
Obrigado desde jб a todos que tentarem ajudar
Reply
#2

PHP код:
TextDrawSetString(TextoEventoS); 
caso vocк use o TextEvento para outros textdraws de mesmo nome

sу colocar new Text:TextEvento[]; // dentro dos colchetes vocк coloca a quantidade de textdraws

Exemplo:

Se vocк tem

PHP код:
TextEvento[0] = TextDrawCreate(.......
TextEvento[1] = TextDrawCreate(.......
TextEvento[2] = TextDrawCreate(....... 
Vocк usa:
PHP код:
new Text:TextEvento[3]; 
Reply
#3

@Edit:
Sу pra constar, eu sу tenho uma TextDraw TextoEvento, nenhuma a mais, entгo nгo tem necessidade alguma de colchetes.

Tem uns [I], tipo no lugar de [playerid] tem algo hб ver? Pode ser esse o problema?
Reply
#4

Subistitui
Код:
new Text:TextoEvento;
Por
Код:
new Text:TextoEvento[MAX_PLAYERS];
Reply
#5

Quote:
Originally Posted by GuilhermeW
Посмотреть сообщение
@Edit:
Sу pra constar, eu sу tenho uma TextDraw TextoEvento, nenhuma a mais, entгo nгo tem necessidade alguma de colchetes.

Tem uns [I], tipo no lugar de [playerid] tem algo hб ver? Pode ser esse o problema?
Se tem um i no dentro dos colchetes й por que deve ter algum loop que nesses textdraws, mas se Nгo hб necessidade sу tirar os colchetes e deixar sу o TextEvento, vocк usaria o MAX_PLAYERS se o teu textdraw fosse per-player e criaria 1 textdraw por jogador, mas se for fazer deste jeito recomendo que use o PlayerTextDraw e nгo o TextDraw global

https://sampwiki.blast.hk/wiki/CreatePlayerTextDraw
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)