Camera Angle not saving on Disconnect
#1

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.
Reply
#2

This function is not about the camera, its the player angle, like, if he is facing 180.0' IT will face 180
Reply
#3

Use
PHP код:
SetPlayerCameraBehindPlayer(playerid); 
after you set the facingAngle and the camera will be set
Reply
#4

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?
Reply
#5

Sry, my bad...just:

PHP код:
SetCameraBehindPlayer(playerid); 
Reply
#6

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!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)