Crafting/Recipe system base -
dexi - 05.07.2013
Hi!
(First, sorry for bad English, im Hungarian :3)
With this include, you can make things in 3x3 grid. (like in game named "Minecraft")
The include just have the mechanism.. search, adding.. etc.
You must create the GUI(3x3 grid), connect to inventory.. etc.
Every grid of square have identifier. ( 0-8 )
The top lane is: 0-1-2
.. second lane: 3-4-5
.. third lane: 6-7-8
You must know this, to making recipes.
The recipes structure: [GRID ID:ITEM ID]
.. so, that is a complete recipe: "[0:1][1:1][2:1][3:2]"
Thats the way to how add recipes: addRecipe( name[], IDs[], {Float,_}:... );
Previous recipe looks like this: addRecipe( "Thing", "0123", 1112 );
(Ex.: 1 is Wood and 2 is Stone)
If you are not visualic type, you can use a function to print recipes to console.
printRecipe( recname[] );
Previous example looks like this: printRecipe( "Thing" );
To check the recipe is correct( in 3x3 grid ), you can use this: returnRecipe( recipe[] );
The returned value two different can be: -1 if the recipe not exist.
recipe id if the recipe exist.
Get recipe name from ID: getRecipeName( recipeid );
Get recipe name from recipe name: getItemNameFromRecipe( recipe[] );
If you have any question, just write to here.
Link: download
Fl0rian (dexi)
Re: Crafting/Recipe system base -
Stylock - 05.07.2013
Are you suppose to craft stuff in SA-MP console? I thought there would be visual crafting table made out of textdraws.
Re: Crafting/Recipe system base -
dexi - 05.07.2013
Thats only the processing. Without textdraw.
It is easy to connect to textdraw.
If you want, i make a textdraw to this.
Re: Crafting/Recipe system base -
CriticalRP - 05.07.2013
Thank you for sharing! Nicely done. Textdraws will just make it look better
Re: Crafting/Recipe system base -
SMW - 05.07.2013
no pict ? make it more interesting, good job anyway ..
Re: Crafting/Recipe system base -
Darnell - 09.07.2013
Pictures, anything?
Re: Crafting/Recipe system base -
XcorelloX - 09.07.2013
This is just the code behind the possibilities guys, you have to implement it to work with Textdraws, Dialogs, etc, he has only made the core code (although he did hint at a future update!)
OT: Good job.