Skip to content
nyfrk edited this page Aug 29, 2020 · 1 revision

ISettlers4Api::SetTradingRoute method

Set the target market/harbor of a market/harbor to establish a trading route.

Syntax

BOOL ISettlers4Api::SetTradingRoute(
	DWORD sourceBuilding, 
	DWORD destinationBuilding, 
	DWORD player
);

Parameters

sourceBuilding

The index of the building where the trade route starts. The player should own this building. It is usually a harbor or market.

destinationBuilding

The index of the building where the trade route ends. The player should own this building or be allied with the owner of this building. It is usually a harbor or market.

player

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

Return value

If this method could append the event successfully it will return TRUE. If an error occurred it will return FALSE.

Remarks

The corresponding network event id of the command is ID 5005.

The building types of the source and destination should be the same. That means they both should be either harbors or markets.

Requirements

Minimum API Level 1
Target Edition Any
Header S4ModApi.h
Library S4ModApi.lib
DLL S4ModApi.dll

See also

ISettlers4Api

ISettlers4Api::TradeGood

Clone this wiki locally