# GetPlayerType

Player
5.1 OC
int
int player Number of the player whose type you want to retrieve.
Returns the type of a player. Possible values are:

Constant
Value
Description
C4PT_User
1
User-controlled player.
C4PT_Script
2
Script-controlled player; i.e. AI player.

If the specified player number is invalid, the return value is 0.
protected func InitializePlayer(int player) { // Is it a script player? if (GetPlayerType(player) == C4PT_Script) // then create an AI controller object for that player CreateObject(SomeAIController, 50,50, player); return true; }
Scenario script: when a script player joins, an object of definition SomeAIController is created (owned by the joining script player). This object might now control all clonks owned by this player.
Script Player
CreateScriptPlayer
Sven2
2007-12