You just read sData, and counted it, you didn't place the result anywhere, sData is a local variable ( Outside of the function, it doesn't exist ).
You are using the var ButtonsID wrong.
Try doing something like:
PHP Code:
//Make a global var
new g_iButtons[MAX_BUTTONS],
g_iButtonCounter;
new sData[128];
if(iFileHandle)
{
while(!feof(iFileHandle))
{
fgets(iFileHandle, sData, charsmax(sData)); // Read data to a local variable sData
trim(sData);
g_iButtons[g_iButtonCounter] = str_to_num( sData ); // This will hold your button id
g_iButtonCounter++; // Count the number of buttons, also use it to index an array in the line above
}
fclose(iFileHandle);
}
else
{
set_fail_state("Couldn't read from a file");
}
}
That is if you don't feel comfortable using cellarrays
__________________