SA-MP Forums Archive
animation make player not move just change angle with arrow keys - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: animation make player not move just change angle with arrow keys (/showthread.php?tid=633343)



animation make player not move just change angle with arrow keys - Bussyman - 29.04.2017

Hi,

What animation with what parameters i need to make, that i could make like that, player can't move, but he can change his angle

I'am using like that:

ApplyAnimation(playerid, "PED", "IDLE_STANCE", 4.1, 1, 1, 1, 1, 1, 1);

But no work..


Re: animation make player not move just change angle with arrow keys - Sebz - 29.04.2017

You could do this with SetPlayerFacingAngle


Re: animation make player not move just change angle with arrow keys - Bussyman - 29.04.2017

But i see some animations like

https://sampforum.blast.hk/showthread.php?tid=514244

But i need animation neutral like idle_stance


Re: animation make player not move just change angle with arrow keys - AndreiWow - 29.04.2017

what you've showed is a selfie fs and I am pretty sure that he changed camera facing angle when moving it.


Re: animation make player not move just change angle with arrow keys - Bussyman - 29.04.2017

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