I'm probably missing something pretty simple. I'm getting used to the new syntax and have been running into an issue with global variables, specifically with datapacks. I'm getting some errors.
PHP Code:
DataPack g_hMenuDataPack[MAXPLAYERS + 1];
func1(int iClient)
{
if(g_hMenuDataPack[iClient] != null)
{
delete g_hMenuDataPack[iClient];
g_hMenuDataPack[iClient] = null;
}
g_hMenuDataPack[iClient] = new DataPack();
g_hMenuDataPack[iClient].WriteString(strPerk);
g_hMenuDataPack[iClient].WriteCell(iPrice);
g_hMenuDataPack[iClient].WriteCell(iDuration);
}
func2(int iClient)
{
g_hMenuDataPack[iClient].Reset(); // This is where I get the "invalid datapack handle" error.
}