08.06.2013, 17:27
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_SUBMISSION)
{
new Float:Speed[3],Float:Pos[4];
GetPlayerVelocity(playerid,Speed[0],Speed[1],Speed[2]);
GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
GetPlayerFacingAngle(playerid,Pos[3]);
SetPlayerPos(playerid,Pos[0]+(40*floatcos(90+Pos[3],degrees)),Pos[1]+(40*floatsin(90+Pos[3],degrees)),Pos[2]);
SetPlayerFacingAngle(playerid,Pos[3]);
SetPlayerVelocity(playerid,Speed[0],Speed[1],Speed[2]);
}
return 1;
}