Tag mismatch issue
#3

Quote:
Originally Posted by Eth
Посмотреть сообщение
try to change this

pawn Код:
new const Float: g_FireDefaultHealth[E_FIRE_TYPES] = {200.0, 300.0, 370.0, 500.0, 1000.0};
to
pawn Код:
const Float:g_FireDefaultHealth[E_FIRE_TYPES] = {200.0, 300.0, 370.0, 500.0, 1000.0};
If I remove the new tag, the compiler gives me an error on that line that says: expected token: "=", but found "[". It seems to understand g_FireDefaultHealth as an variable, and not an array.

EDIT: I've found two workarounds.

1)
Код:
new const g_FireDefaultHealth[E_FIRE_TYPES] = {200, 300, 370, 500, 1000};

// Whenever I need to access the value:
float(g_FireDefaultHealth[FIRE_TYPE])
2)
Код:
new const Float: g_FireDefaultHealth[E_FIRE_TYPES][1] = {{200.0}, {300.0}, {370.0}, {500.0}, {1000.0}};

// Whenever I need to access the value:
g_FireDefaultHealth[FIRE_TYPE][0]
It works, but really annoys me because I should be able to work with the initial code...
Reply


Messages In This Thread
Tag mismatch issue - by paulomu300 - 17.01.2016, 14:29
Re: Tag mismatch issue - by Eth - 17.01.2016, 14:33
Re: Tag mismatch issue - by paulomu300 - 17.01.2016, 14:37

Forum Jump:


Users browsing this thread: 1 Guest(s)