31.05.2016, 17:30
So my position is fine when it saves, however, my camera angle never seems to save. I have this running on disconnect and connect
PosX, PosY, and PosZ all save, except PosA. When you log in, the camera is always facing north.
Код:
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; }