may i do this? - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: may i do this? (
/showthread.php?tid=65430)
may i do this? -
ғαιιοцт - 12.02.2009
Код:
Text:MenuInfo[menuid][T_Row[i]]
is it right to place []'s inside a [
.. here .. ]
I have an error but i don't know if it's because of this
error 028: invalid subscript (not an array or too many subscripts): "T_Row"
Re: may i do this? -
[RP]Rav - 12.02.2009
I'm a little confused as to what you're trying to do there
Re: may i do this? -
ғαιιοцт - 12.02.2009
Quote:
Originally Posted by Rav
I'm a little confused as to what you're trying to do there
|
but that doesn't really matter, i just need to know if i may do this in pawno
Re: may i do this? -
yom - 12.02.2009
Of course you can, but:
Код:
028 invalid subscript (not an array or too many subscripts): identifier
The subscript operators “[” and “]” are only valid with arrays.
The number of square bracket pairs may not exceed the number of dimensions of the array.
Re: may i do this? -
[RP]Rav - 12.02.2009
you can do it in a statement, like this
Код:
if (JobPay[ PlayerInfo[playerid][pJob] ] > 100) // random example
what you can't do is what you posted, declaring a variable like that
Re: may i do this? -
yom - 12.02.2009
He don't declare it
Re: may i do this? -
ғαιιοцт - 12.02.2009
Quote:
Originally Posted by 0rb
Of course you can, but:
Код:
028 invalid subscript (not an array or too many subscripts): identifier
The subscript operators “[” and “]” are only valid with arrays.
The number of square bracket pairs may not exceed the number of dimensions of the array.
|
than how do i need to do this? :S
i need to have more than 1 textdraw
i could do:
Код:
enum MInfo
{
Float:MenuX,
Float:MenuY,
Float:BoxLength,
Rows,
bool:Shown,
bool:UsedMenu,
Text:T_Title,
Text:T_Row1,
Text:T_Row2,
Text:T_Row3,
Text:T_Row4,
Text:T_Row5,
Text:T_Row6,
//...
}
new MenuInfo[F_MAX_MENUS][MInfo];
that'll work than, but to make it easier, i thought this:
Код:
enum MInfo
{
Float:MenuX,
Float:MenuY,
Float:BoxLength,
Rows,
bool:Shown,
bool:UsedMenu,
Text:T_Title,
Text:T_Row[F_MAX_MENU_ROWS],
}
new MenuInfo[F_MAX_MENUS][MInfo];
but than i get that error
Re: may i do this? -
[RP]Rav - 12.02.2009
I'd split it into MenuInfo and MenuTextDrawInfo, to avoid those problems
Re: may i do this? -
ғαιιοцт - 12.02.2009
Quote:
Originally Posted by Rav
I'd split it into MenuInfo and MenuTextDrawInfo, to avoid those problems
|
ok I'll try that
Re: may i do this? -
yom - 12.02.2009
Ok i've misread your first post anyway.
It's:
pawn Код:
MenuInfo[menuid][T_Row][i]