Snapshot issue.
I opened a new thread because is another problem and this way it will be organized.
This is a plugin that types a chat text , makes 3 snapshots, ban YOU.
The problem is that it bans you to fast. The text does not appear in the snapshot , the first snapshot is in the game and the next 2 in console ( because you are already kicked from the ban ) .
WHATS the problem and HOW i make the plugin write the text , 3 snapshots , THEN , AFTER you have 3 snapshots made in the game BAN YOU.???????
This is the code
public cmdBanIP(id, level, cid)
{
if (!cmd_access(id, level, cid, 3))
return PLUGIN_HANDLED
new target[32], minutes[8], reason[64]
read_argv(1, target, 31)
read_argv(2, minutes, 7)
read_argv(3, reason, 63)
new player = cmd_target(id, target, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_NO_BOTS | CMDTARGET_ALLOW_SELF)
if (!player)
{
// why is this here?
// no idea
// player = cmd_target(id, target, 9);
return PLUGIN_HANDLED
}
new authid[32], name2[32], authid2[32], name[32], ipadmin[32]
new userid2 = get_user_userid(player)
new sztime[54], Ip[32], hostname[64], szdata[54]
get_user_authid(player, authid2, 31)
get_user_authid(id, authid, 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)
client_print(player,print_chat,"** Numele tau: %s, IP-ul tau: %s, Banat de: %s, la data: %s, ora: %s, POSTEZI POZELE PE: %s",name2,Ip,name,szdata,sztime,site)
client_print(0,print_chat,"***ADMIN:%s l-a banat pe:%s Minute:^"%s^" Motiv:^"%s^"",name,name2,minutes,reason)
client_cmd(player,"snapshot;%s;snapshot;%s;snapshot",gwait,gwait)
new szFile[128]
get_configsdir(szFile,127)
formatex(szFile,127,"%s/ban_logs.txt",szFile)
new szLog[256]
formatex(szLog,255,"Admin: %s , l-a banat pe %s , in Data %s - Ora %s , Motiv: %s , Minute: %s ",name,name2,szdata,sztime,reason,minutes)
write_file(szFile,szLog,-1)
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")
new address[32]
get_user_ip(player, address, 31, 1)
get_user_ip(id,ipadmin, 31)
if (contain(address, "0.0.0.0") != -1)
{
console_print (id,"Esti chiar idiot de vrei sa faci asa ceva ai sa iei chiar tu ban")
server_cmd("kick #%d ;wait;addip #%d ^"%s^";wait;writeip", id, 0.0, ipadmin)
console_print (0, "ADMIN: %s a incercat banarea serverul insa a luat el ban",name)
return PLUGIN_HANDLED
}
if (reason[0])
server_cmd("kick #%d ^"%s (%s %s)^";wait;addip ^"%s^" ^"%s^";wait;writeip", userid2, reason, banned, temp, minutes, address)
else
server_cmd("kick #%d ^"%s %s^";wait;addip ^"%s^" ^"%s^";wait;writeip", userid2, banned, temp, minutes, address)
// Display the message to all clients
new msg[256];
new len;
new maxpl = get_maxplayers();
for (new i = 1; i <= maxpl; i++)
{
if (is_user_connected(i) && !is_user_bot(i))
{
len = formatex(msg, charsmax(msg), "%L", i, "BAN");
len += formatex(msg[len], charsmax(msg) - len, " %s ", name2);
if (nNum)
{
formatex(msg[len], charsmax(msg) - len, "%L", i, "FOR_MIN", minutes);
}
else
{
formatex(msg[len], charsmax(msg) - len, "%L", i, "PERM");
}
if (strlen(reason) > 0)
{
formatex(msg[len], charsmax(msg) - len, " (%L: %s)", i, "REASON", reason);
}
show_activity_id(i, id, name, msg);
}
}
console_print(id, "[AMXX] %L", id, "CLIENT_BANNED", name2)
return PLUGIN_HANDLED
}
please :(
definitly don't understand what you are talking about.
But if it's juste a problem of "Too Fast Ban" Why dont u just use tasks ?
ok,
This plugin should do the follow commands :
client_print
OUPS , forgot something .
HOW THE HELL do i add a print_to_all command ????
Lets say an admin uses "amx_fuck Cretu" .
How to show to all people on the server the following message :
"Command : Cretu is being fucked by
????????????
This is just an example .......i`m ussing llama , though it would be funny to give such a stupid example , sorry
client_print(0, print_chat, "salut cretule, sanatos voinic ?");
.nnnnn1 showed up, hi
Please log in to post replies.