SA-MP Forums Archive
OnPlayerRequestClass... - 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)
+--- Thread: OnPlayerRequestClass... (/showthread.php?tid=323317)



OnPlayerRequestClass... - Hudgens - 05.03.2012

This is a really nooby question, but I haven't scripted in ages lmfao.
I'm just messing around and I can not come up with a way to make my character FACE the stupid camera.

Here's the coordinates:
Код:
public OnPlayerRequestClass(playerid, classid)
{
	SetPlayerPos(playerid, 1544.2389,-1360.1006,329.4627);
	SetPlayerCameraPos(playerid, 1544.2495,-1354.9449,329.4715);
	SetPlayerCameraLookAt(playerid, 1544.2389,-1360.1006,329.4627);
	return 1;
}



Re: OnPlayerRequestClass... - coole210 - 05.03.2012

Save the position of you looking at the place where you want to see the face (/save) and use the coords in SetPlayerCameraPos.


Re: OnPlayerRequestClass... - Hudgens - 05.03.2012

Doesn't that just change where I see the character, and not where the character stands? ..


Re: OnPlayerRequestClass... - Twisted_Insane - 05.03.2012

That was exactly the same thing I had when I wanted to do that! But it's pretty easy, look!

Save the first position where your skin should stand / appear! "/save skin1_stand"
Then, place CJ at the place you would like to see the skin from, imagine the place where CJ stands as the camera which is filming at the position he likes! "/save skin1_camera"!

Then, it should look like 'dis:

pawn Код:
SetPlayerPos(playerid, X-Y-Z from first savepoint);
                SetPlayerFacingAngle(playerid, ANGLE (4th co-ord) from first savepoint);
                SetPlayerCameraPos(playerid, X-Y-Z from second savepoint);
                SetPlayerCameraLookAt(playerid, here again X-Y-Z from first savepoint);



Re: OnPlayerRequestClass... - Hudgens - 06.03.2012

Something like this:

Код:
	SetPlayerPos(playerid, 1544.2389,-1360.1006,329.4627);
	SetPlayerFacingAngle(playerid,359.4955);
	SetPlayerCameraPos(playerid, 1544.2495,-1354.9449,329.4715);
	SetPlayerCameraLookAt(playerid, 1544.2389,-1360.1006,329.4627);
?


Re: OnPlayerRequestClass... - Kyle - 06.03.2012

Quote:
Originally Posted by Hudgens
Посмотреть сообщение
Something like this:

Код:
	SetPlayerPos(playerid, 1544.2389,-1360.1006,329.4627);
	SetPlayerFacingAngle(playerid,359.4955);
	SetPlayerCameraPos(playerid, 1544.2495,-1354.9449,329.4715);
	SetPlayerCameraLookAt(playerid, 1544.2389,-1360.1006,329.4627);
?
Try it, see if it works.


AW: OnPlayerRequestClass... - dalkgamler - 06.03.2012

yes i think that work


Re: OnPlayerRequestClass... - GNGification - 06.03.2012

This should be all you need

https://sampwiki.blast.hk/wiki/SetPlayerFacingAngle