Invalid function or declaration
#1

Код:
Utils/Zombies.pwn(87) : error 010: invalid function or declaration
Utils/Zombies.pwn(89) : error 010: invalid function or declaration
Utils/Zombies.pwn(91) : error 010: invalid function or declaration
Utils/Zombies.pwn(92) : error 010: invalid function or declaration
Utils/Zombies.pwn(93) : error 010: invalid function or declaration
Utils/Zombies.pwn(94) : error 010: invalid function or declaration
Utils/Zombies.pwn(95) : error 010: invalid function or declaration
Utils/Zombies.pwn(96) : error 010: invalid function or declaration
Utils/Zombies.pwn(97) : error 010: invalid function or declaration
Utils/Zombies.pwn(98) : error 010: invalid function or declaration
Utils/Zombies.pwn(99) : error 010: invalid function or declaration
Utils/Zombies.pwn(100) : error 010: invalid function or declaration
Utils/Zombies.pwn(101) : error 010: invalid function or declaration
Utils/Zombies.pwn(102) : error 010: invalid function or declaration
Utils/Zombies.pwn(103) : error 010: invalid function or declaration
Utils/Zombies.pwn(104) : error 010: invalid function or declaration
Utils/Zombies.pwn(105) : error 010: invalid function or declaration
Utils/Zombies.pwn(106) : error 010: invalid function or declaration
Utils/Zombies.pwn(107) : error 010: invalid function or declaration
Utils/Zombies.pwn(108) : error 010: invalid function or declaration
Utils/Zombies.pwn(109) : error 010: invalid function or declaration
Utils/Zombies.pwn(110) : error 010: invalid function or declaration
Utils/Zombies.pwn(111) : error 010: invalid function or declaration
Utils/Zombies.pwn(112) : error 010: invalid function or declaration
Utils/Zombies.pwn(113) : error 010: invalid function or declaration
Utils/Zombies.pwn(114) : error 010: invalid function or declaration
PHP код:
            default :
            {
                switch(
random(25))
                {
                    case 
0zInfo[o][zItem] = ITEM_ID_CIVILIAN_SKIN;
                    case 
1zInfo[o][zItem] = ITEM_ID_KNIFE;
                    case 
2zInfo[o][zItem] = ITEM_ID_GOLF_CLUB;
                    case 
3zInfo[o][zItem] = ITEM_ID_GAS_CAN;
                    case 
4zInfo[o][zItem] = ITEM_ID_LIGHTER;
                    case 
5zInfo[o][zItem] = ITEM_ID_MATCHES;
                    case 
6zInfo[o][zItem] = ITEM_ID_WATCH;
                    case 
7zInfo[o][zItem] = ITEM_ID_ROPE;
                    case 
8zInfo[o][zItem] = ITEM_ID_FISHING_ROD;
                    case 
9zInfo[o][zItem] = ITEM_ID_GAS_MASK;
                    case 
10zInfo[o][zItem] = ITEM_ID_MOTOCROSS_HELMET;
                    case 
11zInfo[o][zItem] = ITEM_ID_CROWBAR;
                    case 
12zInfo[o][zItem] = Iter_Random(Item_Food);
                    case 
13zInfo[o][zItem] = ITEM_ID_WOOD;
                    case 
14zInfo[o][zItem] = ITEM_ID_CLOTH;
                    case 
15zInfo[o][zItem] = ITEM_ID_RUBBER;
                    case 
16zInfo[o][zItem] = ITEM_ID_EMPTY_WATER_BOTTLE;
                    case 
17zInfo[o][zItem] = ITEM_ID_EMPTY_JERRY_CAN;
                    case 
18zInfo[o][zItem] = ITEM_ID_DRYBAG;
                    case 
19zInfo[o][zItem] = ITEM_ID_ALICE_BACKPACK;
                    case 
20zInfo[o][zItem] = ITEM_ID_SUICEPACK;
                    case 
21zInfo[o][zItem] = ITEM_ID_BAIT;
                    case 
22zInfo[o][zItem] = ITEM_ID_CIGARETTE;
                    case 
23zInfo[o][zItem] = ITEM_ID_PACKCIGARRETES;
                    case 
24zInfo[o][zItem] = ITEM_ID_DIRTY_WATER_BOTTLE;
                }
            } 
Anyone knows what is the problem? Is it because of the "default"? Because the other one uses "case <skin id> : " and it works fine, it is just this part of the script which uses "default".
Reply
#2

Can you show, how you declared these things?
Reply
#3

Quote:
Originally Posted by Kaliber
Посмотреть сообщение
Can you show, how you declared these things?
Is this what you mean?


PHP код:
CODE REMOVED 
Reply
#4

We need to see where you define zInfo and preferably the enumerator you use in it.
Reply
#5

