Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- forward IRCOTempBan(user[],channel[],Conta[],byear,bmonth,bday,reason[]);
- public IRCOTempBan(user[],channel[],Conta[],byear,bmonth,bday,reason[])
- {
- new rows, fields;
- cache_get_data(rows, fields, mysql);
- new Query[250],saving[3][128],banned1;
- if(!rows){ IRC_GroupSay(GrupoID,channel,"04ERROR: IP Not Exist on Database");}else
- if(rows) {
- cache_get_field_content(0, "name", saving[0], mysql, 128);
- cache_get_field_content(0, "banned", saving[1], mysql, 32);
- cache_get_field_content(0, "ip", saving[2], mysql, 32);
- banned1 = strval(saving[1]);
- if(banned1 == 0){
- new year,month,day,hour,minuite,second; getdate(year, month, day); gettime(hour,minuite,second);
- new tempbandate[4],strdate[128],strtime[128];
- tempbandate[0] = 60 * 60 * 24 * (year+byear);
- tempbandate[1] = 60 * 60 * 24 * 30 * (month+bmonth);
- tempbandate[2] = 60 * 60 * 24 * (day+bday);
- new expiredate1 = tempbandate[0]+tempbandate[1]+tempbandate[2];
- new MsgMandarIRC[200];
- format(MsgMandarIRC,sizeof(MsgMandarIRC),"70|- Account \"%s\" has temporary banned by administrator \"%s\" [Reason: %s] -|",saving[0],user,reason,day,month,year,hour,minuite);
- IRC_GroupSay(GrupoID,IRC_CANAL,MsgMandarIRC);
- IRC_GroupSay(GrupoID,IRC_OPERCANAL,MsgMandarIRC);
- format(strdate, sizeof(strdate), "%d-%d-%d ",year,month,day);
- format(strtime,sizeof(strtime),"%d:%d:%d",hour,minuite,second);
- format(Query, sizeof(Query), "UPDATE `banneds` SET `ip` = '%s', `date` = '%s', `time` = '%s', `bannedby` = '%s', `tempban` = '%d', `reason` = '%s', `bdate` = '%d' WHERE `name` = '%s'",saving[2],strdate,strtime,user,1,reason,expiredate1,saving[0]);
- mysql_tquery(mysql, Query, "", ""); totalbans ++;
- format(Query, sizeof(Query),"INSERT INTO `bannedips`(`ip`) VALUES ('%s')",saving[2]);
- mysql_tquery(mysql, Query, "", "");}}
- return 1;
- }
- IRCCMD:otempban(botid,channel[],user[],host[],params[])
- {
- if(IRC_IsOp(botid, channel, user)){
- new name[MAX_PLAYER_NAME+5],reason[50],byear,bmonth,bday;
- if(sscanf(params,"s[28]ddds[50]",name,byear,bmonth,bday,reason)){
- IRC_GroupSay(GrupoID,channel,"04!tempban [account-name] [years months days] [reason]");
- IRC_GroupSay(GrupoID,channel,"04!Example: !otempban 1 0 0 6 example [ account will be banned for six days ]");
- return 1;}
- new Query[250];
- format(Query, sizeof(Query), "SELECT * FROM banneds WHERE `name` = '%s'", name);
- format(banreason,sizeof banreason,"%s",reason);
- mysql_tquery(mysql, Query, "IRCOTempBan", "sssddds",user,channel,name,byear,bmonth,bday,reason);}else{
- IRC_GroupSay(GrupoID,channel,"04ERROR: You are not a high enough level to use this command");}
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement