API ForEachPlayer: Difference between revisions

From Vendetta Lua
Jump to navigationJump to search
split
 
No edit summary
 
Line 1: Line 1:
=== ForEachPlayer ===
{{Function
'''Definition:'''<br>
| name        = ForEachPlayer
ForEachPlayer(function func(int charid)) -> nil
| desc        = calls ''func'' with the character id of each player in the sector. that includes bots and the sector thingy itself
<br>
| arg1_name    = func
'''Description:'''<br>
| arg1_type    = function
calls ''func'' with the character id of each player in the sector. that includes bots and the sector thingy itself
| arg1_desc    = receives one argument from ForEachPlayer. func(number charid)<br>
<br>
''charid'' = character id
This function is called by the toplist when you open it.
| arg1_opt    =
<br>
| ret1_name    =
'''Arguments:'''<br>
| ret1_type    = nil
''func'' gets called for each buddy<br>
| ret1_desc    =
''ncharid'' character id <br>
| notes        = '''Example:'''<br>
<br>
<source lang="lua">ForEachPlayer(function (id) print(id) end)</source>
'''Example:'''<br>
<source lang="lua">ForEachPlayer(function (id) print(id) end)</source><br>
prints a list with all players in the sector
prints a list with all players in the sector
<br>
}}

Latest revision as of 01:57, 20 October 2011

ForEachPlayer

Definition
ForEachPlayer( function  func) ->  nil
Description
calls func with the character id of each player in the sector. that includes bots and the sector thingy itself
Arguments
Type Name Description
function func receives one argument from ForEachPlayer. func(number charid)
charid = character id
Returns
Type Name Description
nil
Notes
Example:
<source lang="lua">ForEachPlayer(function (id) print(id) end)</source> prints a list with all players in the sector