Camera Angle not saving on Disconnect -
BR3TT - 31.05.2016
So my position is fine when it saves, however, my camera angle never seems to save. I have this running on disconnect and connect
Код:
public OnPlayerDisconnect(playerid, reason)
{
new query[256], Float:pos[4];
GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
GetPlayerFacingAngle(playerid, pos[3]);
mysql_format(mysql, query, sizeof(query), "UPDATE `accounts` SET `Money` = '%d' , `PosX` = '%f' , `PosY` = '%f' , `PosZ` = '%f' , `PosA` = '%f' WHERE `ID` = '%d'",
GetPlayerMoney(playerid), pos[0], pos[1], pos[2], pos[3], Player[playerid][pID]);
mysql_tquery(mysql, query, "", "");
return true;
}
public OnPlayerSpawn(playerid)
{
SetPlayerPos(playerid, Player[playerid][PosX], Player[playerid][PosY], Player[playerid][PosZ]);
SetPlayerFacingAngle(playerid, Player[playerid][PosA]);
if(IsLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_LIGHTRED, "** This server requires a Login BEFORE spawn**");
}
IsSpawned[playerid] = 1;
return true;
}
PosX, PosY, and PosZ all save, except PosA. When you log in, the camera is always facing north.
Re: Camera Angle not saving on Disconnect -
Luicy. - 31.05.2016
This function is not about the camera, its the player angle, like, if he is facing 180.0' IT will face 180
Re: Camera Angle not saving on Disconnect -
Kaliber - 31.05.2016
Use
PHP код:
SetPlayerCameraBehindPlayer(playerid);
after you set the facingAngle and the camera will be set
Re: Camera Angle not saving on Disconnect -
BR3TT - 31.05.2016
Quote:
Originally Posted by Kaliber
Use
PHP код:
SetPlayerCameraBehindPlayer(playerid);
after you set the facingAngle and the camera will be set
|
Just added it, but it's giving me the "undefined symbol "SetPlayerCameraBehindPlayer"" error. I'm only just getting back into this today and forgotten all about this. How can I fix this?
Re: Camera Angle not saving on Disconnect -
Kaliber - 31.05.2016
Sry, my bad...just:
PHP код:
SetCameraBehindPlayer(playerid);
Re: Camera Angle not saving on Disconnect -
BR3TT - 31.05.2016
Quote:
Originally Posted by Kaliber
Use
PHP код:
SetPlayerCameraBehindPlayer(playerid);
after you set the facingAngle and the camera will be set
|
Quote:
Originally Posted by Kaliber
Sry, my bad...just:
PHP код:
SetCameraBehindPlayer(playerid);
|
Legend! Thanks a lot for that and the quick responses, +rep!