Posts: 547
Threads: 57
Joined: Dec 2010
You forgot the angle in which the player will spawn, after the z coord.
Posts: 547
Threads: 57
Joined: Dec 2010
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.
Posts: 547
Threads: 57
Joined: Dec 2010
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.
Posts: 654
Threads: 161
Joined: Dec 2015
Reputation:
0
So, what do you suggest me to do?
Posts: 547
Threads: 57
Joined: Dec 2010
Have the NPCs spawn under OnPlayerConnect.
Posts: 547
Threads: 57
Joined: Dec 2010
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.