SA-MP Forums Archive
Idle NPC - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Idle NPC (/showthread.php?tid=272796)



Idle NPC - Incubator - 30.07.2011

Well I recently came back into scripting and all this NPC stuff is new to me. I'm working on a gamemode and I just can't figure out how to make a NPC which is just standing there, doing nothing. All this stuff with the recording just confuses me, can I make an NPC inside my main script and set his skin and what so ever, without having to record stuff or creating a script for him? Will the NPC take a server slot? If so, is it possible to set his ID high enough to the top of the players list?
Toturials weren't really helping me, is it possible to just create it, set its spot and simply leave it there?

Thank you.


Re: Idle NPC - PGTips - 30.07.2011

NPC do take player slots

NPC's are hidden from the Player list

Yes you can read this

Make a NPC script only with the folowing

pawn Код:
#include <a_npc>
main(){}
Load the NPC set hes possition angle interior and stuff. And freeze him.


This or just record it with no movement for 20 seconds or somthing


Re: Idle NPC - Incubator - 30.07.2011

And how do I load it? Do I not need to pass him the login process or something like this?
Oh and, will they cause other players' IDs to skip the ones used by the npcs?


Re: Idle NPC - PGTips - 30.07.2011

It wont skip player id's no what it will do is it will give the NPC's the very last id's for example id 500 also you have to goto the login and before you run the dialog or command you have to check if a player is a NPC and send him through a differnt process yes so normal Player login would be under a else statement


Re: Idle NPC - Incubator - 30.07.2011

Alright, great, so I will just process him through OnPlayerConnect, and what about onplayerspawn and others? Does he passes through them as well?

Thank you btw


Re: Idle NPC - PGTips - 30.07.2011

Its ok and yes you use onplayer spawn to set his skin and such his co-ords

and thats fine i dont mind helping


Re: Idle NPC - dowster - 30.07.2011

Also don't freak out but if you have your server set to say 500 players, and you have 45 npcs running, it will only show that you have a max players of 455. This is because the npcs are using the other 45 slots so you cannot fake having a hundred players or something like that.


Re: Idle NPC - Incubator - 31.07.2011

Uh, thank you but for some reason the IDs do not start from zero, and the NPCs take the first available slots...


Re: Idle NPC - Incubator - 31.07.2011

I don't think its possible really to set an NPC's ID to the last in the list..