warning Not Translated
This page has not been translated into the language that your browser requested yet. The English content is being shown as a fallback.
If you want to contribute a translation for this page then please click here.
ConnectNPC
Description
Connect an NPC to the server.
Name | Description |
---|---|
const name[] | The name the NPC should connect as. Must follow the same rules as normal player names. |
const script[] | The NPC script name that is located in the npcmodes folder (without the .amx extension). |
Returns
This function always return 1.
Examples
public OnGameModeInit()
{
ConnectNPC("[BOT]Pilot", "pilot");
return 1;
}
Notes
tip
NPCs do not have nametags. These can be scripted with Attach3DTextLabelToPlayer.
Related Functions
- IsPlayerNPC: Check if a player is an NPC or an actual player.
Related Callbacks
- OnPlayerConnect: Called when a player connects to the server.