A help related with GetXYInFrontOfPlayer.
#5

Quote:
Originally Posted by PaulDinam
Посмотреть сообщение
Try this perhaps:
pawn Код:
new Float:x, Float: y, Float:z, Float:fa;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, fa);

// Calculate position to left of player
x = (x + 0.75 * floatsin(-fa + -90,degrees));
y = (y + 0.75 * floatcos(-fa + -90,degrees));

// Calculate create offset
x = (x + 1.0 * floatsin(-fa,degrees));
y = (y + 1.0 * floatcos(-fa,degrees));
pawn Код:
stock GetXYSetAngle(playerid)
{
    new Float:x, Float: y, Float:z, Float:fa;
    GetPlayerPos(playerid, x, y, z);
    GetPlayerFacingAngle(playerid, fa);

    // Calculate position to left of player
    x = (x + 0.75 * floatsin(-fa + -90,degrees));
    y = (y + 0.75 * floatcos(-fa + -90,degrees));

    // Calculate create offset
    x = (x + 1.0 * floatsin(-fa,degrees));
    y = (y + 1.0 * floatcos(-fa,degrees));
}
Will it work for all the angles? And how to use it? if(GetXYSetAngle(playerid) == 120) ?
Reply


Messages In This Thread
A help related with GetXYInFrontOfPlayer. - by De4dpOol - 18.02.2015, 08:41
Re: A help related with GetXYInFrontOfPlayer. - by AIped - 18.02.2015, 08:49
Re: A help related with GetXYInFrontOfPlayer. - by De4dpOol - 18.02.2015, 09:09
Re: A help related with GetXYInFrontOfPlayer. - by PaulDinam - 18.02.2015, 10:44
Re: A help related with GetXYInFrontOfPlayer. - by De4dpOol - 18.02.2015, 11:11
Re: A help related with GetXYInFrontOfPlayer. - by AIped - 18.02.2015, 11:38
Re: A help related with GetXYInFrontOfPlayer. - by AIped - 18.02.2015, 11:44
Re: A help related with GetXYInFrontOfPlayer. - by De4dpOol - 18.02.2015, 11:49
AW: A help related with GetXYInFrontOfPlayer. - by Nero_3D - 18.02.2015, 11:50
Re: A help related with GetXYInFrontOfPlayer. - by AIped - 18.02.2015, 11:52

Forum Jump:


Users browsing this thread: 3 Guest(s)