samp.directory
← Scripts and libraries

MichaelBelgium/PlayerCameraRotateFromPoint

A San Andreas Multiplayer include to let the camera of a player rotate around a position.

Library★ 7updated Nov 2023MITPawnsampctl
Open on GitHub

Install with sampctl

sampctl package install MichaelBelgium/PlayerCameraRotateFromPoint

Run this in your project folder. sampctl downloads the package and what it depends on.

Try it in the Pawn compiler →

Adds its include files, with the libraries it depends on, to the Pawn compiler in your browser, ready to include in a script.

Depends on 1 package

README.md

PlayerCameraRotateFromPoint

A San Andreas Multiplayer include to let the camera of a player rotate around a position.

Functions

native PlayerCameraRotateFromPoint(playerid, Float:x, Float:y, Float:z, Float:range, cam_speed = 3, bool: cam_overview = false, Float: cam_overview_height = 20.0);
native StopPlayerCameraRotate(playerid, bool:set_camera_behind = true);
native ContinuePlayerCameraRotate(playerid);
native SetPlayerCameraRotateToLeft(playerid);
native SetPlayerCameraRotateToRight(playerid);

Clarification

PlayerCameraRotateFromPoint

  • playerid - the id of the player to set the camera rotation
  • Float:x, Float:y, Float:z - the x, y and z position in-game.
  • Float: range - how far the camera should rotate from the position aka range.
  • cam_speed - the speed (in seconds) of the moving camera from stop to stop (Optional / Default = 3 seconds)
  • cam_overview - should the camera act like an "overview", meaning it'll look down to the position instead of otherwise. (Optional / Default = no)
  • cam_overview_height - the height of the camera that has to be added to the z position (so it can look down) (Optional / Default = 20)

StopPlayerCameraRotate

  • playerid - the id of the player to stop the camera rotation
  • bool: set_camera_behind - set camera behind player (Default = yes)

ContinuePlayerCameraRotate

  • playerid - the id of the player to continue the camera rotation

SetPlayerCameraRotateToLeft

  • playerid - the id of the player to set the camera rotation to left

SetPlayerCameraRotateToRight

  • playerid - the id of the player to set the camera rotation to right

Example/Installation

  • An example is located at example.pwn - just an edited bare.pwn
  • Download it manually or use sampctl: sampctl package install MichaelBelgium/PlayerCameraRotateFromPoint

Video

Here

Extra credits

  • robin_be for helping

This page is built from what GitHub publishes about the repository. samp.directory does not host the code. Report a problem with this listing

MichaelBelgium/PlayerCameraRotateFromPoint: SA-MP Library | samp.directory