Scripting/Server/Functions/CreateBot

Creates a bot. skin is a ped model id (200-299 for custom skins).

Syntax

CreateBot(name, skin, x, y, z, angle)

Arguments

Returns

Player, or null when no slot is free

Example

function onPlayerCommand( player, cmd, params )
{
	if ( cmd == "createbot" )
	{
		local pos = player.Pos;
		local result = CreateBot( "Example", 0, pos.x, pos.y, pos.z, player.Angle );
		MessagePlayer( "CreateBot returned: " + result, player );
	}
}

This sample was generated from the signature – adapt the values to your gamemode.

Section: Bots - virtual players (v0.5-beta)

Categories: Server functions | Bots - virtual players (v0.5-beta)