29.04.2017, 16:05
In that fs i press a w s d and it change my angle
if(PRESSED(KEY_ANALOG_RIGHT))
{
GetPlayerPos(playerid,lX[playerid],lY[playerid],lZ[playerid]);
static Float: n1X, Float: n1Y;
if(Degree[playerid] >= 360) Degree[playerid] = 0;
Degree[playerid] += Speed;
n1X = lX[playerid] + Radius * floatcos(Degree[playerid], degrees);
n1Y = lY[playerid] + Radius * floatsin(Degree[playerid], degrees);
SetPlayerCameraPos(playerid, n1X, n1Y, lZ[playerid] + Height);
SetPlayerCameraLookAt(playerid, lX[playerid], lY[playerid], lZ[playerid]+1);
SetPlayerFacingAngle(playerid, Degree[playerid] - 90.0);
}
if(PRESSED(KEY_ANALOG_LEFT))
{
GetPlayerPos(playerid,lX[playerid],lY[playerid],lZ[playerid]);
static Float: n1X, Float: n1Y;
if(Degree[playerid] >= 360) Degree[playerid] = 0;
Degree[playerid] -= Speed;
n1X = lX[playerid] + Radius * floatcos(Degree[playerid], degrees);
n1Y = lY[playerid] + Radius * floatsin(Degree[playerid], degrees);
SetPlayerCameraPos(playerid, n1X, n1Y, lZ[playerid] + Height);
SetPlayerCameraLookAt(playerid, lX[playerid], lY[playerid], lZ[playerid]+1);
SetPlayerFacingAngle(playerid, Degree[playerid] - 90.0);
}
Here just for numpad 4 6
if(PRESSED(KEY_ANALOG_RIGHT))
{
GetPlayerPos(playerid,lX[playerid],lY[playerid],lZ[playerid]);
static Float: n1X, Float: n1Y;
if(Degree[playerid] >= 360) Degree[playerid] = 0;
Degree[playerid] += Speed;
n1X = lX[playerid] + Radius * floatcos(Degree[playerid], degrees);
n1Y = lY[playerid] + Radius * floatsin(Degree[playerid], degrees);
SetPlayerCameraPos(playerid, n1X, n1Y, lZ[playerid] + Height);
SetPlayerCameraLookAt(playerid, lX[playerid], lY[playerid], lZ[playerid]+1);
SetPlayerFacingAngle(playerid, Degree[playerid] - 90.0);
}
if(PRESSED(KEY_ANALOG_LEFT))
{
GetPlayerPos(playerid,lX[playerid],lY[playerid],lZ[playerid]);
static Float: n1X, Float: n1Y;
if(Degree[playerid] >= 360) Degree[playerid] = 0;
Degree[playerid] -= Speed;
n1X = lX[playerid] + Radius * floatcos(Degree[playerid], degrees);
n1Y = lY[playerid] + Radius * floatsin(Degree[playerid], degrees);
SetPlayerCameraPos(playerid, n1X, n1Y, lZ[playerid] + Height);
SetPlayerCameraLookAt(playerid, lX[playerid], lY[playerid], lZ[playerid]+1);
SetPlayerFacingAngle(playerid, Degree[playerid] - 90.0);
}
Here just for numpad 4 6