Is it even possible?
#4

A simple GetPublicName function
PHP код:
stock GetPublicName(idxbuffer[32]) {
    if(
idx >= 0) {
        new
            
publics,
            
natives
        
;
        
#emit lctrl 1
        #emit const.alt 32
        #emit sub.alt
        #emit stor.s.pri publics
        #emit add.c 4
        #emit stor.s.pri natives
        #emit lref.s.pri natives
        #emit stor.s.pri natives
        #emit lref.s.pri publics
        #emit load.s.alt idx
        #emit shl.c.alt 3
        #emit add
        #emit stor.s.pri publics
        
if(publics natives) {
            
#emit lctrl 1
            #emit move.alt
            #emit load.s.pri publics
            #emit add.c 4
            #emit sub
            #emit stor.s.pri publics
            #emit lref.s.pri publics
            #emit sub
            #emit stor.s.pri natives
            
for(idx 0; ; natives += 4) {
                
#emit lref.s.pri natives
                #emit stor.s.pri publics
                
if((buffer[idx++] = publics 0xFF) == EOS || (buffer[idx++] = publics >> 0xFF) == EOS || (buffer[idx++] = publics >> 16 0xFF) == EOS || (buffer[idx++] = publics >>> 24) == EOS) {
                    return 
idx;
                }
            }
        }
    }
    return 
0;

PHP код:
// global
new
    
gCmdList[512// change its value depending on how many commands you got 
;
// OnGameModeInit
    
new
        
i,
        
buffer[32]
    ;
    while(
GetPublicName(ibuffer)) {
        if(
strcmp(buffer"cmd_"false4) == 0) {
            
buffer[2] = '\n';
            
buffer[3] = '/';
            
strcat(gCmdListbuffer[2]);
        }
        
i++;
    }
    print(
gCmdList[1]); 
Reply


Messages In This Thread
Is it even possible? - by Sjn - 20.05.2016, 07:38
Re: Is it even possible? - by oMa37 - 20.05.2016, 07:41
Re: Is it even possible? - by Sjn - 20.05.2016, 07:48
Re: Is it even possible? - by Nero_3D - 20.05.2016, 10:33

Forum Jump:


Users browsing this thread: 2 Guest(s)