Spawn Object Behind Player
#3

Here are a few of them, I had in hand
pawn Код:
stock GetXYInFrontOfPlayer(playerid,&Float:x,&Float:y,Float:dis)
{
    new Float:pos[3];
    GetPlayerPos(playerid,pos[0],pos[1],pos[2]);
    GetPlayerFacingAngle(playerid,pos[2]);
    GetXYInFrontOfPoint(pos[0],pos[1],x,y,pos[2],dis);
}

stock GetXYBehindPlayer(playerid,&Float:x,&Float:y,Float:dis)
{
    new Float:pos[3];
    GetPlayerPos(playerid,pos[0],pos[1],pos[2]);
    GetPlayerFacingAngle(playerid,pos[2]);
    GetXYBehindPoint(pos[0],pos[1],x,y,pos[2],dis);
}

stock GetXYInFrontOfPoint(Float:x,Float:y,&Float:x2,&Float:y2,Float:angle,Float:distance)
{
    x2 = x + (distance * floatsin(-angle,degrees));
    y2 = y + (distance * floatcos(-angle,degrees));
}

stock GetXYBehindPoint(Float:x,Float:y,&Float:x2,&Float:y2,Float:angle,Float:distance)
{
    x2 = x - (distance * floatsin(-angle,degrees));
    y2 = y - (distance * floatcos(-angle,degrees));
}
Reply


Messages In This Thread
Spawn Object Behind Player - by Yuryfury - 20.06.2009, 22:13
Re: Spawn Object Behind Player - by mamorunl - 20.06.2009, 22:17
Re: Spawn Object Behind Player - by Grim_ - 20.06.2009, 22:37

Forum Jump:


Users browsing this thread: 1 Guest(s)