Raised This Month: $ Target: $400
 0% 

Code change/remove


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
asd13
Member
Join Date: Apr 2009
Old 10-25-2009 , 12:59   Code change/remove
Reply With Quote #1

Could anyone remove unwanted code like the banning.
Leave only the logging and player sayng
.
Code:
public hook_say(id, level, cid) {
    read_args(g_allArgs, 1023)
    g_result = regex_match(g_allArgs, PATTERN, g_returnvalue, g_error, 63)
    switch (g_result) {
        case REGEX_MATCH_FAIL: {
            log_amx("REGEX_MATCH_FAIL! %s", g_error)
            return PLUGIN_CONTINUE
        }
        case REGEX_PATTERN_FAIL: {
            log_amx("REGEX_PATTERN_FAIL! %s", g_error)
            return PLUGIN_CONTINUE
        }
        case REGEX_NO_MATCH: {
            return PLUGIN_CONTINUE
        }
        default: {
            if (get_cvar_num(CVAR_BANVIOLATORS)) {
                new userid = get_user_userid(id)
                new minutesString[10]
                get_cvar_string(CVAR_BANMINUTES, minutesString, 9)
                new temp[64], banned[16], minutes = get_cvar_num(CVAR_BANMINUTES)
    
                if (minutes)
                    format(temp, 63, "%L", id, "FOR_MIN", minutesString)
                else
                    format(temp, 63, "%L", id, "PERM")
                
                format(banned, 15, "%L", id, "BANNED")
    
                new authid[32]
                get_user_authid(id, authid, 31)
    
                new name[32]
                get_user_name(id, name, 31)
                log_amx("%s (%s), %s %s because of advertising an IP address. This was written: ^"%s^"", name, authid, banned, temp, g_allArgs)
    
                server_cmd("kick #%d ^"%s (%s %s)^";wait;banid ^"%d^" ^"%s^";wait;writeid", userid, REASON, banned, temp, minutes, authid)                
            }
            else {
                client_cmd(id, "say ^"I must say.... This server ROCKS!^"")
            }
            regex_free(g_result)
            return PLUGIN_HANDLED // block msg
        }
    }
    
    return PLUGIN_CONTINUE
}
asd13 is offline
 



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 17:42.


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