A help related with GetXYInFrontOfPlayer.
#7

I made a new one ..explained a bit in the function hope it works;

pawn Код:
stock GetXYDeadpOol(playerid, &Float:x, &Float:y, Float:distance)
{
    new Float:a;
    GetPlayerPos(playerid, x, y, a);
    GetPlayerFacingAngle(playerid, a);
    if (GetPlayerVehicleID(playerid))
    {
        GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
    }
    a +=120;//  <---you can just change the angle here. Its set to 120 like you want now.
    x += (distance * floatsin(-a, degrees));
    y += (distance * floatcos(-a, degrees));
}
Here is an example of another function with the above function in it.

pawn Код:
stock IsPlayerLeftofPlayer(playerid,targetid,Float:distance,Float:range)
{
    if(!IsPlayerConnected(playerid) || !IsPlayerConnected(targetid))return 0;
    {
        new Float:x, Float:y, Float:z;
        GetPlayerPos(targetid, x, y, z);//my pos
        GetXYDeadpOol(targetid,x,y,distance);
        if(IsPlayerInRangeOfPoint(playerid,range,x,y,z))return 1;
    }
    return 0;
}
Note: 180 is exact left of the player...not 120..but you want 120 so thats okay i guess
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: 1 Guest(s)