My original suggestion works perfectly for me:
PHP Code:
enum myEnum {NAME[32], Float:CHANCE};
new myArray[][myEnum] =
{
{"item1", 10.1},
{"item2", 20.1},
{"item3", 30.1},
{"item4", 40.1},
}
public cmdTest()
{
server_print("sum: %f", myFunction(myArray, sizeof myArray, CHANCE))
}
stock Float:myFunction(array[][], size, const index)
{
new Float:fProb = 0.0
for( new i = 0; i < size; i++ )
{
fProb += Float:array[i][index]
}
return fProb
}
Output is:
Which is correct. Without the "Float:" where I said to put it, I get
Code:
sum: 4409498112.000000
__________________