Skip to content

Add natives and stocks to get the ADT array of items that the player has #75

Description

@IL0co
/**
 *	Creates and ADT array of client item IDs
 *	-
 *	@param client			Client index 
 *	@param size				Optional param to store array size
 *	@param category			Optional parameter to indicate the category from which to take
 *	-
 *	@return ArrayList
*/
stock ArrayList Shop_CreateArrayOfClientItems(int client, char[] category = "", int &size = 0)
{
	ArrayList _shop_array = new ArrayList();
	size = Shop_FillArrayByClientItems(client, _shop_array, category);
	return _shop_array;
}

/**
 *	Fills an adt_array by the client item ids. Note that array is cleared before being filled
 *	-
 *	@param client			Client index 
 *	@param array			ADT array to use
 *	@param category			Optional parameter to indicate the category from which to take
 *	-
 *	@return Number of bytes that written to ArrayList
*/
native int Shop_FillArrayByClientItems(int client, ArrayList array, char[] category = "");

And also add the "category" parameter to these natives and stocks:


/**
 *	Fills an adt_array by the item ids. Note that array is cleared before being filled
 *	-
 *	@param array			ADT array to use
 *	@param category			Optional parameter to indicate the category from which to take
 *	-
 *	@return Number of bytes that written to ArrayList
*/
native int Shop_FillArrayByItems(ArrayList array, char[] category = "");

/**
 *	Creates and ADT array of item ids
 *	-
 *	@param size			Optional param to store array size
 *	@param category			Optional parameter to indicate the category from which to take
 *	-
 *	@return ArrayList
*/
stock ArrayList Shop_CreateArrayOfItems(int &size = 0, char[] category = "")
{
	ArrayList _shop_array = new ArrayList();
	size = Shop_FillArrayByItems(_shop_array);
	return _shop_array;
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions