GetController

Category: Objects / Crew
Since engine version: 4.6.5.0 CP

Description

Determines which player is currently controlling an object or has last controlled it. With crew members this is usually the owning player. With vehicles it is the owner of the clonk that has last grabbed or pushed it. Objects that are collected by living things automatically change their owner to the owner of the new container. If an object changes its owner (see SetOwner()), the controller is automatically set to the new owner.

Syntax

int GetController (object pObj);

Parameter

pObj:
[opt] Object of which to get the controller. Can be 0 in local calls.

Remark

The controller value is not affected by temporary control e.g. through SetCursor.

Example

DoScore(GetController(), 100);
Gives 100 score to the player controlling the calling object.
See also: GetCursor, GetOwner, SetController
Sven2, Mai 2002