ConnectNPCEx
This function was added in v1.5 and will not work on previous versions.
Description:
Connect an NPC to the server with extended parameters
Parameters:
(name, x, y, z, angle, skinId, weaponId, script="", host="127.0.0.1", ...)
name : The name for the NPC to connect to server.
x : The x co-ordinate where the npc is to be spawned.
y : The y co-ordinate where the npc is to be spawned.
z : The z co-ordinate where the npc is to be spawned.
Optional parameters
angle : The npc's angle
skinId : The skin for the npc. Note that clients in VCMP 0.4 can not set skin by themselves. It is the server which can set skins. So if this paramter is provided then a command "_npc_skin_request skinId" will be send to server when spawning for first time.
weaponId : The weapon in npc's hand when spawning for the first time. Note that this must be one of the three weapons of the first spawn class of the server. Otherwise sometimes the server kick npc for 'acquiring' weapons.
script : The script NPC may use. This script must reside in npcscripts folder. From v1.5 this has been made optional. ie. npc's can be created without any script.
host : This IP address of the host.
... : The optional string parameters. If specified they are passed as an array to OnNPCScriptLoad
Return Values:
This function does not return any specific values.
Example
function onScriptLoad() { ConnectNPCEx("Mercedes",100.0,200.0,10.0,0.0,116,0,"","","paramter1", "parameter2", "parameter3"); }
Related Functions
The following functions may be helpful as they relate to this function in one way or another.