Actor isn't showing
#1

I'm tryign to create some actors to player interact inside of my bizz system, players will enter in a bizz and interact with the actor inside

But actores are not showing to anyone inside any bizz...

Creating:
Код:
    ActorInfo[1][actor] = CreateDynamicActor(142, -29.0206,-186.8182,1003.5469,1.6775);
    ActorInfo[2][actor] = CreateDynamicActor(194, -784.0207,498.3214,1371.7422,358.7583);
    ActorInfo[3][actor] = CreateDynamicActor(85, -104.7904,-8.9155,1000.7188,179.5211);
    ActorInfo[4][actor] = CreateDynamicActor(29, 203.2102,-41.6711,1001.8047,180.9758);
    ActorInfo[5][actor] = CreateDynamicActor(223, 206.3552,-98.7040,1005.2578,181.5066);
    ActorInfo[6][actor] = CreateDynamicActor(141, 162.8217,-81.1920,1001.8047,178.4857);
    ActorInfo[7][actor] = CreateDynamicActor(247, 499.7818,-77.5652,998.7651,359.4820);
    ActorInfo[8][actor] = CreateDynamicActor(248, -223.3083,1404.4515,27.7734,91.1681);
    ActorInfo[9][actor] = CreateDynamicActor(205, 376.4837,-65.8494,1001.5078,180.7589);
    ActorInfo[10][actor] = CreateDynamicActor(167, 368.1159,-4.4920,1001.8516,180.7917);
    ActorInfo[11][actor] = CreateDynamicActor(155, 374.7394,-117.2788,1001.4922,180.5908);
    ActorInfo[12][actor] = CreateDynamicActor(80, 765.9769,14.9000,1000.6997,179.8665);
    ActorInfo[13][actor] = CreateDynamicActor(180, -201.6477,-23.6123,1002.2734,150.1891);
    ActorInfo[14][actor] = CreateDynamicActor(156, 412.3363,-16.6506,1001.8047,180.2932);
    ServerStoreActors = 14;
    for(new a = 1; a < ServerStoreActors; a++) {
        SetDynamicActorInvulnerable(a, false);
        SetDynamicActorVirtualWorld(ActorInfo[a][actor], -1);
    }
When i get inside a bizz, the actor inside is not showing to me
There is a actor on pos -29.0206,-186.8182,1003.5469,1.6775

I've tried 24-7 ID:1 and ID:15
(VW:[1] INT:[17] ~ VW:[15] INT:[17)]

But he is not there

What do i doing wrong?

More actors code:
Код:
forward OnDynamicActorSpawn(actorid); public OnDynamicActorSpawn(actorid) {
    ActorInfo[actorid][adead] = false;
    new vw = GetDynamicActorVirtualWorld(actorid);
    SetDynamicActorVirtualWorld(actorid, -1);
    SetDynamicActorHealth(actorid, 100);
    ClearDynamicActorAnimations(actorid);
    SetDynamicActorVirtualWorld(actorid, vw);
}
Reply
#2

I found what was wrong...

How to set a actor to show in all virtual worlds? -1 is not working...
Reply
#3

Don't write the worldid and it will show up to all the virtual worlds i guess.
Reply
#4

You dynamic actor will already, by default, spawn in all virtual worlds and interiors. If you want to change that (this is the full function)
Код:
CreateDynamicActor(modelid, Float:x, Float:y, Float:z, Float:r, invulnerable = 1, Float:health = 100.0, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = STREAMER_ACTOR_SD, areaid = STREAMER_TAG_AREA -1, priority = 0)
Reply
#5

But the actors are invisible... I just search to SetDynamicActorVirtualWorld to make they visible when enter in a bizz.
If i dont set actor virtual world when i player enter inside a bizz, i cant see the actors
The problem is, if 2 players enter in different bizz, only one can see the actor

