Hello...
#1

Hello, i need some info about InterpolateCameraPos and InterpolateCameraLookAt ... I put it on my login and don't work ... Nothing happen .

Код HTML:
if(fexist(UserPath(playerid)))
	{
	    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
		ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,"Login", "You already have an registred account ! Type you password below to login:", "Login", "Quit");
		
        SetPlayerTime(playerid, 23, 0);
        SetPlayerWeather(playerid, 2);
		isLogging[playerid] = true;
		TogglePlayerSpectating(playerid, 1);
		InterpolateCameraPos(playerid, 975.8445,-1885.6123,51.3452, 170.6750,-1819.0737,29.9493, 120000, CAMERA_MOVE);
		InterpolateCameraLookAt(playerid, 978.0808,-1828.8401,13.3273, 168.7359,-1769.5266,4.4659,120000, CAMERA_MOVE);
		SendClientMessage(playerid, FactColor[9], "This account it's already registred ! Type your password to login ...");
	}
	else
	{
	    SetPlayerTime(playerid, 23, 0);
        SetPlayerWeather(playerid, 2);
	    isLogging[playerid] = true;
		ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Registering...", "You don't have an registred account ! Type you password below to register to our server:", "Register", "Quit");
        InterpolateCameraPos(playerid, 975.8445,-1885.6123,51.3452, 170.6750,-1819.0737,29.9493, 120000, CAMERA_MOVE);
		InterpolateCameraLookAt(playerid, 978.0808,-1828.8401,13.3273, 168.7359,-1769.5266,4.4659,120000, CAMERA_MOVE);
		SendClientMessage(playerid, FactColor[9], "That name it's not Registered on our server ! Type a strong password and join US !");
	}
P.S: It shows sometimes ... many times it didn't work ... +REP for help .
Reply
#2

It's natural for those functions to work improperly, it has already been that way.
Reply
#3

Quote:
Originally Posted by SickAttack
Посмотреть сообщение
It's natural for those functions to work improperly, it has already been that way.
I seen on a server , something like that , and there it work always .
Reply
#4

You need to unset the functions with a timer if you are trying to use it under OnPlayerConnect().

Код:
// Top of script
forward UnsetInterpolateCamera(playerid);
Код:
// Somewhere in script
public UnsetInterpolateCamera(playerid)
{
	InterpolateCameraPos(playerid, 975.8445,-1885.6123,51.3452, 170.6750,-1819.0737,29.9493, 120000, CAMERA_MOVE);
	InterpolateCameraLookAt(playerid, 978.0808,-1828.8401,13.3273, 168.7359,-1769.5266,4.4659,120000, CAMERA_MOVE);
	return 1;
}
Код:
// Replace your InterpolateCameraPos() and InterpolateCameraLookAt() with this
SetTimerEx("UnsetInterpolateCamera", 1000, false, "u", playerid);
So your registration section should look similar to this:
Код:
if(fexist(UserPath(playerid)))
	{
	    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
		ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,"Login", "You already have an registred account ! Type you password below to login:", "Login", "Quit");

        SetPlayerTime(playerid, 23, 0);
        SetPlayerWeather(playerid, 2);
		isLogging[playerid] = true;
		TogglePlayerSpectating(playerid, 1);
		SetTimerEx("UnsetInterpolateCamera", 1000, false, "u", playerid);
		SendClientMessage(playerid, FactColor[9], "This account it's already registred ! Type your password to login ...");
	}
	else
	{
	    SetPlayerTime(playerid, 23, 0);
        SetPlayerWeather(playerid, 2);
	    isLogging[playerid] = true;
		ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Registering...", "You don't have an registred account ! Type you password below to register to our server:", "Register", "Quit");
        SetTimerEx("UnsetInterpolateCamera", 1000, false, "u", playerid);
		SendClientMessage(playerid, FactColor[9], "That name it's not Registered on our server ! Type a strong password and join US !");
	}
Reply
#5

Quote:
Originally Posted by zDivine
Посмотреть сообщение
...
Even if you use it, let's say in the class selection, it won't always work. Sometimes the camera will move and sometimes it won't at all.
Reply
#6

Solved , thank you zDivine .. I maked a variable to check if player it's not logged .. and if it it's not logged to put player spectate and show him that interpolate camera at Requestclass .. I hope that will make it work always

+REP you too @SickAttack
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)