PDA

View Full Version : "CreateDynamicActor"


darkwing
11/04/2019, 04:48 PM
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?

xRadical3
11/04/2019, 05:20 PM
You first should create a var for the actor..new MyActor;
Now CreateDynamicActor symbol take OnGameModeInit:

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:
SetDynamicActorPos(MyActor, Float:x, Float:y, Float:z);

darkwing
12/04/2019, 01:31 PM
I got error
undefined symbol "CreateDynamicActor"
How can I fix this error?

RenanMsV
12/04/2019, 01:41 PM
Did you include the streamer ?

#include <streamer>

darkwing
12/04/2019, 02:12 PM
Which version of streamer should I use?

RenanMsV
12/04/2019, 02:29 PM
the newest https://github.com/samp-incognito/samp-streamer-plugin/releases/tag/v2.9.4

darkwing
12/04/2019, 03:13 PM
SetDynamicActorPos doesn't work at OnPlayerUpdate. Actor disappears.

SiaReyes
12/04/2019, 05:50 PM
SetDynamicActorPos doesn't work at OnPlayerUpdate. Actor disappears.

SetDynamicActorPos should be put inside OnGamemodeInit()

Example

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;
}

NaS
12/04/2019, 06:00 PM
SetDynamicActorPos should be put inside OnGamemodeInit()

Example

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.

xRadical3
12/04/2019, 06:03 PM
SetDynamicActorPos should be put inside OnGamemodeInit()

Example

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?

SetDynamicActorPos doesn't work at OnPlayerUpdate. Actor disappears.
What do you want to make?

darkwing
12/04/2019, 08:48 PM
When "if(PlayerData[playerid][petTest] == 1)" i want to use SetDynamicActorPos at OnPlayerUpdate. Like actor following system.

darkwing
16/04/2019, 04:25 PM
++++

FireBoy89
16/04/2019, 10:25 PM
You should use FCNPC plugin then, Here is the link for you https://github.com/ziggi/FCNPC/releases

Logic_
18/04/2019, 05:21 PM
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.

darkwing
21/04/2019, 06:04 AM
can you send me a example of fcnpc_spawn and fcnpc_create?

darkwing
21/04/2019, 08:56 AM
http://prntscr.com/neterm what should I do? (FCNPC-2.0.0-rc.7)

darkwing
21/04/2019, 09:34 AM
I'am using this (https://github.com/ziggi/FCNPC/releases/tag/v2.0.0-rc.7-03DL) version.
/petcreate cmd:
PetData[i][petActor] = FCNPC_Create(isim);
FCNPC_Spawn(PetData[i][petActor], PetData[i][petSkin], PetData[i][petPos][0], PetData[i][petPos][1], PetData[i][petPos][2]);
It gives errors, and doesnt work.

darkwing
22/04/2019, 03:50 PM
++++

DIRTYBYT3
22/04/2019, 09:53 PM
On top on your code:
#include <a_actor> try that :rolleyes:

darkwing
23/04/2019, 06:01 AM
didn't work, setdynamicactorpos and FCNPC.