• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] IsDynamicActorStreamedIn always returns 0
#1
Hey. In my mod there is a system which creates shop actors if a player goes inside, and destroys them when everybody went out.
Or at least that's the goal. Creating the actor works fine, as the mod detects if the actor is already created and doesnt spawn it again, etc.
But if anybody leaves the shop and my custom function gets called, the shop actor gets deleted immediately, no matter if someone else got the actor streamed in.

My code:
Code:
DestroyShopActorIfUnstreamed(virtualworldid)
{
? ? if (!IsValidDynamicActor(shopactor[virtualworldid])) return 1;
for(new i = 0; i < MAX_PLAYERS  1; i)
? ? {
? ? ? ? if (IsDynamicActorStreamedIn(shopactor[virtualworldid], i))
? ? ? ? {
? ? ? ? ? ? print("streamed");
? ? ? ? ? ?break;
? ? ? ? }
? ? printf("shopactor %i deleted", virtualworldid);
? ? DestroyDynamicActor(shopactor[virtualworldid]);
? ? }
return 1;
}

I know i messed up something with the code
  Reply


Messages In This Thread
IsDynamicActorStreamedIn always returns 0 - by c4p - 2021-01-13, 03:26 PM

Forum Jump: