ConnectNPC
Description:
Function ConnectNPC connect an NPC to the server.
Function ConnectNPC was added in 0.3a and will not work in earlier versions! |
NPCs do not have nametags. These can be scripted with Attach3DTextLabelToPlayer. |
Parameters:
(name[], script[])
string | name | The name the NPC should connect as. Must follow the same rules as normal player names. |
string | script | The NPC script name that is located in the npcmodes folder (without the .amx extension). |
Return Values:
This function always return 1.
Examples:
public OnGameModeInit() { ConnectNPC("[BOT]Pilot", "pilot"); return 1; }
Related Functions
The following functions may be useful, as they are related to this function in one way or another.
- IsPlayerNPC: Check if a player is an NPC or an actual player.
Related Callbacks
The following callbacks might be useful as well, as they are related to this callback in one way or another.
- OnPlayerConnect: Called when a player connects to the server.