21.04.2012, 12:17
Alright, got it, thanks!
Will update quite soon.
pawn Code:
stock GetPublicNameByIndex(iIdx, szName[], iSize = sizeof(szName)) {
static
s_iBase,
s_iPublics,
s_iNatives,
s_iCount
;
if(!s_iBase) {
#emit LCTRL 1
#emit NEG
#emit STOR.PRI s_iBase
}
if(!s_iPublics) {
new
iAddr
;
#emit LOAD.PRI s_iBase
#emit ADD.C 32
#emit STOR.S.PRI iAddr
#emit LREF.S.PRI iAddr
#emit LOAD.S.ALT iAddr
#emit ADD
#emit CONST.ALT 32
#emit SUB
#emit STOR.PRI s_iPublics
}
if(!s_iNatives) {
new
iAddr
;
#emit LOAD.PRI s_iBase
#emit ADD.C 36
#emit STOR.S.PRI iAddr
#emit LREF.S.PRI iAddr
#emit LOAD.S.ALT iAddr
#emit ADD
#emit CONST.ALT 36
#emit SUB
#emit STOR.PRI s_iNatives
}
if(!s_iCount) {
s_iCount = ((s_iNatives - s_iPublics) >>> 3);
}
if(iIdx < s_iCount) {
new
iPos = (iIdx << 3) + s_iPublics + 4,
iCh,
i
;
#emit LREF.S.PRI iPos
#emit LOAD.ALT s_iBase
#emit ADD
#emit STOR.S.PRI iPos
do {
#emit LREF.S.PRI iPos
#emit STOR.S.PRI iCh
szName[i] = iCh & 0xFF;
iPos++;
} while(szName[i++] != EOS && i <= iSize);
szName[i] = EOS;
return 1;
}
return 0;
}