getCS

(/rs/public/functions.php)

getCS -- Member in given command position in given unit.

Description

mixed getCS ($cs, $id, $type = 'Squadron')

This function will return the member id in the specified command position in the specified unit.

$cs is the command position in question. It can have values "CO" or "co", "XO" or "xo", "SO" or "so".

$id is the unit id to check. It is of type integer.

$type is the type of unit that $id specifies. It defaults to "Squadron" but can also be "Fleet" or "Wing".

This function returns a member pin if a member exists in the position. It returns 0 if the position is empty. It returns the string "Invalid function call." on failure.

Examples

getCS ("co", 1, "Wing") /* Returns the member id in the CO position of the wing with id 1. */

getCS ("XO", 1) /* Returns the member id in the XO position of the squadron with id 1. */

getCS ("foo", 1) /* Returns the string "Invalid function call." */

Related Functions

getCO, getXO, getSO

Dependencies

None.

Function Index