Difference between revisions of "Bz APIIntList"

From BZFlagWiki
Jump to: navigation, search
m (BzAPIIntList moved to Bz APIIntList over redirect: Undo...)
(More clarity on the bz_APIIntList data type so others know how to use it. Mimicked the Bz_APIStringList template. (sigonasr2))
Line 1: Line 1:
A list of integers. This is used for passing lists of integers from the bzfs api itself to the plugin that uses the api.
+
An array of integers. This is used for passing lists of integers from the BZFS API itself to the plugin that uses the API.
 +
 
 +
== Usage ==
 +
 
 +
bz_APIIntList *playerList = bz_newIntList();
 +
bz_getPlayerIndexList(playerList);
 +
int i;
 +
for (i=0;i<playerList->size();i++) {
 +
        // Use (*playerlist)[i] to grab the integer.
 +
        bz_sendTextMessage(BZ_SERVER,(*playerlist)[i],"Welcome to the server!");
 +
}

Revision as of 08:56, 6 October 2011

An array of integers. This is used for passing lists of integers from the BZFS API itself to the plugin that uses the API.

Usage

bz_APIIntList *playerList = bz_newIntList();
bz_getPlayerIndexList(playerList);
int i;
for (i=0;i<playerList->size();i++) {
        // Use (*playerlist)[i] to grab the integer.
        bz_sendTextMessage(BZ_SERVER,(*playerlist)[i],"Welcome to the server!");
}