error 028: invalid subscript (not an array or too many subscripts) -
GuilhermeW - 25.09.2016
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
Re: error 028: invalid subscript (not an array or too many subscripts) -
JPedro - 25.09.2016
PHP код:
TextDrawSetString(TextoEvento, S);
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];
Re: error 028: invalid subscript (not an array or too many subscripts) -
GuilhermeW - 25.09.2016
@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?
Re: error 028: invalid subscript (not an array or too many subscripts) -
RedMF - 26.09.2016
Subistitui
Код:
new Text:TextoEvento;
Por
Код:
new Text:TextoEvento[MAX_PLAYERS];
Re: error 028: invalid subscript (not an array or too many subscripts) -
JPedro - 26.09.2016
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