# GetPlayerType

Player
4.9.6.0 CR
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) { // Ist es ein Scriptspieler? if (GetPlayerType(player) == C4PT_Script) { // Dann ein KI-Objekt erstellen CreateObject(_EAI, 50,50, player); } return true; }
Scenario script: when a script player joins, an object of definition _EAI 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