error 008: must be a constant expression; assumed zero
#1

Hello,

I have this code:
Код:
new barrierturn[5];

enum eMoving {
	command[64],
	objectid,
    Float:x,
    Float:y,
    Float:z,
    Float:rx,
    Float:ry,
    Float:rz,
    Float:nx,
    Float:ny,
    Float:nz,
    Float:nrx,
    Float:nry,
    Float:nrz
}
new moving [][eMoving]=
{
    {"Burrier1", barrierturn[0], -1701.43505859,687.79998779,24.79999924,0.00000000,270.00000000,90.00000000, -1701.43505859,687.79998779,24.79999924,0.00000000,0.00000000,90.00000000}
};
Код:
barrierturn[0] = CreateDynamicObject(968,-1701.43505859,687.79998779,24.79999924,0.00000000,270.00000000,90.00000000); //object(barrierturn) (1)
and this is my error:
D:\x.pwn(25) : error 008: must be a constant expression; assumed zero
on this line:
Код:
    {"Burrier1", barrierturn[0], -1701.43505859,687.79998779,24.79999924,0.00000000,270.00000000,90.00000000, -1701.43505859,687.79998779,24.79999924,0.00000000,0.00000000,90.00000000}
what to do?
Thanks.
Reply
#2

I'm pretty sure that's too many arrays for pawn. It only supports up to 2D arrays and having that many intertwined can cause issues.
Reply
#3

You cannot initialize a variable with another variable, unless the variable your trying to use is declared a constant, because the compiler does not know the value of a variable at compile time. So the culprit is this:
pawn Код:
new barrierturn[5];
Because it is not a constant.
Reply
#4

This Is what happens to me
error 008: must be a constant expression; assumed zero

}; <------- It says this it the Error Please Help

enum ZoneInfo
{
zone_name[27],
Float:zone_minx,
Float:zone_miny,
Float:zone_minz,
Float:zone_maxx,
Float:zone_maxy,
Float:zone_maxz
}
Reply
#5

new CCNR_Roby_Mainchat_Messages[][] =
{
// "Although there is no way for land vehicles to leave Las Venturas, Vortex's and Aircraft can.",
// "One is for the money... two is for the love!",
"There Are Houses All Over Las Venturas Which You Can Buy With IG Cash.",
"You can buy personal vehicles at Las Venturas Motors located near the Hospital/Airport.",
"You Can Purchase Master Degrees From Las Venturas University at Las Venturas Square.",
"Need help? Use /help and /faqs, or Use /askadmin For InGame Assistance.",
// "Hi, im the CCNR BOT, find me at Las Venturas Square.",
"Have You Registered At Our Forum Community? Forum: Coming Soon",
// "Donate today for epic features, items and more! coming",
// "Only at Vegas baby!",
"Welcome To The One And Only Chunk's Cops And Robbers aka CCNR.",
"Please Read /rules",
"What Ever Happens At CCNR Stays At CCNR",
"Spotted A Player Hacking/Cheating/Breaking Rules? Use /report",
// "Thank you, thank you very much!"
};

enum ZoneInfo
{
zone_name[27],
Float:zone_minx,
Float:zone_miny,
Float:zone_minz,
Float:zone_maxx,
Float:zone_maxy,
Float:zone_maxz
}

new Float:ZoneNames[][ZoneInfo] =
Reply
#6

Fixed it!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)