ConnectNPC
From SA-MP Wiki
Description:
Connect an NPC to the server.
(name[], script[])
name[] | The name the NPC should connect as. Must follow the same rules as normal player names. |
script[] | The NPC script name that is located in the npcmodes folder (without the .amx extension). |
Return Values:
This function always return 1.
Note | NPCs do not have nametags. These can be scripted with Attach3DTextLabelToPlayer. |
Example Usage:
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 they're related to this function in one way or another.
- OnPlayerConnect: Called when a player connects to the server.