ConnectNPC

From SA-MP Wiki

Jump to: navigation, search


ConnectNPC was added in SA-MP 0.3a This function was added in SA-MP 0.3a and will not work in earlier versions!


Description:

Connect an NPC to the server.


Parameters:
(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.


Image:32px-Ambox_warning_orange.png

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.

In other languages