Framework Admin Functions

Valid from Framework version 4

This section provides a list of functions that are available to server admins and a brief example of how they are used.

AFW_fnc_doSetObjectiveState

[0, 1, 2] spawn AFW_fnc_doSetObjectiveState;

This function allows an admin to set the state of objectives to match a previously saved state. This allows a mission to be resumed after a server restart or real life intervenes. Only the objective state is restored, player loadouts, vehicles and so on are not saved.

Arguments: an array of objective IDs which should be completed

AFW_fnc_getObjectiveState

_state = [] call AFW_fnc_getObjectiveState;

This function allows an admin to retrieve a list of completed objective IDs that can be saved in an email or text file and later reloaded into the server.

Arguments: None

AFW_fnc_createAmmobox

ammobox = [position player, 10] call AFW_fnc_createAmmobox;

This function creates a global ammobox with the given radius of a position and returns a handle so that it can be populated with ammunition. Useful for creating a "magic" resupply. Also sets the value of the public variable FW_last_user_ammobox to the newly created ammobox

Arguments:

  1. A position to search around
  2. The radius to search within for a safe place

Returns: An ammobox object

AFW_fnc_populateAmmobox

ammobox = [position player, 10, ["Medikit", ["FirstAidKit", 10]], [], ["30Rnd_65x39_caseless_mag"]] call AFW_fnc_populateAmmobox;

This function creates a global ammobox with the given radius of a position and populates it with the passed items, weapons and magazines.

Passed variables are classnames and can either be a string or an array. Supply an empty array [] to add nothing in the given category. If a string is passed then a single weapon/item/magazine will be added. If an array is passed the first element should be the classname and the second should be the quantity. See the example below. Uses FW_fnc_createAmmobox internally so it returns a handle to the ammobox and sets the value of the public variable FW_last_user_ammobox to the newly created ammobox.

Arguments:

  1. A position to search around
  2. The radius to search within for a safe place
  3. An array of items to add (elements are string class name for 1 item, or [className, quantity] arrays for multiple)
  4. An array of weapons to add (elements are string class name for 1 item, or [className, quantity] arrays for multiple)
  5. An array of magazines to add (elements are string class name for 1 item, or [className, quantity] arrays for multiple)

Returns: An ammobox object