I need help with textdraws
#1

Hello, I'm getting some errors but I have no idea whats wrong with my code. Could anyone help me?
pawn Код:
enum sSpecTD
{
    Text:SpecTD[16],
};

new pSpecTD[MAX_PLAYERS][sSpecTD];


OnGameModeIni
for(new i = 0; i < MAX_PLAYERS; i++)
    {
        pSpecTD[i][SpecTD[0]] = TextDrawCreate(634.000000, 46.000000, "Box1");
        TextDrawBackgroundColor(pSpecTD[i][SpecTD[0]], 255);
        TextDrawFont(pSpecTD[i][SpecTD[0]], 1);
        TextDrawLetterSize(pSpecTD[i][SpecTD[0]], 0.500000, 9.699996);
        TextDrawColor(pSpecTD[i][SpecTD[0]], 0);
        TextDrawSetOutline(pSpecTD[i][SpecTD[0]], 0);
        TextDrawSetProportional(pSpecTD[i][SpecTD[0]], 1);
        TextDrawSetShadow(pSpecTD[i][SpecTD[0]], 0);
        TextDrawUseBox(pSpecTD[i][SpecTD[0]], 1);
        TextDrawBoxColor(pSpecTD[i][SpecTD[0]], 100);
        TextDrawTextSize(pSpecTD[i][SpecTD[0]], 486.000000, 0.000000);

        pSpecTD[i][SpecTD[1]] = TextDrawCreate(634.000000, 46.000000, "Box2");
        TextDrawBackgroundColor(pSpecTD[i][SpecTD[1]], 255);
        TextDrawFont(pSpecTD[i][SpecTD[1]], 1);
        TextDrawLetterSize(pSpecTD[i][SpecTD[1]], 0.500000, 1.200000);
        TextDrawColor(pSpecTD[i][SpecTD[1]], 0);
        TextDrawSetOutline(pSpecTD[i][SpecTD[1]], 0);
        TextDrawSetProportional(pSpecTD[i][SpecTD[1]], 1);
        TextDrawSetShadow(pSpecTD[i][SpecTD[1]], 0);
        TextDrawUseBox(pSpecTD[i][SpecTD[1]], 1);
        TextDrawBoxColor(pSpecTD[i][SpecTD[1]], 100);
        TextDrawTextSize(pSpecTD[i][SpecTD[1]], 487.000000, -1.000000);


and my 14 other textdraws for a total of 16.
pawn Код:
error 028: invalid subscript (not an array or too many subscripts): "SpecTD"
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
Reply
#2

You need to use it like that pSpecTD[i][SpecTD][0]
Reply
#3

pawn Код:
enum sSpecTD
{
    Text:SpecTD[16]
};

new pSpecTD[MAX_PLAYERS][sSpecTD];


public OnGameModeInit()
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        pSpecTD[i][SpecTD[0]] = TextDrawCreate(634.000000, 46.000000, "Box1");
        TextDrawBackgroundColor(pSpecTD[i][SpecTD[0]], 255);
        TextDrawFont(pSpecTD[i][SpecTD[0]], 1);
        TextDrawLetterSize(pSpecTD[i][SpecTD[0]], 0.500000, 9.699996);
        TextDrawColor(pSpecTD[i][SpecTD[0]], 0);
        TextDrawSetOutline(pSpecTD[i][SpecTD[0]], 0);
        TextDrawSetProportional(pSpecTD[i][SpecTD[0]], 1);
        TextDrawSetShadow(pSpecTD[i][SpecTD[0]], 0);
        TextDrawUseBox(pSpecTD[i][SpecTD[0]], 1);
        TextDrawBoxColor(pSpecTD[i][SpecTD[0]], 100);
        TextDrawTextSize(pSpecTD[i][SpecTD[0]], 486.000000, 0.000000);

        pSpecTD[i][SpecTD[1]] = TextDrawCreate(634.000000, 46.000000, "Box2");
        TextDrawBackgroundColor(pSpecTD[i][SpecTD[1]], 255);
        TextDrawFont(pSpecTD[i][SpecTD[1]], 1);
        TextDrawLetterSize(pSpecTD[i][SpecTD[1]], 0.500000, 1.200000);
        TextDrawColor(pSpecTD[i][SpecTD[1]], 0);
        TextDrawSetOutline(pSpecTD[i][SpecTD[1]], 0);
        TextDrawSetProportional(pSpecTD[i][SpecTD[1]], 1);
        TextDrawSetShadow(pSpecTD[i][SpecTD[1]], 0);
        TextDrawUseBox(pSpecTD[i][SpecTD[1]], 1);
        TextDrawBoxColor(pSpecTD[i][SpecTD[1]], 100);
        TextDrawTextSize(pSpecTD[i][SpecTD[1]], 487.000000, -1.000000);
Reply
#4

I'm lost i replaced all of them and now i get
pawn Код:
array index out of bounds (variable "pSpecTD")
But this is not my textdraws
Reply
#5

pawn Код:
enum sSpecTD
{
    Text:SpecTD[17] // There are less textdraws if this doesn't work add +1
};

new pSpecTD[MAX_PLAYERS][sSpecTD];
Reply
#6

It changes nothing
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)