Weird error: invalid symbol name and invalid function or declaration - 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: Weird error: invalid symbol name and invalid function or declaration (
/showthread.php?tid=492532)
Weird error: invalid symbol name and invalid function or declaration -
Reboma - 04.02.2014
Hello,
I trying to write a simple variable to store the config values, but i get two errors:
- error 020: invalid symbol name ""
- error 010: invalid function or declaration
pawn Код:
#define CONF_SIZE 7
#define CONF_BASE (50)
new Conf[CONF_SIZE][3] =
{
{ 10, CONF_BASE, 0 },
{ 10 * 5, CONF_BASE * 5 * 1.05, 5 },
{ 10 * 10, CONF_BASE * 10 * 1.10, 10 }, // error 020: invalid symbol name ""
{ 10 * 50, CONF_BASE * 50 * 1.15, 15 },
{ 10 * 100, CONF_BASE * 100 * 1.20, 20 },
{ 10 * 500, CONF_BASE * 500 * 1.25, 25 },
{ 10 * 1000, CONF_BASE * 1000 * 1.30, 30 }
};// error 010: invalid function or declaration
I hope somebody can help me.
Re: Weird error: invalid symbol name and invalid function or declaration -
BullseyeHawk - 04.02.2014
You're attempting to declare float values inside an integer, by default. This is impossible, you need to go by another way.
pawn Код:
#define CONF_SIZE 7
#define CONF_BASE (50)
enum skeletonConf
{
skeleton_1,
Float:skeleton_2,
skeleton_3
}
new Conf[CONF_SIZE][skeletonConf];
// Usage:
/* Conf[0][skeleton_1] = 10;
Conf[0][skeleton_2] = CONF_BASE * 5 * 1.05;
Conf[0][skeleton_3] = 5; */