Temp Ban Command Mysql [+REP]
#8

Quote:
Originally Posted by Mencent
Посмотреть сообщение
PHP код:
stock TBanPlayer(targetid,playerid,reason[],admin[],time)
{
    new 
playerIP,Hour,Minute,Second,Year,Month,Day,timeBanned[80],bannedstring[256],Query[256];
    
GetPlayerIp(playerid,playerIP,sizeof playerIP);
    
gettime(Hour,Minute,Second);
    
getdate(Year,Month,Day);
    
format(timeBanned,sizeof timeBanned,"%02d:%02d:%02d on %02d/%02d/%d",Hour,Minute,Second,Day,Month,Year);
    
mysql_format(mysql,Query,sizeof Query,"INSERT INTO `tbanlog` (`Name`,`pBannedReason`,`pBannedBy`,`pTime`,`pIPBanned`,`pAccountLock`,`pTBanEnd`) VALUES ('%s','%s','%s','%s','%s',1,'%i')",
    
PlayerName(targetid),reason,PlayerName(playerid),timeBanned,playerIP,gettime() + (time*60));
    
mysql_tquery(mysql,Query);
    
format(bannedstring,sizeof bannedstring,"You are currently banned from this server.\r\nUser: %s \r\nIP: %s  \r\nTime: %s \r\nAdmin: %s\r\nReason: %s\r\nTBan End: in %i minutes",
    
PlayerName(targetid),playerIP,timeBanned,PlayerName(playerid),reason,time);
    
ShowPlayerDialog(playerid,DIALOG_BANNED,DIALOG_STYLE_MSGBOX,"You have been banned!",bannedstring,"Leave","");
    return 
Kick(playerid);

Like this: (%i)

Mencent
I used this!
But when i ban myself ro 1 min it ban mee 20 min
Reply


Messages In This Thread
Temp Ban Command Mysql [+REP] - by arlindi - 25.04.2015, 09:15
Re: Temp Ban Command Mysql [+REP] - by Jimmy0wns - 25.04.2015, 09:17
Re: Temp Ban Command Mysql [+REP] - by Sledgehammer - 25.04.2015, 09:17
Re: Temp Ban Command Mysql [+REP] - by arlindi - 25.04.2015, 09:23
Re: Temp Ban Command Mysql [+REP] - by Mencent - 25.04.2015, 09:33
Re: Temp Ban Command Mysql [+REP] - by arlindi - 25.04.2015, 09:45
Re: Temp Ban Command Mysql [+REP] - by Mencent - 25.04.2015, 09:48
Re: Temp Ban Command Mysql [+REP] - by arlindi - 25.04.2015, 09:56
Re: Temp Ban Command Mysql [+REP] - by Mencent - 25.04.2015, 10:23
Re: Temp Ban Command Mysql [+REP] - by arlindi - 25.04.2015, 12:36

Forum Jump:


Users browsing this thread: 1 Guest(s)