Invalid function or declaration
#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


Messages In This Thread
Invalid function or declaration - by DarkMythHunter - 16.12.2018, 09:53
Re: Invalid function or declaration - by Kaliber - 16.12.2018, 09:58
Re: Invalid function or declaration - by DarkMythHunter - 16.12.2018, 10:00
Re: Invalid function or declaration - by Threshold - 16.12.2018, 11:52
Re: Invalid function or declaration - by DarkMythHunter - 16.12.2018, 12:13
Re: Invalid function or declaration - by Threshold - 16.12.2018, 12:59
Re: Invalid function or declaration - by DarkMythHunter - 16.12.2018, 13:03
Re: Invalid function or declaration - by Kaliber - 17.12.2018, 08:27
Re: Invalid function or declaration - by DarkMythHunter - 17.12.2018, 12:22
Re: Invalid function or declaration - by Kaliber - 17.12.2018, 12:37

Forum Jump:


Users browsing this thread: 3 Guest(s)