INVALID_TEXT_DRAW problem
#1

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?
Reply
#2

So use

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

Why it's not working with enum ?
Reply
#4

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)