19.03.2009, 12:40
I have one question: how do I make camera spin around player? i want to make, but nothing is happening to me.. Please help.
Originally Posted by ʞɹod ɹǝpıds || SpiderPork
|
new Float:x, Float:y, Float:z, Float:a;
public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp(cmdtext, "/lol"))
{
GetPlayerFacingAngle(0, a); //the start angle (camera will start spining from the back of the player)
SetTimer("SpinCam", 10, true); //run the timer to move camera
return true;
}
return false;
}
forward SpinCam();
public SpinCam()
{
GetPlayerPos(0, x, y, z);
SetPlayerCameraPos(0, x - 4 * floatsin(-a, degrees), y - 4 * floatcos(-a, degrees), z + 1); //move in perfect circle, at a radius of 4 units from the player.
//SetPlayerCameraPos(0, x - 4 * floatsin(-a, degrees), y - 7 * floatcos(-a, degrees), z + 1); //move in elipses, nice effect, test it!
SetPlayerCameraLookAt(0, x, y, z + 0.5);
if (a >= 360.0)
a = 0.0;
a += 0.5;
}
Originally Posted by Nubotron
It is simple, here is a exempel:
pawn Код:
|