Difference between revisions of "API ForEachPlayer"

From Vendetta Lua
Jump to: navigation, search
(split)
 
 
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:

ForEachPlayer(function (id) print(id) end)

prints a list with all players in the sector