SHOW:
|
|
- or go back to the newest paste.
| 1 | #include <amxmodx> | |
| 2 | #include <amxmisc> | |
| 3 | #include <colorchat> | |
| 4 | - | #define PLUGIN "Ban with proof" |
| 4 | + | |
| 5 | #define PLUGIN "Ban" | |
| 6 | - | #define AUTHOR "[lego]F34R and re-scripted by kuddo" |
| 6 | + | |
| 7 | #define AUTHOR "good." | |
| 8 | - | static const banurl[] = "" |
| 8 | + | |
| 9 | new const file[] = "glad_bans.txt" | |
| 10 | - | new Bantype |
| 10 | + | static const banurl[] = "www.site.domen" |
| 11 | ||
| 12 | public plugin_init() {
| |
| 13 | register_plugin(PLUGIN, VERSION, AUTHOR) | |
| 14 | - | register_concmd("amx_banshot","banwithproof",ADMIN_BAN,"<name> <time> <reason>")
|
| 14 | + | register_concmd("amx_ban","banwithproof",ADMIN_BAN,"<name> <time> <reason>")
|
| 15 | register_cvar("amx_banurl",banurl)
| |
| 16 | - | Bantype = register_cvar("amx_banshot_type", "2")
|
| 16 | + | |
| 17 | ||
| 18 | ||
| 19 | public banwithproof(id,level,cid){
| |
| 20 | if(!cmd_access(id,level,cid,2)) | |
| 21 | return PLUGIN_HANDLED; | |
| 22 | ||
| 23 | new authid[32], ipadd[32], name[32], admin_name[32], reason[32], CurrentTime[9], hostname[64] ,banurl[64] | |
| 24 | new arg[32], arg2[32] | |
| 25 | - | new arg[32], arg2[32], temp[2] |
| 25 | + | |
| 26 | read_argv(1,arg,31) | |
| 27 | read_argv(2,arg2,31) | |
| 28 | if(!strlen(arg2)) | |
| 29 | {
| |
| 30 | - | new target = cmd_target(id,arg,1) |
| 30 | + | console_print(id, "[GLADIATOR BAN] You must type the reason!") |
| 31 | return PLUGIN_HANDLED | |
| 32 | - | if (!target) return PLUGIN_HANDLED |
| 32 | + | |
| 33 | read_argv(3, reason, 31) | |
| 34 | ||
| 35 | new target = cmd_target(id,arg,CMDTARGET_ALLOW_SELF) | |
| 36 | ||
| 37 | if (!target) | |
| 38 | {
| |
| 39 | console_print(id, "[GLADIATOR BAN] Player not found") | |
| 40 | return PLUGIN_HANDLED | |
| 41 | } | |
| 42 | - | log_to_file("BannedwithSS.txt"," %s | IP: %s | STEAMid: %s | ADMIN: %s | REASON: %s^n",name,ipadd,authid,admin_name,reason)
|
| 42 | + | |
| 43 | if(str_to_num(arg2) >= 9000) | |
| 44 | - | client_print(target,print_chat, "[Server] %s",hostname) |
| 44 | + | {
|
| 45 | - | client_print(target,print_chat, "[Name] %s [STEAMid] %s [IP] %s",name,authid,ipadd) |
| 45 | + | if(get_user_flags(id) & ADMIN_RCON) |
| 46 | - | client_print(target,print_chat, "[Admin] %s [Reason] %s",admin_name,reason) |
| 46 | + | {
|
| 47 | console_print(id, "[GLADIATOR BAN] Just owners can ban over 9000 minutes!") | |
| 48 | return PLUGIN_HANDLED | |
| 49 | - | client_print(target,print_chat, "[Date/Hour] %s",CurrentTime) |
| 49 | + | |
| 50 | - | client_print(target,print_chat, "[Website] Visit %s to be unbanned",banurl) |
| 50 | + | |
| 51 | ||
| 52 | if(str_to_num(arg2) <= 0) | |
| 53 | - | console_print(target,"[Name] %s [STEAMid] %s [IP] %s",name,authid,ipadd) |
| 53 | + | {
|
| 54 | if(get_user_flags(id) & ADMIN_RCON) | |
| 55 | - | console_print(target,"[Date/Hour] %s",CurrentTime) |
| 55 | + | {
|
| 56 | - | console_print(target,"[Website] Visit %s to be unbanned",banurl) |
| 56 | + | console_print(id, "[GLADIATOR BAN] Just owners can ban permanently!") |
| 57 | return PLUGIN_HANDLED | |
| 58 | } | |
| 59 | } | |
| 60 | - | temp[0] = target |
| 60 | + | |
| 61 | - | temp[1] = str_to_num(arg2) |
| 61 | + | |
| 62 | get_cvar_string("hostname",hostname,63)
| |
| 63 | - | set_task(0.5,"persontoban", target, temp, 2) |
| 63 | + | |
| 64 | get_user_authid(target,authid,31) | |
| 65 | get_cvar_string("amx_banurl", banurl,63)
| |
| 66 | get_user_name(id, admin_name, 31) | |
| 67 | ||
| 68 | - | public persontoban(arg[]){
|
| 68 | + | ColorChat(target, NORMAL, "^3[Server] ^1%s", hostname) |
| 69 | - | new name2[32] |
| 69 | + | ColorChat(target, NORMAL, "^3[Nick] ^1%s ^3[SteamID] ^1%s ^3[IP] ^1%s", name, authid, ipadd) |
| 70 | ColorChat(target, NORMAL, "^3[Admin] ^1%s ^3[Reason] ^1%s", admin_name, reason) | |
| 71 | - | new target = arg[0] |
| 71 | + | |
| 72 | - | new bantime = arg[1] |
| 72 | + | |
| 73 | ||
| 74 | - | get_user_name(target,name2,31) |
| 74 | + | ColorChat(target, NORMAL, "^3[Time] ^1%s ^3[Ban Length] ^1%s", CurrentTime, arg2) |
| 75 | ColorChat(target, NORMAL, "^3[Forum] ^4%s", banurl) | |
| 76 | - | switch (get_pcvar_num(Bantype)){
|
| 76 | + | |
| 77 | - | case 1:{
|
| 77 | + | |
| 78 | - | server_cmd("amx_ban %s %d",name2,bantime)
|
| 78 | + | console_print(target,"[Nick] %s [SteamID] %s [IP] %s",name,authid,ipadd) |
| 79 | console_print(target,"[Admin] %s [Reason] %s",admin_name,reason) | |
| 80 | - | case 2:{
|
| 80 | + | console_print(target,"[Time] %s [Ban Length] %s",CurrentTime, arg2) |
| 81 | - | server_cmd("amx_banip %s %d",name2,bantime)
|
| 81 | + | console_print(target,"[Forum] For unban, visit %s",banurl) |
| 82 | ||
| 83 | - | case 3:{
|
| 83 | + | new main_text[100] |
| 84 | - | server_cmd("amx_ban %d %s",bantime,name2)
|
| 84 | + | formatex(main_text, 99, "%s | IP: %s | STEAMid: %s | ADMIN: %s | REASON: %s^n",name,ipadd,authid,admin_name,reason) |
| 85 | ||
| 86 | - | case 4:{
|
| 86 | + | log_to_file(file,main_text) |
| 87 | - | server_cmd("amx_say Visit %s",banurl)
|
| 87 | + | |
| 88 | client_cmd(target,"wait;wait;snapshot;wait;snapshot") | |
| 89 | ||
| 90 | if(equali(authid, "VALVE")) | |
| 91 | {
| |
| 92 | server_cmd("amx_banip ^"%s^" %d", name,arg2)
| |
| 93 | return PLUGIN_HANDLED | |
| 94 | } | |
| 95 | server_cmd("amx_ban ^"%s^" %d ^"%s^"", name,arg2,reason)
| |
| 96 | return PLUGIN_HANDLED | |
| 97 | } |