I'm using 1.10, I can upgrade to 1.11 if the bug is fixed.
It won't compile "cannot call methods on an array", but also gives a tag mismatch warning.
This is an example of what I'm trying to do:
PHP Code:
#include <sourcemod>
#include <cstrike>
enum struct enumWeaponClass
{
char WEAPONCLASS[32];
int WEAPONLEVEL;
CSWeaponID WEAPONID;
}
enumWeaponClass gWeaponClass[][] =
{
{"M4A1 Anti Zombie", 4, CSWeapon_M4A1},
{"Scar", 8, CSWeapon_SCAR20}
}
public void OnPluginStart()
{
RegConsoleCmd("sm_playerclass", ConCmdWeaponClass);
}
public Action ConCmdWeaponClass(int client, int args)
{
for(int i; i < sizeof(gWeaponClass); i++)
PrintToChat(client, "Class: %s.", gWeaponClass[i].WEAPONCLASS);
}
What would be the best way to achieve that while keeping the code simple to read and easy to modify?