Thats the only way to actors show up:
Код:
CMD:enter(playerid) {
    for(new bizzid = 1; bizzid < MAX_BIZZ; bizzid++) {
        if(PlayerToPoint(1.0, playerid, BizzInfo[bizzid][bizzX], BizzInfo[bizzid][bizzY], BizzInfo[bizzid][bizzZ]))  {
            if(BizzInfo[bizzid][bizzType] == 1) {
                SetPlayerPos(playerid, -25.6487,-187.2130,1003.5469);
                SetPlayerVirtualWorld(playerid, bizzid);
                SetPlayerInterior(playerid, 17);
                SetDynamicActorVirtualWorld(ActorInfo[1][actor], bizzid);
            }

        }
    }
}
Is anyone know the way to fix it?
Reply
#6

Quote:
Originally Posted by binnyl
Посмотреть сообщение
But the actors are invisible... I just search to SetDynamicActorVirtualWorld to make they visible when enter in a bizz.
If i dont set actor virtual world when i player enter inside a bizz, i cant see the actors
The problem is, if 2 players enter in different bizz, only one can see the actor

Thats the only way to actors show up:
Код:
CMD:enter(playerid) {
    for(new bizzid = 1; bizzid < MAX_BIZZ; bizzid++) {
        if(PlayerToPoint(1.0, playerid, BizzInfo[bizzid][bizzX], BizzInfo[bizzid][bizzY], BizzInfo[bizzid][bizzZ]))  {
            if(BizzInfo[bizzid][bizzType] == 1) {
                SetPlayerPos(playerid, -25.6487,-187.2130,1003.5469);
                SetPlayerVirtualWorld(playerid, bizzid);
                SetPlayerInterior(playerid, 17);
                SetDynamicActorVirtualWorld(ActorInfo[1][actor], bizzid);
            }

        }
    }
}
Is anyone know the way to fix it?
I also had the same problem before.
Reply
#7

Quote:
Originally Posted by binnyl
Посмотреть сообщение
But the actors are invisible... I just search to SetDynamicActorVirtualWorld to make they visible when enter in a bizz.
If i dont set actor virtual world when i player enter inside a bizz, i cant see the actors
The problem is, if 2 players enter in different bizz, only one can see the actor

Thats the only way to actors show up:
Код:
CMD:enter(playerid) {
    for(new bizzid = 1; bizzid < MAX_BIZZ; bizzid++) {
        if(PlayerToPoint(1.0, playerid, BizzInfo[bizzid][bizzX], BizzInfo[bizzid][bizzY], BizzInfo[bizzid][bizzZ]))  {
            if(BizzInfo[bizzid][bizzType] == 1) {
                SetPlayerPos(playerid, -25.6487,-187.2130,1003.5469);
                SetPlayerVirtualWorld(playerid, bizzid);
                SetPlayerInterior(playerid, 17);
                SetDynamicActorVirtualWorld(ActorInfo[1][actor], bizzid);
            }

        }
    }
}
Is anyone know the way to fix it?
You need to set the virtual world in CreateDynamicActor (using -1 for the virtualworld parameter).
Alternatively use Streamer_SetIntData or Streamer_SetArrayData and use an array filled with all virtualworlds the Actor should appear in.

Код:
new virtualworlds[] = {12, 13, 14, 15};
Streamer_SetArrayData(STREAMER_TYPE_ACTOR, actorid, E_STREAMER_WORLD_ID, virtualworlds);
This is the best method to limit streamer items to certain worlds. Spawning them in all worlds is never the best solution if they should only be in certain shops or whatever, since they will also spawn when not in that interior.
Reply
#8

2 solutions:
- Makes appear the actor in every virtual worlds.
- Makes appear the actor in different virtual worlds that you store in an array and you need to use CreateDynamicActorEx.

Example:
PHP код:
new actors_vw[5];
for(new 
isizeof(actors_vw), i++)
    
actors_vw[i] = i+1;
CreateDynamicActorEx(modelidFloat:xFloat:yFloat:zFloat:r, .worlds actors_vw); // the actor will appear in virtual world 1 to 5 
Reply
#9

why you dont just use CreateActor?
Reply
#10

Quote:
Originally Posted by CodeStyle175
Посмотреть сообщение
why you dont just use CreateActor?
Why do you ask that?
There are multiple advantages using dynamic actors.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)