How to createactor in interior
#1

Tried to change virtual world to 0 or to 1 still actor not showing in bank.

Outside the interior works fine, but in interiors doesn't appear.

PHP код:
new ActorBank1;
public 
OnGameModeInit()
{
    
ActorBank1 CreateActor(1872310.0420,-4.0016,26.7422,269.8781); // Actor in LV BANK
    
ApplyActorAnimation(ActorBank1"DEALER""shop_pay"4.100000);
    
SetActorVirtualWorld(ActorBank11);

Reply
#2

I remember I had some actors in one of my old scripts. They "fell" down from the interior after spawn and I often found them on the "normal" terrain (outta the interiors).

I didn't work that out as I didn't use any actor anymore yet, i think to players that get teleported in interiors. If coordinates aren't perfect, players can fall down from the interior and eventually die hitting an invisible ground.

So trying to fix actor's spawn coords may be a solution.
Reply
#3

Quote:
Originally Posted by v1k1nG
Посмотреть сообщение
I remember I had some actors in one of my old scripts. They "fell" down from the interior after spawn and I often found them on the "normal" terrain (outta the interiors).

I didn't work that out as I didn't use any actor anymore yet, i think to players that get teleported in interiors. If coordinates aren't perfect, players can fall down from the interior and eventually die hitting an invisible ground.

So trying to fix actor's spawn coords may be a solution.
How do i "fix" actor spawn coordinates?
Reply
#4

Make sure your coordinates spawn the player right on interior's ground, and not within ground/walls that could cause the actor to fall from the interior
Reply
#5

Check out what virtual world you have when you are in the bank and you set it up to the actor.
Reply
#6

Like mentioned already, actors will fall through the ground in interiors if the interior is close to the regular map because at that point the interior isn't loaded.
That's because they will always stream in regardless of interior.

To fix it, set the actors back to their location occassionally.

You can do this using a timer, OnActorStreamIn/Out or when a player enters the interior:

Код:
new Float:x, Float:y, Float:z;
GetActorPos(id, x, y, z);
SetActorPos(id, x, y, z);
The new position will not sync to the server so GetActorPos retrieves the original position.

Another good idea would be using the Streamer Plugin for Actors and reduce their streamdistance. By default actors have a quite high streamdistance (SAMP's default streamdistance) so they will start falling even though you cannot see them yet (they stream in way before they get rendered).
Reply
#7

Quote:
Originally Posted by NaS
Посмотреть сообщение
Like mentioned already, actors will fall through the ground in interiors if the interior is close to the regular map because at that point the interior isn't loaded.
That's because they will always stream in regardless of interior.

To fix it, set the actors back to their location occassionally.

You can do this using a timer, OnActorStreamIn/Out or when a player enters the interior:

Код:
new Float:x, Float:y, Float:z;
GetActorPos(id, x, y, z);
SetActorPos(id, x, y, z);
The new position will not sync to the server so GetActorPos retrieves the original position.

Another good idea would be using the Streamer Plugin for Actors and reduce their streamdistance. By default actors have a quite high streamdistance (SAMP's default streamdistance) so they will start falling even though you cannot see them yet (they stream in way before they get rendered).
It's solved. The problem was in virtual world. I forgot that in my gamemode script every interior has different virtual world.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)