fork download
  1. /* LookCameraAtPlayer INCLUDE
  2.  *
  3.  * (c) Copyright 2013, Thugman.
  4.  * Written by Thugman
  5.  *
  6.  */
  7.  
  8. /*
  9.  FUNCTION:
  10.  LookCameraAtPlayer(playerid, Float:distance);
  11. */
  12.  
  13. LookCameraAtPlayer(playerid, Float:distance)
  14. {
  15. new Float:x,Float:y,Float:z,Float:a;
  16. GetPlayerPos(playerid, x, y,z);
  17. GetPlayerFacingAngle(playerid, a);
  18. x += (distance * floatsin(-a, degrees));
  19. y += (distance * floatcos(-a, degrees));
  20. SetPlayerCameraPos(playerid, x, y, z);
  21. GetPlayerPos(playerid, x, y,z);
  22. SetPlayerCameraLookAt(playerid, x, y, z);
  23. }
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty