[Include] Crafting/Recipe system base
#1

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)
Reply
#2

Are you suppose to craft stuff in SA-MP console? I thought there would be visual crafting table made out of textdraws.
Reply
#3

Thats only the processing. Without textdraw.
It is easy to connect to textdraw.

If you want, i make a textdraw to this.
Reply
#4

Thank you for sharing! Nicely done. Textdraws will just make it look better
Reply
#5

no pict ? make it more interesting, good job anyway ..
Reply
#6

Pictures, anything?
Reply
#7

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)