SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 10/07/2014, 07:57 PM   #1
cnoopers
Huge Clucker
 
Join Date: Aug 2013
Posts: 431
Reputation: 7
Default Attached camera

Camera is not moving with player, why?
Code:
	new Float:x, Float:y, Float:z;
	new cameraobject;
	GetPlayerPos(playerid, x, y, z);
	cameraobject = AttachObjectToPlayer(19300, playerid, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
	
	SetPlayerCameraPos(playerid, x, y, z+10);
	SetPlayerCameraLookAt(playerid, x, y, z, 1);
	AttachCameraToObject(playerid, cameraobject);
cnoopers is offline   Reply With Quote
Old 10/07/2014, 08:17 PM   #2
Tadas
Big Clucker
 
Join Date: Feb 2014
Location: Lithuania
Posts: 156
Reputation: 1
Default Re: Attached camera

I think than you have to update it every time when it moves. Try to use OnPlayerUpdate callback

EDITED:
Just put that code under OnPlayerUpdate callback.

+Rep if I helped you.
__________________
Peace.
Tadas is offline   Reply With Quote
Old 10/07/2014, 10:17 PM   #3
cnoopers
Huge Clucker
 
Join Date: Aug 2013
Posts: 431
Reputation: 7
Default Re: Attached camera

now is bad too, its must be attached but its not work, idk why man
cnoopers is offline   Reply With Quote
Old 10/07/2014, 11:31 PM   #4
S4t3K
High-roller
 
S4t3K's Avatar
 
Join Date: Jan 2013
Posts: 4,485
Reputation: 160
Default Re : Attached camera

You should try "PlayerSpectatePlayer" ?
__________________
S4t3K is offline   Reply With Quote
Old 10/07/2014, 11:45 PM   #5
cnoopers
Huge Clucker
 
Join Date: Aug 2013
Posts: 431
Reputation: 7
Default Re: Attached camera

no because i cant spectate my character
cnoopers is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Include] Attached Object Ex - Temporary Attached Objects, Sniper Zoom fix, and more Corekt Includes 12 16/01/2016 12:13 PM
Player Camera Goes Trough Objects And Attached Objects. [WSF]ThA_Devil Scripting Help 1 20/11/2013 03:40 PM
how to save the size of attached object after player edit attached object Chrisli520 Scripting Help 1 18/10/2013 11:12 PM
Modern Camera ( HELP PLEASE! ) - Get Coordinates on where the Camera is aiming Aira Scripting Help 3 27/05/2012 11:57 AM
Moving Camera On Login The Camera On Player Spawn Does Not Go Back. Robert_Crawford Help Archive 5 20/06/2011 01:56 AM


All times are GMT. The time now is 01:30 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.