SA-MP Forums Archive
I need help with textdraws - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: I need help with textdraws (/showthread.php?tid=394910)



I need help with textdraws - andrew2695 - 24.11.2012

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



AW: I need help with textdraws - Nero_3D - 24.11.2012

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


Re: I need help with textdraws - RenSoprano - 24.11.2012

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);



Re: I need help with textdraws - andrew2695 - 24.11.2012

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


Re: I need help with textdraws - RenSoprano - 24.11.2012

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

new pSpecTD[MAX_PLAYERS][sSpecTD];



Re: I need help with textdraws - andrew2695 - 24.11.2012

It changes nothing