You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public FCNPC_OnInit()
{
// Connect all npcs
for(new i = 0; i < MAX_NPC; i++)
{
new name[MAX_PLAYER_NAME];
format(name, sizeof(name), "npc_%i", MAX_PLAYERS - 1 - i);
FCNPC_Create(name);
}
}
public FCNPC_OnCreate(npcid)
{
FCNPC_SetHealth(npcid, 100.0);
FCNPC_Spawn(npcid, 3, 0.0, 0.0, 3.0);
return 1;
}
And this filterscript code:
public OnFilterScriptInit()
{
for(new i = MAX_PLAYERS - MAX_NPC; i < MAX_PLAYERS; i++)
{
FCNPC_Respawn(i);
}
return 1;
}
public FCNPC_OnRespawn(npcid) // Its never called
{
print("Respawn");
return 1;
}
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
The text was updated successfully, but these errors were encountered:
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
The text was updated successfully, but these errors were encountered: