How to attach PlayerObject to Player
#1

Hi, everyone.

I want to make the object that created by CreatePlayerObject function, attach to other player.
i mean, many players can attach PlayerObject to one player (this is NPC, and NPC don`t need PlayerObject)

this is my code.
Код:
NPCInfo[npcid][Mark][playerid] = CreatePlayerObject(playerid,18631, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
SetObjectMaterial(NPCInfo[npcid][Mark][playerid], 0, 1239, "icons6", "lyellow32", 0xFFFFFFFF);
AttachObjectToPlayer(NPCInfo[npcid][Mark][playerid], npcid, 0.0, 0.0, 1.2, 0.0, 0.0, 0.0);
this code is not working.
plz help me!

sorry for my bad english :3
Reply
#2

PHP код:
CreatePlayerObject 
creates an object which will be visible to only one player.

so use
PHP код:
CreateObject 
instead or
PHP код:
CreateDynamicObject 
.
Reply
#3

@PepsiCola23

If using CreateObject, all players can see the object.
i want to make object per player. just one player can see the object.
Reply
#4

@PepsiCola23

If using CreateObject, all players can see the object.
i want to make object per player. just one player can see the object.
Reply
#5

You'll want to look at the streamer for this, because just looking at https://sampwiki.blast.hk/wiki/AttachPlayerObjectToPlayer it doesn't look promising.


Streamer will have all the capability you want.
Reply
#6

you have to use an AttachPlayerObjectToPlayer instead of AttachObjectToPlayer
https://sampwiki.blast.hk/wiki/AttachPlayerObjectToPlayer
Reply
#7

Quote:
Originally Posted by Mugala
Посмотреть сообщение
you have to use an AttachPlayerObjectToPlayer instead of AttachObjectToPlayer
https://sampwiki.blast.hk/wiki/AttachPlayerObjectToPlayer
Removed in 0.3....... Hence why I said about it not looking promising.

Needs to use the streamer.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)