SetOwner

Category: Objects / Status
Since engine version: 4.6.5.0 CP

Description

Changes the owner of an object.

Syntax

bool SetOwner (int iNewOwner, object pObj);

Parameters

iNewOwner:
Player number of the new owner. -1 for no owner.
pObj:
[opt] Object the owner of which you want to change. Can be 0 in local calls.

Remark

This function also changes the controller to the new owner

Example

protected func Entrance(pContainer) { SetOwner(GetOwner(pContainer)); return(); }
This object changes its owner when it is collected.
See also: GetOwner, MakeCrewMember, SetController
Sven2, November 2001