Something wrong?
#1

Is there something wrong here?
PHP код:
SetSpawnInfo(playerid0ZOMBIE_SKINZombieSpawns[spawn][0], ZombieSpawns[spawn][1], ZombieSpawns[spawn][2], 000000); 
It says that the number of arguments doesn't match definition. Here's the SetSpawnInfo wiki link [click me]
Reply
#2

You forgot the angle in which the player will spawn, after the z coord.
Reply
#3

It's in. I forgot to send my full code. Here it is. It's a FS. [click me]
Reply
#4

If you count, you only filled in 12 of the 13 arguments. If you added 0.0 after the z coord, it will be fixed.
Reply
#5

So, the warning is fixed. Only problem is that the NPC won't spawn. Here's the new paste [click me]
Reply
#6

I've never worked much with NPCs and how they worked, but I'm pretty sure it doesn't spawn because you're trying to spawn the NPC under OnPlayerSpawn. That callback is called only when a player/npc is spawned, so there will be no effect under OnPlayerSpawn. You'll have to set the zombie's pos and spawn them in a different callback.
Reply
#7

So, what do you suggest me to do?
Reply
#8

Have the NPCs spawn under OnPlayerConnect.
Reply
#9

Something like this?
PHP код:
public OnPlayerConnect(playerid)
{
    
ApplyAnimation(playerid"BOMBER""null"000001);
    
ApplyAnimation(playerid"PED""null"000001);
    if(
IsPlayerNPC(playerid))
    {
        new 
spawn random(sizeof(ZombieSpawns));
        
SetSpawnInfo(playerid0ZOMBIE_SKINZombieSpawns[spawn][0], ZombieSpawns[spawn][1], ZombieSpawns[spawn][2], 0.0000000);
        
SpawnPlayer(playerid);
        
SetRNPCHealth(playeridZOMBIE_HEALTH);
        
SetPlayerColor(playeridZOMBIE_COLOR);
        
RNPC_SetShootable(playerid1);
        
RNPC_ToggleVehicleCollisionCheck(playerid1);
        
GetZombieVictimID[playerid] = INVALID_PLAYER_ID;
        return 
1;
    }
    else
    {
        
GetVictimDetectRange[playerid] = ZOMBIE_DETECT;
        
GetVictimTimerStatus[playerid] = 0;
    }
    return 
1;
}
public 
OnPlayerSpawn(playerid)
{
    return 
1;

Reply
#10

pawn Код:
if(IsPlayerNPC(playerid))
    {
        new spawn = random(sizeof(ZombieSpawns));
        SetSpawnInfo(playerid, 0, ZOMBIE_SKIN, ZombieSpawns[spawn][0], ZombieSpawns[spawn][1], ZombieSpawns[spawn][2], 0.0, 0, 0, 0, 0, 0, 0);
        SpawnPlayer(playerid);

        SetRNPCHealth(playerid, ZOMBIE_HEALTH);
        SetPlayerColor(playerid, ZOMBIE_COLOR);

        RNPC_SetShootable(playerid, 1);
        RNPC_ToggleVehicleCollisionCheck(playerid, 1);

        GetZombieVictimID[playerid] = INVALID_PLAYER_ID;
        return 1;
    }
    else
    {
        GetVictimDetectRange[playerid] = ZOMBIE_DETECT;
        GetVictimTimerStatus[playerid] = 0;
    }
I think this is all that needs to be put in there, the animations won't matter as far as I know if they're in OnPlayerConnect.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)