Closed enzogsierra closed 5 months ago
I just fixed it by defering bot spawn
public OnFilterScriptInit()
{
SetTimer("FCNPC_RespawnAll", 1000, false);
return 1;
}
forward FCNPC_RespawnAll();
public FCNPC_RespawnAll()
{
for(new i = MAX_PLAYERS - MAX_NPC; i < MAX_PLAYERS; i++)
{
FCNPC_Respawn(i);
}
return 1;
}
Now FCNPC_OnRespawn is being called normally
You should use FCNPC_OnInit
instead of OnFilterScriptInit
in filterscripts too.
You should use
FCNPC_OnInit
instead ofOnFilterScriptInit
in filterscripts too.
I thought FCNPC_OnInit was called only once (after plugin load). It works fine now, thanks!
So I've this gamemode code:
And this filterscript code:
For some reason, FCNPC_OnRespawn is not being called in my filterscript. I've to mention that I load it 1s after OnGameModeInit, at that point NPCs are created and first spawned. FCNPC_OnRespawn works fine in gamemode tho