I think there is
ArrayPushArray and
ArrayGetArray act like nested arrays for AMXX. (I have never messing around with it though)
Something like this
PHP Code:
enum _:wpn_data
{
W_Name[50],
W_Type,
W_Cost
}
new Array:g_Weapon
new g_WeaponCount
public plugin_precache()
{
g_Weapon = ArrayCreate(wpn_data)
}
public RegisterWeapon(const Name[], type, cost)
{
new g_Data[wpn_data]
copy(g_Data[W_Name], charsmax(g_Data), Name)
g_Data[W_Type] = type;
g_Data[W_Cost] = cost
ArrayPushArray(g_Weapon, g_Data) //Push it all into g_Weapon (so it is only 1 Array)
g_WeaponCount++
return g_WeaponCont - 1 //Give out WeaponID
}
public Native_Get_Weapon_Info(weaponid, const info[])
{
new g_Data[wpn_data]
ArrayGetArray(g_Weapon, weaponid, g_Data)
//Now we got all data we need in g_Data
//I forget how to push it to Info parameter to retrieve it other plugins :P
}
But usually, I would prefer only getting what I need (for example: classname) via 1 Array since I am not sure how costly it is if getting a lot of it when getting all of class data at once and then never use the remaining data.
But hey, I haven't use it before so I might being bs here
__________________