SA-MP Forums Archive
NPC id - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: NPC id (/showthread.php?tid=316243)



NPC id - Richie - 05.02.2012

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


Re: NPC id - Ballu Miaa - 05.02.2012

Decrementing? Maybe yes it can be done


Re: NPC id - Richie - 06.02.2012

How?


Re: NPC id - Konstantinos - 06.02.2012

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;
}



Re: NPC id - Vince - 06.02.2012

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.


Re: NPC id - Konstantinos - 06.02.2012

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.