if(Flying[playerid] == 1)
{
if(HOLDING(KEY_LOOK_LEFT))
{
new Float:oldpos[3];
GetPlayerPos(playerid, oldpos[0], oldpos[1], oldpos[2]);
SetPlayerPos(playerid, oldpos[0]+2, oldpos[1], oldpos[2]);
}
else if(HOLDING(KEY_LOOK_RIGHT))
{
new Float:oldpos[3];
GetPlayerPos(playerid, oldpos[0], oldpos[1], oldpos[2]);
SetPlayerPos(playerid, oldpos[0]-2, oldpos[1], oldpos[2]);
}
else if(HOLDING(KEY_LEFT))
{
new Float:oldpos[3];
GetPlayerPos(playerid, oldpos[0], oldpos[1], oldpos[2]);
SetPlayerPos(playerid, oldpos[0], oldpos[1]+2, oldpos[2]);
}
else if(HOLDING(KEY_RIGHT))
{
new Float:oldpos[3];
GetPlayerPos(playerid, oldpos[0], oldpos[1], oldpos[2]);
SetPlayerPos(playerid, oldpos[0], oldpos[1]-2, oldpos[2]);
}
else if(HOLDING(KEY_SPRINT))
{
new Float:oldpos[3];
GetPlayerPos(playerid, oldpos[0], oldpos[1], oldpos[2]);
SetPlayerPos(playerid, oldpos[0], oldpos[1], oldpos[2]+2);
}
else if(HOLDING(KEY_CROUCH))
{
new Float:oldpos[3];
GetPlayerPos(playerid, oldpos[0], oldpos[1], oldpos[2]);
SetPlayerPos(playerid, oldpos[0], oldpos[1], oldpos[2]-2);
}
SetPlayerFacingAngle(playerid, 0); |
SetPlayerPos(playerid, (oldpos[0]+floatcos(Angle-94,degrees))+4.0, (oldpos[1]+floatsin(Angle-94,degrees))+4.0, oldpos[2]);// if press right
SetPlayerPos(playerid, (oldpos[0]+floatcos(Angle-94,degrees))-4.0, (oldpos[1]+floatsin(Angle-94,degrees))-4.0, oldpos[2]);// if press left