It won't spawn - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: It won't spawn (
/showthread.php?tid=267381)
It won't spawn -
Outcast - 08.07.2011
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);
Re: It won't spawn -
Jeffry - 08.07.2011
Because you cannot attach the DynamicObjects, since this is no function.
You have to use CreateObject instead. Then it will work.
Jeffry
Re: It won't spawn -
Outcast - 08.07.2011
Thanks, it works now. How can I delete it? I tried with DestroyObject but nothing happens.
Re: It won't spawn -
Vince - 08.07.2011
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.