Category: Objects
/ Crew
Since engine version: 1.0 OC
GetController
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();
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.