AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   new syntax consts (https://forums.alliedmods.net/showthread.php?t=317920)

Grzyboo 08-04-2019 16:06

new syntax consts
 
How do i declare const arrays in the "new" syntax?


Code:

new const String:CONST_STRING_1[] = "models/1.mdl";    // compiles
const char[] CONST_STRING_2 = "models/2.mdl";          // error 001: expected token: "=", but found "["
const char CONST_STRING_3[] = "models/3.mdl";          // error 001: expected token: "=", but found "["

Same with ints
Code:

new const COLOR_RED[4] = {255, 0, 0, 255};      // compiles
const int COLOR_BLUE[4] = {0, 255, 0, 255};    // error 001: expected token: "=", but found "["


asherkin 08-04-2019 17:50

Re: new syntax consts
 
You can't, it was never supported, just previously silently ignored.


All times are GMT -4. The time now is 13:53.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.