SA-MP Forums Archive
SetCamera on connect for login dialog - 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: SetCamera on connect for login dialog (/showthread.php?tid=604348)



SetCamera on connect for login dialog - Stefand - 03.04.2016

Hey all,

I have this code under "Onplayerconnect"

pawn Код:
TogglePlayerSpectating(playerid, true);
    SetPlayerCameraPos(playerid, 1415.0320, -1749.1689, 29.9612);
SetPlayerCameraLookAt(playerid, 1415.7621, -1748.4803, 29.7203);
    PlayerPlaySound(playerid, 1062, 0.0, 0.0, 0.0);
But the camera gets set to it's place with a major delay, because the Dialog to login shows after the camera's set scriptwise but IG the dialog is even faster and I can already be logged in before the camera's position is set.

How can I make it to get an instant camera when it connects?


Re: SetCamera on connect for login dialog - theonethatownz - 03.04.2016

Have you tried setting a timer for the dialog?


Re: SetCamera on connect for login dialog - Stefand - 04.04.2016

That shouldn't be the fix, the problem is that the setting the camera is slow, it should SET the camera BEFORE the dialog appears, it's scripted in that order.


Re: SetCamera on connect for login dialog - introzen - 04.04.2016

Quote:
Originally Posted by Stefand
Посмотреть сообщение
That shouldn't be the fix, the problem is that the setting the camera is slow, it should SET the camera BEFORE the dialog appears, it's scripted in that order.
I've solved this by using InterpolateCameraPos instead of SetCameraPos.


Re: SetCamera on connect for login dialog - Stefand - 04.04.2016

Nvm I found the bug, either my loadblocks or loadbans is causing the script to lag.