Help with Npc's D: (CNPC)
#1

Dont worry about it
Reply
#2

pawn Код:
forward NpcSprint ( );

public OnPlayerSpawn ( playerid )
{
    SetTimer ( "NpcSprint", 100, true );
    return 1;
}

#define for_npcs(%1) for(new %1 = 499;%1 >= 450;%1--)

public NpcSprint ( )
{
    new
        Float:X,
        Float:Y,
        Float:Z;
    foreach(Player, i)
    {
        GetPlayerPos ( i, X, Y, Z );
        for_npcs ( npcid )
        {
            if ( IsPlayerInRangeOfPoint ( npcid, 150.0, X, Y, Z ) )
            {
                NPC_WalkTo ( npcid, X, Y, Z, 0 );
            }
        }
    }
    return 1;
}
Reply
#3

some reason it still dosent work even with foreach... weird
Reply
#4

bump


(8char)
Reply
#5

Uhm, NPCs always take the first available slot on the server ..
Reply
#6

Whats that response ment to mean?
Reply
#7

Why not use the foreach version but for the Bot

pawn Код:
foreach (Bot, botid)
{
    SetPlayerPos(botid, 0.0, 0.0, 10.0); // Pile all NPCs in the centre of the world
}
Reply
#8

I dont want it to pile them all to the center of the world. I want them to chase me IG.
Reply
#9

Bump


*8char*
Reply
#10

Did you do CreateNPC or ConnectNPC? If you got ConnectNPC, change it to CreateNPC(npcid....) then it works
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)