Raised This Month: $ Target: $400
 0% 

Help with ban


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Artifact
Veteran Member
Join Date: Jul 2010
Old 02-10-2013 , 11:19   Help with ban
Reply With Quote #1

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <colorchat>

#define PLUGIN "Ban"
#define VERSION "1.0.4"
#define AUTHOR "kuddo [edited by good.]"

new const file[] = "glad_bans.txt"
static const banurl[] = "www.site.domen"

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_concmd("amx_ban","banwithproof",ADMIN_BAN,"<name> <time> <reason>")
    
register_cvar("amx_banurl",banurl)
}


public 
banwithproof(id,level,cid){
    if(!
cmd_access(id,level,cid,2))
        return 
PLUGIN_HANDLED;

    new 
authid[32], ipadd[32], name[32], admin_name[32], reason[32], CurrentTime[9], hostname[64] ,banurl[64]
    new 
arg[32], arg2[32]
    
    
read_argv(1,arg,31)
    
read_argv(2,arg2,31)
    if(!
strlen(arg2))
    {
        
console_print(id"[GLADIATOR BAN] You must type the reason!")
        return 
PLUGIN_HANDLED
    
}
    
read_argv(3reason31)
    
    new 
target cmd_target(id,arg,CMDTARGET_ALLOW_SELF)
    
    if (!
target)
    {
        
console_print(id"[GLADIATOR BAN] Player not found")
        return 
PLUGIN_HANDLED
    
}
    
    if(
str_to_num(arg2) >= 9000)
    {
        if(
get_user_flags(id) & ADMIN_RCON)
        {
            
console_print(id"[GLADIATOR BAN] Just owners can ban over 9000 minutes!")
            return 
PLUGIN_HANDLED
        
}
    }
    
    if(
str_to_num(arg2) <= 0)
    {
        if(
get_user_flags(id) & ADMIN_RCON)
        {
            
console_print(id"[GLADIATOR BAN] Just owners can ban permanently!")
            return 
PLUGIN_HANDLED
        
}
    }
    
    
get_user_ip(target,ipadd,31)
    
get_cvar_string("hostname",hostname,63
    
get_user_name(target,name,31)
    
get_user_authid(target,authid,31)
    
get_cvar_string("amx_banurl"banurl,63)
    
get_user_name(idadmin_name31)
    
    
ColorChat(targetNORMAL"^3[Server] ^1%s"hostname)
    
ColorChat(targetNORMAL"^3[Nick] ^1%s ^3[SteamID] ^1%s ^3[IP] ^1%s"nameauthidipadd)
    
ColorChat(targetNORMAL"^3[Admin] ^1%s ^3[Reason] ^1%s"admin_namereason)
    
    
get_time("%m/%d/%Y - %H:%M:%S",CurrentTime,31)
    
    
ColorChat(targetNORMAL"^3[Time] ^1%s ^3[Ban Length] ^1%s"CurrentTimearg2)
    
ColorChat(targetNORMAL"^3[Forum] ^4%s"banurl)
    
    
console_print(target,"[Server] %s",hostname)
    
console_print(target,"[Nick] %s [SteamID] %s [IP] %s",name,authid,ipadd)
    
console_print(target,"[Admin] %s [Reason] %s",admin_name,reason
    
console_print(target,"[Time] %s [Ban Length] %s",CurrentTimearg2)
    
console_print(target,"[Forum] For unban, visit %s",banurl)
    
    new 
main_text[100]
    
formatex(main_text99"%s | IP: %s | STEAMid: %s | ADMIN: %s | REASON: %s^n",name,ipadd,authid,admin_name,reason)
    
    
log_to_file(file,main_text)
    
    
client_cmd(target,"wait;wait;snapshot;wait;snapshot")
    
    if(
equali(authid"VALVE"))
    {
        
server_cmd("amx_banip ^"%s^" %d"name,arg2)
        return 
PLUGIN_HANDLED
    
}
    
server_cmd("amx_ban ^"%s^" %d ^"%s^""name,arg2,reason)
    return 
PLUGIN_HANDLED

This is edited version of BanShot plugin... But server crash everytime when I enable this plugin... Why?
__________________

Last edited by Artifact; 02-10-2013 at 11:20.
Artifact 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 20:33.


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