"CreateDynamicActor"
#1

How can I use the "CreateDynamicActor" symbol for my server? I tried many streamer plugin version but it didn't work. Example: SetDynamicActorPos didn't work. What should I do?
Reply
#2

You first should create a var for the actor..
pawn Code:
new MyActor;
Now CreateDynamicActor symbol take OnGameModeInit:
pawn Code:
public OnGameModeInit()
{
MyActor = CreateDynamicActor(modelid, Float:x, Float:y, Float:z, Float:r);
//(modelid = skin id, float x, float y, float z, r = angle)
return 1;
}
And how to use SetDynamicActorPos:
pawn Code:
SetDynamicActorPos(MyActor, Float:x, Float:y, Float:z);
Reply
#3

I got error
Code:
undefined symbol "CreateDynamicActor"
How can I fix this error?
Reply
#4

Did you include the streamer ?

#include <streamer>
Reply
#5

Which version of streamer should I use?
Reply
#6

the newest https://github.com/samp-incognito/sa...ses/tag/v2.9.4
Reply
#7

SetDynamicActorPos doesn't work at OnPlayerUpdate. Actor disappears.
Reply
#8

Quote:
Originally Posted by darkwing
View Post
SetDynamicActorPos doesn't work at OnPlayerUpdate. Actor disappears.
SetDynamicActorPos should be put inside OnGamemodeInit()

Example
pawn Code:
new MyActor[2];

public OnGameModeInit()
{
    // Actor 1 = MyActor[0]
     MyActor[0] = CreateDynamicActor(23, 0.0, 0.0, 0.0);
    SetDynamicActorPos(MyActor[0], 0.0, 0.0, 0.0);

    // Actor 2 = MyActor[1]
    MyActor[1] = CreateDynamicActor(23, 0.0, 0.0, 0.0);
    SetDynamicActorPos(MyActor[1], 0.0, 0.0, 0.0);

    return 1;
}
Reply
#9

Quote:
Originally Posted by SiaReyes
View Post
SetDynamicActorPos should be put inside OnGamemodeInit()

Example
pawn Code:
new MyActor[2];

public OnGameModeInit()
{
    // Actor 1 = MyActor[0]
     MyActor[0] = CreateDynamicActor(23, 0.0, 0.0, 0.0);
    SetDynamicActorPos(MyActor[0], 0.0, 0.0, 0.0);

    // Actor 2 = MyActor[1]
    MyActor[1] = CreateDynamicActor(23, 0.0, 0.0, 0.0);
    SetDynamicActorPos(MyActor[1], 0.0, 0.0, 0.0);

    return 1;
}
Why though? You already set the coords in CreateDynamicActor, so there's no need to set it again. It won't do anything.

The reason it might disappear is that the actual Actor gets recreated when using SetDynamicActorPos. This takes about 1-2 seconds depending on the update rate of the streamer and server.
If you call it very often in a short time (eg. OnPlayerUpdate) it will constantly be recreated, not allowing it to spawn in actually.

Use it less frequently.
Reply
#10

Quote:
Originally Posted by SiaReyes
View Post
SetDynamicActorPos should be put inside OnGamemodeInit()

Example
pawn Code:
new MyActor[2];

public OnGameModeInit()
{
    // Actor 1 = MyActor[0]
     MyActor[0] = CreateDynamicActor(23, 0.0, 0.0, 0.0);
    SetDynamicActorPos(MyActor[0], 0.0, 0.0, 0.0);

    // Actor 2 = MyActor[1]
    MyActor[1] = CreateDynamicActor(23, 0.0, 0.0, 0.0);
    SetDynamicActorPos(MyActor[1], 0.0, 0.0, 0.0);

    return 1;
}
When CreateDynamicActor symbol create the actor and set actor position why use the SetDynamicActorPos symbol after that?

Quote:
Originally Posted by darkwing
View Post
SetDynamicActorPos doesn't work at OnPlayerUpdate. Actor disappears.
What do you want to make?
Reply
#11

When "if(PlayerData[playerid][petTest] == 1)" i want to use SetDynamicActorPos at OnPlayerUpdate. Like actor following system.
Reply
#12

++++
Reply
#13

You should use FCNPC plugin then, Here is the link for you https://github.com/ziggi/FCNPC/releases
Reply
#14

Actors are static. NPC are bots. Use the one that is of your use. If you want to make moving peds or vehicles, use NPCs. If you want to create static or primarily non moving, then use actors.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)