Category:NPC文档

From SA-MP Wiki

Jump to: navigation, search


介绍

The NPCs (Non-Playing Characters, also known as 'bots') are a feature introduced since SA-MP 0.3. This new feature allows you to add one or more NPCs inside your server who will work like 'virtual players'. They use a server slot, just like a player would do. What the NPCs do inside your server is scripted using PAWN scripts. The scripts with the 'artificial inteligence' of each NPC isn't scripted inside the gamemode file, nor in a filterscript. They use their own compiled scripts for this task, which have to stay inside the npcmodes directory. That is, if you want to have 20 different NPCs doing different things, you will most likely have to have 20 pawn compiled scripts inside the npcmodes directory. This doesn't mean that you can't use the normal player functions applied to your NPCs (like SetPlayerPos, for example) from inside a gamemode or filterscript.

Each NPC runs in its own process. This can make better use for multi-core proccesors. The new NPC feature adds some more callbacks and functions which can be used just inside NPC scripts. Normally, these scripts just include the a_npc include file, and not the a_samp one as most gamemodes and filterscripts do. There are also a couple of added functions which work in gamemodes and filterscripts to make easier the NPC handling.

The following resources are exclusive for NPC scripts, unless otherwise is stated:

NPC 脚本回调

NPC 脚本函数

只能用在游戏模式/附加脚本里的函数


Subcategories

There is 1 subcategory to this category.

N

Articles in category "NPC文档"

There are 0 articles in this category.
In other languages