GetPlayerCameraMode

From SA-MP Wiki

Jump to: navigation, search


GetPlayerCameraMode was added in SA-MP 0.3c This function was added in SA-MP 0.3c R3 and will not work in earlier versions!


Description:

Returns the current GTA camera mode for the requested player. The camera modes are useful in determining whether a player is aiming, doing a passenger driveby etc.


Parameters:
(playerid)
playeridThe ID of the player whose camera mode to retrieve


Return Values:

The camera mode as an integer (or -1 if player is not connected)


Example Usage:

/* when the player types 'cameramode' in to the chat box, they'll see this. */
public OnPlayerText(playerid, text[])
{
    if(strcmp(text, "cameramode", true) == 0)
    {
        new szMessage[22];
        format(szMessage, sizeof(szMessage), "Your camera mode: %d", GetPlayerCameraMode(playerid));
        SendClientMessage(playerid, 0xA9C4E4FF, szMessage);
    }
    return 0;
}

Related Functions

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

Personal tools
Navigation
Toolbox