21.11.2013, 14:20
pawn Код:
GetPlayerPos(i, Pos[X], Pos[Y], Pos[Z]);
SetObjectRot(Object, Pos[X], Pos[Y], Pos[Z]);
Para la rotaciуn Z te puedes guiar de йsta funciуn de the_chaoz, tenes q modiicarla para que funcione con un objeto.
pawn Код:
SetPlayerFacingPos(playerid, Float:x, Float:y) //BY THE_CHAOZ
{
if(!floatcmp(x, 0.0) && !floatcmp(y, 0.0))return 0;
static Float:p[3];
GetPlayerPos(playerid, p[0], p[1], p[2]);
p[2] = atan2((y-p[1]), (x-p[0])) + 270.00;
if(p[2]>360)p[2]-=360.00;
return SetPlayerFacingAngle(playerid, p[2]);
}