SA-MP Forums Archive
camera is too far ! - 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: camera is too far ! (/showthread.php?tid=83152)



camera is too far ! - xwy - 22.06.2009

I made hippie car interior.(enter as passenger and it teles to interior) problem is that it is so small that i can see outside the room with my camera. When i press v its okay.
How to make a script:
what shortens distance between the player and the camera when i enter the vechile and if player exits the car, it goes normal again?



Re: camera is too far ! - pumpkin - 22.06.2009

Errr...

proovi midagi sellist vb SetPlayerFacingAngle(playerid,Kordinaadid);
SetPlayerCameraPos(playerid,Kordinaadid);
SetPlayerCameraLookAt(playerid,Kordinaadid);


try something like this :
SetPlayerFacingAngle(playerid,Cords);
SetPlayerCameraPos(playerid,Cords);
SetPlayerCameraLookAt(playerid,Cords);


Re: camera is too far ! - Yoyoyo - 22.06.2009

Ok this can be done simply with one varriable. ..
On the top of the script do something like this . .

Код:
IsInInterior[MAX_PLAYERS] = 0;
If your interior code doesnt have that already add it.
When he enters the interior do this. .
Код:
IsInInterior[playerid] = 1;
When he exits the interior set it back to 0

Now add a timer to OnGamemodeInit
Код:
SetTimerEx("CameraCheck", 100, 1, "i", playerid);
Then .. .

EDIT:
Код:
forward CameraCheck(playerid);

public CameraCheck(playerid)
{
if(IsInInterior[playerid] == 1)
{
new Float:X, Float:Y, Float:Z;
SetCameraPos(playerid, X-0.3,Y,Z);
SetCameraLookAt(playerid, X, Y, Z);

} else {

if(IsInInterior[playerid] == 0)
{
SetCameraPos(playerid, X, Y, Z);
SetCameraLookAt(playerid, X, Y, Z);
return 1;
}
Do soemthing like that, It is untested :P
Glad to help; if it doesnt work then, im glad to give you ideas :P


Re: camera is too far ! - xwy - 23.06.2009

Thanks for your answers.. i will test it shortly . until i fix converting problem