13.07.2011, 00:51
PHP код:
stock GetXYFromPlayer(playerid, &Float:x, &Float:y, Float:distance, gxy_mode:mode = gxy_before)
{
new
Float:a;
if(GetPlayerPos(playerid, x, y, a))
{
GetPlayerFacingAngle(playerid, a);
switch(mode)
{
case gxy_behind: if((a += 180) > 360) a -= 360;
case gxy_right: if((a += 90) > 360) a -= 360;
case gxy_left: if((a -= 90) < 0) a += 360;
}
x += distance * floatsin(-a, degrees);
y += distance * floatcos(-a, degrees);
return 1;
}
return 0;
}