FCNPC Bot seems bugged
#8

Yeah the aim data seems to be off. Try offsetting the player's coordinates and see what works. Also, try using this function(by StrickenKid - converted to work for NPC's by me) to set the NPC facing the player.

pawn Код:
stock SetNPCFacingPlayer(playerid, facingid)
{
    new Float:Px, Float:Py, Float: Pa;
    new Float:x,Float:y,Float:z;
    GetPlayerPos(facingid,x,y,z);
    #pragma unused z
    FCNPC_GetPosition(playerid, Px, Py, Pa);
    Pa = floatabs(atan((y-Py)/(x-Px)));
    if (x <= Px && y >= Py) Pa = floatsub(180, Pa);
    else if (x < Px && y < Py) Pa = floatadd(Pa, 180);
    else if (x >= Px && y <= Py) Pa = floatsub(360.0, Pa);
    Pa = floatsub(Pa, 90.0);
    if (Pa >= 360.0) Pa = floatsub(Pa, 360.0);
    return FCNPC_SetAngle(playerid, Pa);
}
Reply


Messages In This Thread
FCNPC Bot seems bugged - by arjanforgames - 19.03.2015, 21:29
Re: FCNPC Bot seems bugged - by Abagail - 19.03.2015, 21:38
Re: FCNPC Bot seems bugged - by arjanforgames - 19.03.2015, 21:41
Re: FCNPC Bot seems bugged - by Abagail - 19.03.2015, 21:48
Re: FCNPC Bot seems bugged - by arjanforgames - 19.03.2015, 21:58
Re: FCNPC Bot seems bugged - by Abagail - 19.03.2015, 22:26
Re: FCNPC Bot seems bugged - by arjanforgames - 19.03.2015, 22:40
Re: FCNPC Bot seems bugged - by Abagail - 19.03.2015, 22:49
Re: FCNPC Bot seems bugged - by arjanforgames - 19.03.2015, 22:52
Re: FCNPC Bot seems bugged - by Neutralneu - 19.03.2015, 23:55

Forum Jump:


Users browsing this thread: 1 Guest(s)