16.04.2010, 19:05
Hi guys..
I have a save position script, but it is kinda buggy. When I am in a vehicle, and I use /s, the angle is EXACTLY the same as when I entered the vehicle, but I want it the angle that it is NOW. And when I save on-foot it all goes fine.
Code:
How to save angle ;o?
I have a save position script, but it is kinda buggy. When I am in a vehicle, and I use /s, the angle is EXACTLY the same as when I entered the vehicle, but I want it the angle that it is NOW. And when I save on-foot it all goes fine.
Code:
Код:
if (strcmp(cmdtext, "/s", true)==0) { GetVehiclePos(GetPlayerVehicleID(playerid), PosX[playerid], PosY[playerid], PosZ[playerid]); GetVehicleZAngle(GetPlayerVehicleID(playerid), PosA[playerid]); GetPlayerPos(playerid, PosX[playerid], PosY[playerid], PosZ[playerid]); GetPlayerFacingAngle(playerid, PosA[playerid]); SendClientMessage(playerid, COLOR_GREEN, "== Position saved! Go to this position with /l."); PosI[playerid] = (GetPlayerInterior(playerid)); 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] +3); SetVehicleZAngle(GetPlayerVehicleID(playerid), PosA[playerid]); } else { InCar[playerid] = false; SetPlayerPos(playerid, PosX[playerid], PosY[playerid], PosZ[playerid]); SetPlayerFacingAngle(playerid, PosA[playerid]); SetCameraBehindPlayer(playerid); } SetPlayerInterior(playerid, PosI[playerid]); SendClientMessage(playerid, COLOR_GREEN, "== Position loaded."); } return 1; }