Synthesize item system for survival server
#1

Код:
enum eItem
{
	ItemID,
	Type,
	Owner,
	Value,
	Exist,
	Drop
}
#define MAX_ITEMS 1501
new Item[MAX_ITEMS][eItem];
for example,torch's synthetic formula is three wood(type0) and four grass(type1)
How to check if player don't have enough material to make torch?
I've searched it for a long time...Please tell me how to do I really need it
Reply
#2

Why not do it like this?

PHP код:
enum eItem
{
    
Type,
    
Value,
    
Exist,
    
Drop
};
new 
Inventar[MAX_PLAYERS][50][eItem]; //you can say 50 Items for Player
stock CanBuildTorch(playerid)
{
    new 
wood,grass;
    for(new 
ii<sizeof(Inventar[]); i++)
    {
        if(!
Inventar[playerid][i][Exist]) continue;
        switch(
Inventar[playerid][i][Type])
        {
            case 
0wood++;
            case 
1grass++;
        }
    }
    return (
wood >= && grass >= 4);

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)