SA-MP Forums Archive
error 006: must be assigned to an array(To array set string) - 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: error 006: must be assigned to an array(To array set string) (/showthread.php?tid=315112)



error 006: must be assigned to an array(To array set string) - gamelaster - 01.02.2012

new labeltext[15];
new labelcolor[15];
labeltext[id] = "Stlacenim enter sa dostanete do editoru";//error 006: must be assigned to an array
labelcolor[id] = "CERVENA";//error 006: must be assigned to an array

If is bad category, please, move, this is my first topic and im ban in english


Re: error 006: must be assigned to an array(To array set string) - Sinner - 01.02.2012

You can't declare strings like that.

Try:
pawn Code:
format(labeltext, sizeof(labeltext), "Stlacenim enter sa dostanete do editoru");
format(labelcolor, sizeof(labelcolor), "CERVENA");



Re: error 006: must be assigned to an array(To array set string) - FireCat - 01.02.2012

Quote:
Originally Posted by Sinner
View Post
You can't declare strings like that.

Try:
pawn Code:
format(labeltext, sizeof(labeltext), "Stlacenim enter sa dostanete do editoru");
format(labelcolor, sizeof(labelcolor), "CERVENA");
No.
pawn Code:
new labeltext[15][128];
new labelcolor[15][128];
labeltext[id] = "Stlacenim enter sa dostanete do editoru";//error 006: must be assigned to an array
labelcolor[id] = "CERVENA";//error 006: must be assigned to an array



Re: error 006: must be assigned to an array(To array set string) - RyDeR` - 01.02.2012

Nvm. confused with another language.


Re: error 006: must be assigned to an array(To array set string) - gamelaster - 02.02.2012

Quote:
Originally Posted by FireCat
View Post
No.
pawn Code:
new labeltext[15][128];
new labelcolor[15][128];
labeltext[id] = "Stlacenim enter sa dostanete do editoru";//error 006: must be assigned to an array
labelcolor[id] = "CERVENA";//error 006: must be assigned to an array
Ok, its function..... thx