NPC id
#1

Is it possible to give a NPC ID descending from GetMaxPlayers?
Reply
#2

Decrementing? Maybe yes it can be done
Reply
#3

How?
Reply
#4

pawn Код:
public OnPlayerConnect( playerid )
{
    new
        count = 0;

    for( new i = 0; < MAX_PLAYERS; i ++ )
    {
        if( IsPlayerNPC( i ) )
        {
             count ++;
        }
    }
    printf( "There are %d connected NPCs!", count );
    // Rest
    return 1;
}
Reply
#5

That's not what he wants. He wants like, if his server has 100 slots, for the NPCs to take up slot 99, 98, 97 ... not 0, 1, 2.
Now, there is no way to manually assign an id to an NPC. Maybe you could connect X fake NPC's first and then your real ones. Then disconnect the fake ones.
Reply
#6

I understood it wrong. I don't know what "descending" is as English isn't my primary language.
I though how he can count how many are the NPCs from MAX_PLAYERS.
Sorry for my mistake.
You can possibly connect some NPC that you don't want and the NPCs that you want as the Limit on NPCs I think is 50.
Then kick the NPCs that you don't need and you will have NPCs with high id.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)