error 020: invalid symbol name ""
#1

I got a problem with this code

Error:

Код:
error 020: invalid symbol name ""
error 010: invalid function or declaration // that is at the end of the array
warning 203: symbol is never used: "" // end of gamemode
I'm trying to make a tuning system, but I have to get all the components.
My array is 4D and I'm using Zeex's Compiler

Here's the code

PHP код:
new AllComponents[MAX_COMPONENTS][ArrayComponent][MAX_COMPONENTS] = {
    {
1000"Pro Spoiler"CARMODTYPE_SPOILERCertainCars_1},
    {
1001"Win Spoiler"CARMODTYPE_SPOILERCertainCars_2}, //Line
    
{1002"Drag Spoiler"CARMODTYPE_SPOILERCertainCars_3},
    {
1003"Alpha Spoiler"CARMODTYPE_SPOILERCertainCars_4},
    {
1004"Champ Scoop"CARMODTYPE_HOODCertainCars_5},
    {
1005"Fury Scoop"CARMODTYPE_HOODCertainCars_5},
    {
1006"Roof Scoop"CARMODTYPE_HOODCertainCars_6},
    {
1007"Right Sideskirt"CARMODTYPE_SIDESKIRTCertainCars_7},
    {
1008"Nitro 5x"CARMODTYPE_NITROMostCars},
    {
1009"Nitro 2x"CARMODTYPE_NITROMostCars},
    {
1010"Nitro 10x"CARMODTYPE_NITROMostCars},
    {
1011"Race Scoop"CARMODTYPE_HOODCertainCars_8},
    {
1012"Worx Scoop"CARMODTYPE_HOODCertainCars_8},
    {
1013"Round Fog"CARMODTYPE_LAMPSCertainCars_9},
    {
1014"Champ Spoiler"CARMODTYPE_SPOILERCertainCars_10},
    {
1015"Race Spoiler"CARMODTYPE_SPOILERCertainCars_11},
    {
1016"Worx Spoiler"CARMODTYPE_SPOILERCertainCars_12},
    {
1017"Left Sideskirt"CARMODTYPE_SIDESKIRTCertainCars_13},
    {
1018"Upswept"CARMODTYPE_EXHAUSTMostCars_2},
    {
1019"Twin"CARMODTYPE_EXHAUSTMostCars_3},
    {
1020"Large"CARMODTYPE_EXHAUSTMostCars_4},
    {
1021"Medium"CARMODTYPE_EXHAUSTMostCars_4}, .... 
PHP код:
new CertainCars_2[] = {401405410415420426436439496518527529540546549550580603}; 
Reply
#2

Quote:
Originally Posted by ******
Посмотреть сообщение
You can't include an array in another array like that. And even if you could, the declaration is wrong - that's not how you make just one slot of an enum array-like.
So what should I do to solve this problem?

I forgot to say the ArrayComponent is an enum

PHP код:
enum ArrayComponent
{
    
cID,
    
cName[24],
    
cType
}; 
Reply
#3

Quote:
Originally Posted by ******
Посмотреть сообщение
Move the second `MAX_COMPONENTS` in to the enum, and define the `401, 405 410` etc inline. You could also use a bit-array for that, which would give `O(1)` lookup to see if a can can use the component. Also, looking again, I doubt `MAX_COMPONENTS` is what you want for that final dimension since it needs to specify the number of vehicles to which the component can be applied, not the number of components that exist.
How can I use bit array for this?
Reply
#4

Thanks ******, I solved it.
Reply
#5

Up, anyone? I got another problem with the same code, When I try to use

PHP код:
format(strcomponentsizeof(strcomponent), "%s"AllComponents[0][cName][CARMODTYPE_SPOILER][vehiclemodel]); 
It gave me that:

Код:
error 010: invalid function or declaration
error 001: expected token: ",", but found "["
error 029: invalid expression, assumed zero
warning 215: expression has no effect
error 001: expected token: ";", but found "]"
 fatal error 107: too many error messages on one line
All in the same line.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)