(objectid, playerid, Float:OffsetX, Float:OffsetY, Float:OffsetZ, Float:rX, Float:rY, Float:rZ)
objectid
The ID of the object to attach to the player.
playerid
The ID of the player to attach the object to.
Float:OffsetX
The distance between the player and the object in the X direction.
Float:OffsetY
The distance between the player and the object in the Y direction.
Float:OffsetZ
The distance between the player and the object in the Z direction.
Float:RotX
The X rotation between the object and the player.
Float:RotY
The Y rotation between the object and the player.
Float:RotZ
The Z rotation between the object and the player.
new myobject;
myobject = CreateObject(19341, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
AttachObjectToPlayer(myobject, playerid, 1.5, 0.5, 0.0, 0.0, 1.5, 2);