AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Help with ban (https://forums.alliedmods.net/showthread.php?t=208143)

Artifact 02-10-2013 11:19

Help with ban
 
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?

fysiks 02-10-2013 13:36

Re: Help with ban
 
Ask the person who edited it for you. The first thing that I would do is make sure that the original plugin works. If it works with no issues then you know that what ever was changed is causing it.

Artifact 02-10-2013 14:28

Re: Help with ban
 
Im edited this... But original plugin work and this wont... I dont know why...

Unkolix 02-10-2013 14:54

Re: Help with ban
 
Quote:

Originally Posted by fysiks (Post 1891783)
Ask the person who edited it for you. The first thing that I would do is make sure that the original plugin works. If it works with no issues then you know that what ever was changed is causing it.

Quote:

Originally Posted by Artifact (Post 1891839)
Im edited this... But original plugin work and this wont... I dont know why...

As fysiks said, you must have done a mistake. If you could show us what you've changed, we might help.

Artifact 02-11-2013 03:05

Re: Help with ban
 
http://pastebin.com/diff.php?i=4Ei1yp9k


All times are GMT -4. The time now is 20:33.

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