4en3rgY Romania
New Style Ban (v1.2) 2z8bv910
Welcome To 4EN3RGY Romania
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. If you already have an account, login here - otherwise create an account for free today!

4en3rgY Romania


Nu sunteti conectat. Conectați-vă sau înregistrați-vă

New Style Ban (v1.2)

Vezi subiectul anterior Vezi subiectul urmator In jos  Mesaj [Pagina 1 din 1]

1New Style Ban (v1.2) Empty New Style Ban (v1.2) Sam 09 Apr 2011, 23:40

Viorel

ViorelFondator

Descriere: cand banezi un jucator mai intai ii apare un motd cu niste informati:
    * Data/Ora : la care a primit ban
    * Motv : de ce a primit ban
    * Timp : pentru cat timp a primit ban
    * Admin : numele adminului care la banat
    * Informati cu site-ul unde sa posteze pentru Unban


Descarcare:
v1.1: Link! | Mirror!
new! v1.2: Link! | Mirror!
Sursa:
[sursa=Click pentru a deschide sursa]#include
#include

#define PLUGIN "NewStyleBan"
#define VERSION "1.2"
#define AUTHOR "P.Of.Pw"
#define ADMIN_ACCESS ADMIN_BAN

new player_ss,logs,ban_show_chat
new minutes[8], reason[64]

new const site[]= "[Trebuie sa fiti inscris si conectat pentru a vedea acest link]
new const msg_motd []= "Ai primit ban!"
new const gwait[] = "wait;wait;wait"
new const command[]= "amx_bann"

public plugin_init() {

register_plugin(PLUGIN, VERSION, AUTHOR)
register_dictionary("admincmd.txt")
register_dictionary("common.txt")
register_concmd(command,"cmdNewBAN",ADMIN_ACCESS," Dai ban")
player_ss = register_cvar("ban_ss","1")
logs = register_cvar("ban_logs","1")
ban_show_chat = register_cvar("ban_chat_show","1")
}

