Jump to content
  • 0

MOVE CAMERA


ExTREME.

Question

3 answers to this question

Recommended Posts

[pawn]OnPlayerRequestClass >

if ( PlayerInfo[ playerid ][ SpawnDance ] ) PlayerInfo[ playerid ][ SpawnTimer ] = SetTimerEx( "MoveCamera", moving_speed, true, "i", playerid );

PlayerInfo[ playerid ][ SpawnDance ] = false; //preventing the timer to execute again[/pawn]

[pawn]forward MoveCamera( playerid );

public MoveCamera( playerid )

{

//this is called trigonometry. It makes the camera spin

//you can experiment with this line. Just change the values 2, 10 and 3 to make different effects

    SetPlayerCameraPos( playerid, player_x - 2 * floatsin( -PlayerInfo[ playerid ][ SpawnAngle ], degrees ), player_y - 10 * floatcos( -PlayerInfo[ playerid ][ SpawnAngle ], degrees ), player_z + 3 );

    SetPlayerCameraLookAt( playerid, player_x, player_y, player_z + 0.5 );

//changing the angle a little

    PlayerInfo[ playerid ][ SpawnAngle ] += 0.5;

    if( PlayerInfo[ playerid ][ SpawnAngle ] >= 360.0 )

        PlayerInfo[ playerid ][ SpawnAngle ] = 0.0;

}[/pawn]

Sper ca ai inteles:)

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.