24.03.2010, 14:18
When I'm saving position with /s, some bug happends. When on-foot you save fine, and your angle is good, but when you save in a car you the angle just goes to random things. When I'm out of my vehicle, and do /l, it does exactly the same. But on-foot saving, and loading in a car or on-foot is fine.
Why does this happen?
Код:
if (strcmp(cmdtext, "/s", true)==0) { GetPlayerPos(playerid, PosX[playerid], PosY[playerid], PosZ[playerid]); GetPlayerFacingAngle(playerid, PosA[playerid]); SendClientMessage(playerid, COLOR_BASIC, "Position saved! Go to this position with /l."); PosI[playerid] = (GetPlayerInterior(playerid)); PlayerPlaySound(playerid, 1137 , 0.0, 0.0, 0.0); return 1; } if (strcmp(cmdtext, "/l", true)==0) { if (!floatsqroot(PosX[playerid]+PosY[playerid]+PosZ[playerid])) { return SendClientMessage(playerid, COLOR_RED, "Use /s first!"); } else { if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { SetVehiclePos(GetPlayerVehicleID(playerid), PosX[playerid], PosY[playerid], PosZ[playerid]); SetVehicleZAngle(GetPlayerVehicleID(playerid), PosA[playerid]); SetPlayerFacingAngle(playerid, PosA[playerid]); SetCameraBehindPlayer(playerid); LinkVehicleToInterior(GetPlayerVehicleID(playerid), PosI[playerid]); } else { InCar[playerid] = false; SetPlayerPos(playerid, PosX[playerid], PosY[playerid], PosZ[playerid]); SetPlayerFacingAngle(playerid, PosA[playerid]); SetCameraBehindPlayer(playerid); } PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0); SetPlayerInterior(playerid, PosI[playerid]); SendClientMessage(playerid, COLOR_BASIC, "Saved position loaded."); } return 1; }