It won't spawn
#1

I want to spawn an object to a player, but it won't spawn. This is my code, is there something wrong with it?

pawn Код:
pAttachedPrimary[playerid] = CreateDynamicObject(object, 0, 0, 0, 0, 0, 0, -1, -1, playerid, 200);
    AttachObjectToPlayer(pAttachedPrimary[playerid], playerid, -0.06,-0.13,-0.01,0.0,24.0,-1.0);
Reply
#2

Because you cannot attach the DynamicObjects, since this is no function.
You have to use CreateObject instead. Then it will work.

Jeffry
Reply
#3

Thanks, it works now. How can I delete it? I tried with DestroyObject but nothing happens.
Reply
#4

Have you considered using SetPlayerAttachedObject instead? When using this function, you do not have to create the object first. You can then use RemovePlayerAttachedObject in turn to remove it.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)