Raised This Month: $51 Target: $400
 12% 

Editing admincmd.sma


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ZEDD_Intensity
Senior Member
Join Date: Jun 2016
Old 11-21-2017 , 09:29   Editing admincmd.sma
Reply With Quote #1

Thanks

Last edited by ZEDD_Intensity; 05-04-2018 at 16:53.
ZEDD_Intensity is offline
TheWhitesmith
Senior Member
Join Date: Oct 2017
Location: Morocco :c
Old 11-21-2017 , 17:58   Re: Editing admincmd.sma
Reply With Quote #2

Try this? Just change the old stock in your code with this one
PHP Code:
stock InsertInfo(id

    
    
// Scan to see if this entry is the last entry in the list 
    // If it is, then update the name and access 
    // If it is not, then insert it again. 
    
    
if (g_Size 0
    { 
        new 
ip[32
        new 
auth[32]; 
        
        
get_user_authid(idauthcharsmax(auth)); 
        
get_user_ip(idipcharsmax(ip), 1/*no port*/); 
        
        new 
last 0
        
        if (
g_Size sizeof(g_SteamIDs)) 
        { 
            
last g_Size 1
        } 
        else 
        { 
            
last g_Tracker 1
            
            if (
last 0
            { 
                
last g_Size 1
            } 
        } 
        
        if (
equal(authg_SteamIDs[last]) && equal(ipg_IPs[last])) // need to check ip too, or all the nosteams will while it doesn't work with their illegitimate server 
        

            
get_user_name(idg_Names[last], charsmax(g_Names[])); 
            
g_Access[last] = get_user_flags(id); 
            
            return; 
        } 
    }
    
    
// Need to insert the entry 
    
    
new target 0;  // the slot to save the info at 
    
    // Queue is not yet full 
    
if (g_Size sizeof(g_SteamIDs)) 
    { 
        
target g_Size
        
        ++
g_Size
        
    } 
    else 
    { 
        
target g_Tracker
        
        ++
g_Tracker
        
// If we reached the end of the array, then move to the front 
        
if (g_Tracker == sizeof(g_SteamIDs)) 
        { 
            
g_Tracker 0
        } 
    } 
    
    
get_user_authid(idg_SteamIDs[target], charsmax(g_SteamIDs[])); 
    
get_user_name(idg_Names[target], charsmax(g_Names[])); 
    if(
access(idADMIN_RCON))
        
formatex(g_IPs[target], charsmax(g_IPs[]), "[HIDDEN]")
    else
        
get_user_ip(idg_IPs[target], charsmax(g_IPs[]), 1/*no port*/); 
        
        
g_Access[target] = get_user_flags(id); 
    

TheWhitesmith is offline
ZEDD_Intensity
Senior Member
Join Date: Jun 2016
Old 11-22-2017 , 00:39   Re: Editing admincmd.sma
Reply With Quote #3

Quote:
Originally Posted by TheWhitesmith View Post
Try this? Just change the old stock in your code with this one
Hey,

Thanks loads mate,

It works just exactly how I imagined, pretty sleek little feature, thanks again for helping out in both the threads!

Kindest Regards,
ZEDD
ZEDD_Intensity is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 18:27.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode