AttachCameraToObject

From SA-MP Wiki

Jump to: navigation, search


Description:

You can use this function to attach the player camera to objects.


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


Parameters:
(playerid, objectid)
playeridThe ID of the player which will have your camera attached on object.
objectidThe object id which you want to attach the player camera.


Return Values:

This function does not return any specific values.


Image:32px-Ambox_warning_orange.png

Note

You need to create the object first, before attempting to attach a player camera for that.


Example Usage:

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/attach", false))
    {
        new object = CreateObject(1245, 0.0, 0.0, 3.0, 0.0, 0.0, 0.0);
        AttachCameraToObject(playerid, object);
        SendClientMessage(playerid, 0xFFFFFFAA, "Your camera is attached on object now.");
        return 1;
    }
    return 0;
}

Related Functions

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

Personal tools
In other languages