16.12.2018, 13:03
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;
}
Код:
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;
PHP код:
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;