SA-MP Forums Archive
Players join with id 0, and have NPC? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Server (https://sampforum.blast.hk/forumdisplay.php?fid=6)
+--- Forum: Server Support (https://sampforum.blast.hk/forumdisplay.php?fid=19)
+--- Thread: Players join with id 0, and have NPC? (/showthread.php?tid=122693)



Players join with id 0, and have NPC? - johnnyyy - 23.01.2010

Hi, I tried to search the forum, and I couldn't find anything similar to my question.

I want to know, is it possible for players to join starting at id 0 and have NPC's?
Example: I have 20 bots, and when I join my id is 19!

I just want players to join and have id's starting from 0.

Is it possible? Sorry if you can't understand my question.. it's hard to explain.


Re: Players join with id 0, and have NPC? - aNdReSkKkK - 23.01.2010

Why u want that anyway? :P

I dont think it-s posible unless the NPCs join After the player did. The player ids are given in order of logging in :P


Re: Players join with id 0, and have NPC? - Andy_McKinley - 23.01.2010

NPC-bots are counted as players too. So if you have 100 slots and 5 NPC-bots, you'll only have 95 slots.


Re: Players join with id 0, and have NPC? - johnnyyy - 23.01.2010

Aha ok, well thanks anyways. It was just bothering me that I would be first player and my id is 19 lol


Re: Players join with id 0, and have NPC? - ev0lution - 23.01.2010

Quote:
Originally Posted by McKinley
NPC-bots are counted as players too. So if you have 100 slots and 5 NPC-bots, you'll only have 95 slots.
I think he already knows that, he was asking if there could be NPCs on the server (which connect from ID 0>) and have players connecting with ID 0.

It's possible; if you added "fake" bots for the player slots from 0+, then your real NPCs, and kicked the fake ones.

Here's an example:
- I have a 100 slot server
- I have 20 NPC's
- I would have 80 playable player slots after adding the NPCs
- In that case, I would write a script to connect 80 fake bots, taking up player IDs 0-79
- The script(s) would then add the 20 real NPCs, taking up player IDs 80-99
- The script would then kick the 80 fake bots, freeing up player IDs 0-79 and allowing players to connect as normal from player ID 0+