KissLick
10-08-2014, 12:48
Ciao guys,
I'd like to use dynamic array of enums, I got this code, but I also have a lot of error and I am not sure why...
enum Enum_Fence {
m_iIndex,
Float:m_fPosA[3],
Float:m_fPosC[3]
}
new Handle:g_hFences;
/*
.
.
.
*/
g_hFences = CreateArray(_:Enum_Fence);
new eFence[Enum_Fence];
if (KvGotoFirstSubKey(hKeyValues)) {
do {
if ((eFence[m_iIndex] = KvGetNum(hKeyValues, "index", -1)) == -1) {
LogError("Reading Error in %s. (Invalid index)", sPath);
return;
}
KvGetVector(hKeyValues, "PositionA", eFence[m_fPosA]); // error 047: array sizes do not match, or destination array is too small
KvGetVector(hKeyValues, "PositionC", eFence[m_fPosC]); // error 047: array sizes do not match, or destination array is too small
new iIndex = PushArrayArray(g_hFences, eFence); // warning 229: index tag mismatch (symbol "eFence")
CreateFence(eFence[m_fPosA], eFence[m_fPosC], iIndex); // error 047: array sizes do not match, or destination array is too small
} while (KvGotoNextKey(hKeyValues));
}
Can someone help me please?
EDIT: CreateFence header
CreateFence(Float:a[3], Float:c[3], iIndex)
I'd like to use dynamic array of enums, I got this code, but I also have a lot of error and I am not sure why...
enum Enum_Fence {
m_iIndex,
Float:m_fPosA[3],
Float:m_fPosC[3]
}
new Handle:g_hFences;
/*
.
.
.
*/
g_hFences = CreateArray(_:Enum_Fence);
new eFence[Enum_Fence];
if (KvGotoFirstSubKey(hKeyValues)) {
do {
if ((eFence[m_iIndex] = KvGetNum(hKeyValues, "index", -1)) == -1) {
LogError("Reading Error in %s. (Invalid index)", sPath);
return;
}
KvGetVector(hKeyValues, "PositionA", eFence[m_fPosA]); // error 047: array sizes do not match, or destination array is too small
KvGetVector(hKeyValues, "PositionC", eFence[m_fPosC]); // error 047: array sizes do not match, or destination array is too small
new iIndex = PushArrayArray(g_hFences, eFence); // warning 229: index tag mismatch (symbol "eFence")
CreateFence(eFence[m_fPosA], eFence[m_fPosC], iIndex); // error 047: array sizes do not match, or destination array is too small
} while (KvGotoNextKey(hKeyValues));
}
Can someone help me please?
EDIT: CreateFence header
CreateFence(Float:a[3], Float:c[3], iIndex)