GetPlayerBrain
From Data Realms Wiki
(Difference between revisions)
Line 5: | Line 5: | ||
|description = Returns current brain for specified player. | |description = Returns current brain for specified player. | ||
|codedesc = Finds any brains that belongs to the active human players. The pointer returned by GetPlayerBrain is not guaranteed to be safe to access so check it with MovableMan:IsActor before using it. | |codedesc = Finds any brains that belongs to the active human players. The pointer returned by GetPlayerBrain is not guaranteed to be safe to access so check it with MovableMan:IsActor before using it. | ||
- | |code = <code lua n>for player = Activity.PLAYER_1, Activity.MAXPLAYERCOUNT - 1 do | + | |code = <code lua n>local Activ = ActivityMan:GetActivity() |
+ | for player = Activity.PLAYER_1, Activity.MAXPLAYERCOUNT - 1 do | ||
if Activ:PlayerActive(player) then | if Activ:PlayerActive(player) then | ||
local Brain = Activ:GetPlayerBrain(player) | local Brain = Activ:GetPlayerBrain(player) |
Latest revision as of 15:41, 1 June 2011
Function | |
---|---|
Syntax | GetPlayerBrain( (number) Team ) |
Description: | |
Returns current brain for specified player. | |
Returns | Actor |
Example | |
---|---|
Description | Finds any brains that belongs to the active human players. The pointer returned by GetPlayerBrain is not guaranteed to be safe to access so check it with MovableMan:IsActor before using it. |
Code |
|
Output | Prints the player number of any active brain that belongs to a human player. |