SA-MP Forums Archive
INVALID_TEXT_DRAW problem - 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: INVALID_TEXT_DRAW problem (/showthread.php?tid=444436)



INVALID_TEXT_DRAW problem - ajwar - 16.06.2013

https://sampwiki.blast.hk/wiki/Textdraw this tutorial recomends to initialize textdraw variables with Text:INVALID_TEXT_DRAW.

So if i set to:
pawn Код:
enum textdrawdata
{
Text:TextdrawTAXI1 = Text:INVALID_TEXT_DRAW,
Text:TextdrawTAXI2 = Text:INVALID_TEXT_DRAW,
Text:TextdrawTAXI3 = Text:INVALID_TEXT_DRAW,
Text:TextdrawTAXI4 = Text:INVALID_TEXT_DRAW,
Text:TextdrawTAXI5 = Text:INVALID_TEXT_DRAW,
Text:TextdrawTAXI6 = Text:INVALID_TEXT_DRAW
}
new textdraws[textdrawdata];
i can't see any textdraws. But if i create variables without Text:INVALID_TEXT_DRAW like:

pawn Код:
enum textdrawdata
{
Text:TextdrawTAXI1,
Text:TextdrawTAXI2,
Text:TextdrawTAXI3,
Text:TextdrawTAXI4,
Text:TextdrawTAXI,
Text:TextdrawTAXI6
}
new textdraws[textdrawdata];
Then they work fine and i can see them ;/.

What's the problem?


Re: INVALID_TEXT_DRAW problem - Jefff - 16.06.2013

So use

pawn Код:
new Text:TextdrawTAXI[6] = {Text:INVALID_TEXT_DRAW, ...};



Re: INVALID_TEXT_DRAW problem - ajwar - 16.06.2013

Why it's not working with enum ?


Re: INVALID_TEXT_DRAW problem - Pottus - 16.06.2013

You can't set values in an enum then initialize a variable with that enum and expect it to have the specified values.

Try this.

pawn Код:
#include <a_samp>

enum TestEnum {
    Test1 = 1,
    Test2 = 2,
    Test3 = 3
}

new TestVar[TestEnum];

public OnFilterScriptInit()
{
    printf("Test1: %i Test2: %i Test3: %i", TestVar[Test1], TestVar[Test2], TestVar[Test3]);

}

Result: Test1: 0 Test2: 0 Test3: 0