PHP код:
new str[14], _rand random(sizeof(ZombiesSpawnCords)), _thenpc;
    for(new 
oo<MAX_ZOMBIESo++)
    {
        
_rand random(sizeof(ZombiesSpawnCords));
        
format(strsizeof(str), "Zombie_%d"_thenpc);
        
        
_thenpc FCNPC_Create(str);
        
FCNPC_Spawn(_thenpcrandom(311), ZombiesSpawnCords[_rand][0], ZombiesSpawnCords[_rand][1], ZombiesSpawnCords[_rand][2] + 1.0);
        
zInfo[o][zLabel] = CreateDynamic3DTextLabel(""COL_RED"Roamer Zombie\n"COL_WHITE"Health: 100", -10.00.00.220.0, .attachedplayer _thenpc, .testlos 1);
        
zInfo[o][zID] = _thenpc;
        
zInfo[o][zType] = ZOMBIE_TYPE_ROAMER
Reply
#6

We need to see 'new zInfo[...' and the 'enum' that is used in zInfo..
Reply
#7

PHP код:
GetZombieName(zombieid)
{
    new 
_outPut[14];
    switch(
zInfo[zombieid][zType])
    {
        case 
ZOMBIE_TYPE_ROAMER strcpy(_outPut"Roamer Zombie"sizeof(_outPut));
        case 
ZOMBIE_TYPE_BITER strcpy(_outPut"Biter Zombie"sizeof(_outPut));
        case 
ZOMBIE_TYPE_TANK strcpy(_outPut"Tank Zombie"sizeof(_outPut));
        case 
ZOMBIE_TYPE_BOSS strcpy(_outPut"Boss Zombie"sizeof(_outPut));
    }
    return 
_outPut;

I think it's this. If not, then there's nothing. I also somehow fixed the problem, since it doesn't appear in errors now. But this appears now:

Код:
Utils/Zombies.pwn(24) : warning 219: local variable "o" shadows a variable at a preceding level
Utils/Zombies.pwn(31) : error 029: invalid expression, assumed zero
Utils/Zombies.pwn(31) : warning 215: expression has no effect
Utils/Zombies.pwn(31) : error 001: expected token: ";", but found "]"
Utils/Zombies.pwn(31) : error 029: invalid expression, assumed zero
Utils/Zombies.pwn(31) : fatal error 107: too many error messages on one line
Код:
]
CreateRoamerZombies()
{
	new str[14], _rand = random(sizeof(ZombiesSpawnCords)), _thenpc;
	for(new o; o<MAX_ZOMBIES; o++)
	{
		_rand = random(sizeof(ZombiesSpawnCords));
		format(str, sizeof(str), "Zombie_%d", _thenpc);
		
		_thenpc = FCNPC_Create(str);
		FCNPC_Spawn(_thenpc, random(311), ZombiesSpawnCords[_rand][0], ZombiesSpawnCords[_rand][1], ZombiesSpawnCords[_rand][2] + 1.0);
		zInfo[o][zLabel] = CreateDynamic3DTextLabel(""COL_RED"Roamer Zombie\n"COL_WHITE"Health: 100", -1, 0.0, 0.0, 0.2, 20.0, .attachedplayer = _thenpc, .testlos = 1);
		zInfo[o][zID] = _thenpc;
		zInfo[o][zType] = ZOMBIE_TYPE_ROAMER;
The one in bold are the lines in the error. Here it is in php (used code cuz I cant use htmls)
PHP код:
CreateRoamerZombies()
{
    new 
str[14], _rand random(sizeof(ZombiesSpawnCords)), _thenpc;
    for(new 
oo<MAX_ZOMBIESo++)
    {
        
_rand random(sizeof(ZombiesSpawnCords));
        
format(strsizeof(str), "Zombie_%d"_thenpc);
        
        
_thenpc FCNPC_Create(str);
        
FCNPC_Spawn(_thenpcrandom(311), ZombiesSpawnCords[_rand][0], ZombiesSpawnCords[_rand][1], ZombiesSpawnCords[_rand][2] + 1.0);
        
zInfo[o][zLabel] = CreateDynamic3DTextLabel(""COL_RED"Roamer Zombie\n"COL_WHITE"Health: 100", -10.00.00.220.0, .attachedplayer _thenpc, .testlos 1);
        
zInfo[o][zID] = _thenpc;
        
zInfo[o][zType] = ZOMBIE_TYPE_ROAMER
Reply
#8

This shows us, just where you use it.

Not how you declared it.

We need to see the
PHP код:
new zInfo 
Code and the defines of
PHP код:
ITEM_ID_CIVILIAN_SKIN 
Reply
#9

I don't see anything related about that. I don't even know myself if the script works correctly, that is why I am asking for help. I've sent the code, for you to check yourself tho.
Reply
#10

We can't help you without that information.

And btw you send me nothing relevant.

As mentioned now 3 times, we need something like new zInfo

maybe its in an include..or somewhere else..it must be there..so, yeah check it out xD
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)