20.12.2013, 12:52
hey guys, I need the stock SetCameraInFrontOfPlayer. (The opposite from the function SetCameraBehindPlayer(playerid).
Thanks.
Thanks.
stock SetCameraInFrontOfPlayer(PlayerID, Float: Distance = 2.5, Float: Lift = 0.5) {
if(IsPlayerConnected(PlayerID)) return false;
new Float: X,
Float: Y,
Float: Z,
Float: A;
GetPlayerPos(PlayerID, X, Y, Z);
if(IsPlayerInAnyVehicle(PlayerID)) {
GetVehicleZAngle(GetPlayerVehicleID(PlayerID), A);
} else {
GetPlayerFacingAngle(PlayerID, A);
}
// GetPlayerPosition(PlayerID, W, I, X, Y, Z, A);
SetPlayerCameraLookAt(playerid, X, Y, Z);
// Credits to ****** for the GetXYInFrontOfPlayer function.
X += (Distance * floatsin(-A, degrees));
Y += (Distance * floatcos(-A, degrees));
SetPlayerCameraPos(playerid, X, Y, (Z + Lift));
return true;
}
You mean this?
pawn Код:
|