public cmdNewBAN(id, level, cid)
{
if (!cmd_access(id, level, cid, 2))
return PLUGIN_HANDLED
new target[32]

read_argv(1, target, 31)
read_argv(2, minutes, 7)
read_argv(3, reason, 63)

new player = cmd_target(id, target, 9)

if (!player)
return PLUGIN_HANDLED

new authid[32],admin_name[32], name2[32], authid2[32], name[32]
new userid2 = get_user_userid(player)

new motd[1501],len
new sztime[54], Ip[32], hostname[64], szdata[54]

get_user_authid(player, authid2, 31)
get_user_authid(id, authid, 31)
get_user_name(id, admin_name, 31)
get_user_name(player, name2, 31)
get_user_name(id, name, 31)

get_time("%m.%d.%Y",szdata, 53)
get_time("%H:%M:%S",sztime, 53)
get_user_ip(player, Ip, 31, 1)
get_cvar_string("hostname",hostname, 63)

log_amx("Ban: ^"%s<%d><%s><>^" ban and kick ^"%s<%d><%s><>^" (minutes ^"%s^") (reason ^"%s^")", name, get_user_userid(id), authid, name2, userid2, authid2, minutes, reason)

new temp[64], banned[16], nNum = str_to_num(minutes)
if (nNum)
format(temp, 63, "%L", player, "FOR_MIN", minutes)
else
format(temp, 63, "%L", player, "PERM")
format(banned, 15, "%L", player, "BANNED")

/********************************************************************************/
if(get_pcvar_num(player_ss) == 1 )
{
set_hudmessage(0, 255, 0, 0.39, 0.29, 0, 6.0, 10.0)
show_hudmessage(id,"[ New Style Ban ] IP-ul tau: %s",Ip)

client_print(player,print_chat,"** Sa executat comanda ^"%s^" asaupra ta!",command)
client_print(player,print_chat,"** Numele tau: %s, IP-ul tau: %s, Banat de: %s, POSTEZI POZELE PE: %s",name2,Ip,admin_name,site)
client_cmd(player,"spk ^"vox/bizwarn.screen.screen.screen^"")
client_cmd(player,"snapshot;%s;snapshot;%s;snapshot",gwait, gwait)
}
/********************************************************************************/
if(get_pcvar_num(ban_show_chat) == 1 )
{
client_print(0,print_chat,"***ADMIN:%s la banat pe:%s Minute:^"%s^" Motiv:^"%s^"",admin_name,name2,minutes,reason)
}
/********************************************************************************/
if(get_pcvar_num(logs) == 1 )
{
new szFile[128]
get_configsdir(szFile,127)
formatex(szFile,127,"%s/ban_logs.txt",szFile)

if(!file_exists(szFile))
{
write_file(szFile,"Log'S Ban:",-1)
write_file(szFile,"(c) PoSiTiOn Of PoWeR",-1)
write_file(szFile," ",-1)
}
new szLog[256]

formatex(szLog,255,"Admin: %s , la banat pe %s , in Data %s - Ora %s , Motiv: %s , Minute: %s ",admin_name,name2,szdata,sztime,reason,minutes)
write_file(szFile,szLog,-1)
write_file(szFile," ",-1)

}
/********************************************************************************/
len = format(motd, 1500,"
")
len += format(motd[len], 1500-len,"

%s

",hostname)
len += format(motd[len], 1500-len,"DATA: %s - Ora: %s^n",szdata,sztime)
len += format(motd[len], 1500-len,"Motiv: %s^n",reason)
len += format(motd[len], 1500-len,"Ip: %s^n",Ip)
len += format(motd[len], 1500-len,"Timp: %s minute^n",minutes)
len += format(motd[len], 1500-len,"Admin: %s ^n",admin_name)
len += format(motd[len], 1500-len,"*pentru unban: postezi pozele pe %s^n^n",site)
show_motd(player,motd,msg_motd)
/********************************************************************************/
if (reason[0])
set_task(9.0,"cmdban_reason",player)
else
set_task(10.0,"cmdban_no_reason",player)
/********************************************************************************/
new activity = get_cvar_num("amx_show_activity")
if (activity != 0)
{
new players[32], pnum, msg[256], len
get_players(players, pnum, "c")

for (new i = 0; i < pnum; i++)
{
len = format(msg, 255, "%L", players[i], "ADMIN")

if (activity == 1)
len += copy(msg[len], 255-len, ":")
else
len += format(msg[len], 255-len, " %s:", name)

len += format(msg[len], 255-len, " %L", players[i], "BAN")
len += format(msg[len], 255-len, " %s ", name2)

if (nNum)
format(msg[len], 255-len, "%L", players[i], "FOR_MIN", minutes)
else
format(msg[len], 255-len, "%L", players[i], "PERM")

client_print(players[i], print_chat, "%s", msg)
}
}
console_print(id,"[ New Style Ban ] NUME: %s - IP: %s",name2,Ip)
console_print(id,"[ New Style Ban ] NUME: %s - IP: %s",name2,Ip)
console_print(id,"[ New Style Ban ] NUME: %s - IP: %s",name2,Ip)
console_print(id,"[ New Style Ban ] NUME: %s - IP: %s",name2,Ip)
console_print(id,"[ New Style Ban ] NUME: %s - IP: %s",name2,Ip)
console_print(id,"[AMXX] %L", id, "CLIENT_BANNED", name2)

return PLUGIN_HANDLED
}

public cmdban_reason(player)
{
new authid2[32],userid2

userid2 = get_user_userid(player)

get_user_authid(player, authid2, 31)

new address[32],g_Reason[32]

get_user_ip(player, address, 31, 1)

new temp[64], banned[16], nNum

nNum = str_to_num(minutes)

copy(g_Reason, 31, reason)

if (nNum)
format(temp, 63, "%L", player, "FOR_MIN", minutes)
else
format(temp, 63, "%L", player, "PERM")

format(banned, 15, "%L", player, "BANNED")

server_cmd("kick #%d ^"%s (%s %s)^";wait;addip ^"%s^" ^"%s^";wait;writeip", userid2, g_Reason, banned, temp, minutes, address)
}

public cmdban_no_reason(player)
{
new authid2[32], userid2, temp[64], banned[16], nNum

userid2 = get_user_userid(player)

get_user_authid(player, authid2, 31)

new address[32]

get_user_ip(player, address, 31, 1)

nNum = str_to_num(minutes)

if (nNum)
format(temp, 63, "%L", player, "FOR_MIN", minutes)
else
format(temp, 63, "%L", player, "PERM")

format(banned, 15, "%L", player, "BANNED")

server_cmd("kick #%d ^"%s %s^";wait;addip ^"%s^" ^"%s^";wait;writeip", userid2, banned, temp, minutes, address)
}[/sursa]


Nume:New Style Ban
Versiune: 1.1
v1.1- fixare mici erori.
v1.2- imbunatatire plugin

Autor: AlinHD aka PoSiTiOn Of PoWeR
Multumuri:
pentru teste. Wink
anakin_cstrike - pentru sugestile date, etc Wink)

Instalare:
1. Fisierul new_style_ban.sma il puneti in addons/amxmodx/scripting
2. Fisierul new_style_ban.amxx il puneti in addons/amxmodx/plugins
3. Intrati in fisierul addons/amxmodx/configs/plugins.ini si adaugati la urma:
Cod:
new_style_ban.amxx

Cvar-uri (se adauga in fisierul amxmodx\configs\amxx.cfg):
    ban_ss 0/1 - face poze + mesaje in chat / hud = Implicit 1
    ban_logs 0/1 - creaza un fisier "ban_logs.txt" in amxmodx/configs cu toate ban-urile date, etc.
= Implicit 1
ban_chat_show 0/1 - arata un mesaj in chat la toti jucatori ce Admin ia dat ban lui X, minute, motiv, etc.. = Implicit 1

Comenzi administrative (se tasteaza in consola si trebuie sa fiti administrator):
    amx_bann - "nume" "minute" "motiv" dai ban intr-un nou mod


Altele:
    modificati:

static const site[]= "[Trebuie sa fiti inscris si conectat pentru a vedea acest link]"

    cu adresa site-ului vostru.


new const msg_motd []= "Ai primit ban!"
    Reprezinta mesajul care apare in coltul la 'MOTD'


new const command[]= "amx_bann"
    Reprezinta comanda care o folosesti la banare


Imagini:
[Trebuie sa fiti inscris si conectat pentru a vedea acest link]
new! [Trebuie sa fiti inscris si conectat pentru a vedea acest link]
new! [Trebuie sa fiti inscris si conectat pentru a vedea acest link]
new! [Trebuie sa fiti inscris si conectat pentru a vedea acest link]
GL & HF !

Vezi subiectul anterior Vezi subiectul urmator Sus  Mesaj [Pagina 1 din 1]

Permisiunile acestui forum:
Nu puteti raspunde la subiectele acestui forum

 

Copyright @ 2010-2024 by 4en3rgY ~> All rights reserved.