[Tutorial] Inventory System (new.pwn)
#9

A few critiques:

1. Use SQLite (Better than Dini and alternative to MySQL and INI file saving systems and NATIVE-LY implemented in SA-MP!!)
2. Use one array for all the object information and macros?

PHP Code:
#define        GetObjectName(%0)            \
            
gObjects[%0][E_OBJECT_NAME]
#define        GetObjectModelID(%0)        \
            
gObjects[%0][E_OBJECT_ID]
#define        GetObjectDescription(%0)    \
            
gObjects[%0][E_OBJECT_DESCRIPTION]
enum E_OBJECTS {
    
E_OBJECT_ID,
    
E_OBJECT_NAME[10],
    
E_OBEJCT_DESCRIPTION[100],
};
enum {
    
OBJECT_M4A1,
};
new 
gObjects[][E_OBJECTS] = {
    {
356,    "M4A1",        "The M4A1 is a fully automatic variant of the M4 carbine – a shorter and lighter variant of the M16."}
}; 
Reply


Messages In This Thread
Inventory System (new.pwn) - by Adain - 11.11.2017, 23:17
Re: Inventory System (new.pwn) - by Kane - 12.11.2017, 00:00
Re: Inventory System (new.pwn) - by Ponga - 12.11.2017, 01:13
Re: Inventory System (new.pwn) - by Zeth - 12.11.2017, 02:59
Re: Inventory System (new.pwn) - by Adain - 12.11.2017, 07:18
Re: Inventory System (new.pwn) - by Eoussama - 12.11.2017, 08:24
Re: Inventory System (new.pwn) - by Janoz12 - 22.06.2018, 21:07
Re: Inventory System (new.pwn) - by CodeStyle175 - 22.06.2018, 21:22
Re: Inventory System (new.pwn) - by Logic_ - 22.06.2018, 21:32
Re: Inventory System (new.pwn) - by JasonRiggs - 22.06.2018, 22:24

Forum Jump:


Users browsing this thread: 1 Guest(s)