Skip to content
nyfrk edited this page Feb 3, 2022 · 2 revisions

ISettlers4Api::SettlersAdd method

Add Settlers to the world.

Syntax

BOOL ISettlers4Api::SettlersAdd(
	S4_SETTLER_ENUM settlerType, 
    DWORD amount,
	INT x, 
	INT y,
	DWORD player
);

Parameters

settlerType

The settler type you want to spawn. See S4_SETTLER_ENUM for a list of possible settler types.

amount

Specifies how many units you want to spawn.

x

This is the x coordinate on the map for the settlers.

y

This is the y coordinate on the map for the settlers.

player

The player who issues the command. Use 0 (zero) to issue this event as the local player.

Return value

If this method could execute successfully it will return TRUE. If an error occurred it will return FALSE.

Remarks

There is no event for this method so it will desync your game if used in multiplayer unless all participants execute the method with the very same arguments at the very same tick.

Requirements

Minimum API Level 1
Target Edition HistoryEdition
MD5: C13883CBD796C614365AB2D670EAD561
Header S4ModApi.h
Library S4ModApi.lib
DLL S4ModApi.dll

See also

ISettlers4Api

Settlers.AddSettlers (s4.muffinmar.io)

Clone this wiki locally