Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
IL0co opened this issue Aug 14, 2020 · 0 comments
Open

Comments

@IL0co
Copy link
Collaborator

IL0co commented Aug 14, 2020

/**
 *	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;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants