SetPlayerHoldingObject

From SA-MP Wiki

Jump to: navigation, search


Description:

Attaches an object to a bone.


SetPlayerHoldingObject was added in SA-MP 0.3b This function was added in SA-MP 0.3b and will not work in earlier versions!


Image:32px-Circle-style-warning.png

Warning

This function was removed in SA-MP 0.3c. check SetPlayerAttachedObject


Parameters:
(playerid, modelid, bone, Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ, Float:fRotX, Float:fRotY, Float:fRotZ)
playeridID of the player you want to attach the object to.
modelidThe model you want to use.
boneThe bone you want to attach the object to.
fOffsetX(optional) X axis offset for the object position.
fOffsetY(optional) Y axis offset for the object position.
fOffsetZ(optional) Z axis offset for the object position.
fRotX(optional) X axis rotation of the object.
fRotY(optional) Y axis rotation of the object.
fRotZ(optional) Z axis rotation of the object.

Return Values:

1 on success, 0 on failure


Image:32px-Ambox_warning_orange.png

Notes

  • Only one object may be attached per player.
  • This function is seperate from the CreateObject / CreatePlayerObject pools.


Example Usage:

public OnPlayerSpawn(playerid)
{
    SetPlayerHoldingObject(playerid, 1609, 2); //Attach a turtle to the playerid's head!
    return 1;
}

Related Functions

The following functions may be useful, as they are related to this function in one way or another.

StopPlayerHoldingObject - Removes the attached object.

Personal tools
Navigation
Toolbox