SA-MP Forums Archive
SetPlayerCamersPos Promblem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: SetPlayerCamersPos Promblem (/showthread.php?tid=147880)



SetPlayerCamersPos Promblem - or_yagoda - 14.05.2010

if used this code:
Код:
new Float:P[3];
GetPlayerPos(playerid,P[0],P[1],P[2]);
GetXYInfrontOfPlayer(playerid,P[0],P[1],20.0);
SetPlayerCameraPos(playerid,P[0],P[1],P[2]);
in OnPlayerUpdate.
try it in your mode and see: its not working !
i can't set the camera pos.
i want the camera to be away from the player...

edit:
i now know the promlem:
i should do:

Код:
SetPlayerCameraPos(playerid,P[0],P[1],P[2]);
SetPlayerCameraLookAt(playerid,P[0],P[1],P[2]);
tnk...


Re: SetPlayerCamersPos Promblem - Assyria - 14.05.2010

Yes, you got your code working..?



Re: SetPlayerCamersPos Promblem - or_yagoda - 14.05.2010

Yes, but, i have a new problem:

Код:
new Keys,ud,lr;
GetPlayerKeys(playerid,Keys,ud,lr);
if(Keys & 128)
{
	new Float:P[3];
	GetPlayerPos(playerid,P[0],P[1],P[2]);
	SetPlayerCameraLookAt(playerid,P[0],P[1],P[2] + 0.5);
	GetXYBehindPlayer(playerid,P[0],P[1],0.001);
	SetPlayerCameraPos(playerid,P[0],P[1],P[2] + 0.5);
    VBS[playerid][CamMoved] = 0;
}
else
{
	if(VBS[playerid][CamMoved] != 1)
	{
		SetCameraBehindPlayer(playerid);
		VBS[playerid][CamMoved] = 1;
	}
}
this code shout make a FPS camera when i prees the aim key and regular camera when i dont prees but its not working.
when i prees the right button, the camera is in a position that i want ( FPS ) but i cant aim ( i can move but i cant move the gun ).
help ?

[img width=960 height=768]http://up203.siz.co.il/up1/maztyizmnjmh.jpg[/img]


Re: SetPlayerCamersPos Promblem - Assyria - 14.05.2010

Try explaining again, count to ten after writing one word, try to write so we can understand too


Re: SetPlayerCamersPos Promblem - or_yagoda - 15.05.2010

Quote:
Originally Posted by Assyria
Try explaining again, count to ten after writing one word, try to write so we can understand too
When i moving the camera to the pos in the image, i can't aim - that the problem.


Re: SetPlayerCamersPos Promblem - dice7 - 15.05.2010

When using SetPlayerCamera, the mouse gets disabled. You can re-enable it with SetCameraBehindPlayer(playerid);


Re: SetPlayerCamersPos Promblem - or_yagoda - 15.05.2010

Quote:
Originally Posted by dice7
When using SetPlayerCamera, the mouse gets disabled. You can re-enable it with SetCameraBehindPlayer(playerid);
Sow there is another way to create FPS camera like in the image?


Re: SetPlayerCamersPos Promblem - sushihusi - 15.05.2010

Try this http://forum.sa-mp.com/index.php?topic=95936


Re: SetPlayerCamersPos Promblem - or_yagoda - 15.05.2010

Quote:
Originally Posted by sushihusi
Its not working in 0.3


Re: SetPlayerCamersPos Promblem - sushihusi - 15.05.2010

SRY I didnt know