NPC help! !! REP+++
#1

Hello i using FCNPC plugin i have this problem
NPCs is floating to players how i can fix it?



My code
pawn Код:
new Float:p[3];
    foreach(Player,i)
    {
        GetPlayerPos(i, p[0],p[1],p[2]);
        if(IsPlayerInRangeOfPoint(npcid, 50,p[0],p[1],p[2]))
        {
            FCNPC_GoTo(npcid, p[0], p[1], p[2], MOVE_TYPE_SPRINT, 10, 1);
            if(IsPlayerInRangeOfPoint(npcid,1, p[0], p[1], p[2]))
            {
                FCNPC_Punch(npcid, p[0], p[1], p[2], 125);
            }
        }
    }
Reply
#2

no people see this post?
Reply
#3

pawn Код:
new Float:p[3];
    foreach(Player,i)
    {
        GetPlayerPos(i, p[0],p[1],p[2]);
        if(IsPlayerInRangeOfPoint(npcid, 50,p[0],p[1],p[2]))
        {
            FCNPC_GoTo(npcid, p[0], p[1], p[2], MOVE_TYPE_SPRINT, 9, 1);
            if(IsPlayerInRangeOfPoint(npcid,1, p[0], p[1], p[2]))
            {
                FCNPC_Punch(npcid, p[0], p[1], p[2], 124);
            }
        }
    }
Reply
#4

NOt working
Reply
#5

1 question your server about zombie?
Reply
#6

Zombies can flying to players when players stand on the building or driving vehicles, So how i can fix it?
Reply
#7

pawn Код:
public NewPos(playerid){ // Make the zombie Run / Sprint
        if(     Zombies[playerid][LastZombieHealth] > 0.0 ){
                new Float:x,Float:y,Float:z;
                new Float:ax,Float:ay,Float:az,Float:dif;
                GetPlayerPos(Zombies[playerid][ZombieTarget],ax,ay,az);
                GetPlayerPos(playerid,x,y,z);
                if( az <= (z+3.0) && az >= (z-3.0)){
                        if(Zombies[playerid][ZombieRunning] == 1){
                                ApplyAnimation(playerid,"Muscular","MuscleRun",1,1,1,0,0,0);
                                GetXYInFrontOfPlayer(playerid,x,y,2.0);
                        }
                        else if(Zombies[playerid][ZombieRunning] == 2){
                                ApplyAnimation(playerid,"Muscular","MuscleSprint",1,1,1,0,0,0);
                                GetXYInFrontOfPlayer(playerid,x,y,2.8);
                        }
 
                        dif = az;
                SetPlayerPos(playerid,x,y,dif);
            }else{
                        if(Zombies[playerid][ZombieRunning]) Parar(playerid);
                        GetPlayerPos(playerid,x,y,z);
                SetPlayerPosFindZ(playerid,x,y,z);
            }
    }
}
i think it will fix this bug because i think you didn't make the zombie Run!!
Reply
#8

Npcs moving to players fine,

pawn Код:
FCNPC_GoTo(npcid, p[0], p[1], p[2], MOVE_TYPE_SPRINT, 10, 1);
Quote:
Originally Posted by ThunderX
Посмотреть сообщение
pawn Код:
public NewPos(playerid){ // Make the zombie Run / Sprint
        if(     Zombies[playerid][LastZombieHealth] > 0.0 ){
                new Float:x,Float:y,Float:z;
                new Float:ax,Float:ay,Float:az,Float:dif;
                GetPlayerPos(Zombies[playerid][ZombieTarget],ax,ay,az);
                GetPlayerPos(playerid,x,y,z);
                if( az <= (z+3.0) && az >= (z-3.0)){
                        if(Zombies[playerid][ZombieRunning] == 1){
                                ApplyAnimation(playerid,"Muscular","MuscleRun",1,1,1,0,0,0);
                                GetXYInFrontOfPlayer(playerid,x,y,2.0);
                        }
                        else if(Zombies[playerid][ZombieRunning] == 2){
                                ApplyAnimation(playerid,"Muscular","MuscleSprint",1,1,1,0,0,0);
                                GetXYInFrontOfPlayer(playerid,x,y,2.8);
                        }
 
                        dif = az;
                SetPlayerPos(playerid,x,y,dif);
            }else{
                        if(Zombies[playerid][ZombieRunning]) Parar(playerid);
                        GetPlayerPos(playerid,x,y,z);
                SetPlayerPosFindZ(playerid,x,y,z);
            }
    }
}
i think it will fix this bug because i think you didn't make the zombie Run!!
It not code for FCNPC -.-
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)