Temp Ban! rep+
#3

Код:
public BanPlayer(playerid, reason[], bannerid, expiretime) {
	query[0] = 0;//[256];
	new ip[16];
	new bannersqlid;
	new systemban[126] = "SYSTEM";
	new admin[126];
	if(bannerid == -1) {
		admin = systemban;
		bannersqlid = 0;
	} else {
		bannersqlid = GetPVarInt(bannerid, "AccountID");	
		GetPVarString(bannerid, "Accountname", admin, sizeof(admin));		
	}
	GetPlayerIpEx(playerid, ip, sizeof(ip));
	new reason_esc[(128*2)+1];
	mysql_real_escape_string(reason,reason_esc);
	new timestamp[128];
	if(expiretime != 0) {
		format(timestamp, sizeof(timestamp), "DATE_ADD(CURRENT_TIMESTAMP(), INTERVAL %d SECOND)", expiretime);
	} else {
		format(timestamp, sizeof(timestamp), "TIMESTAMP(0)");
	}
	format(query,sizeof(query),"INSERT INTO `bans` (`accountid`,`banned`,`GPCI`,`ip`,`bannerid`,`admin`,`reason`,`expiretime`) VALUES (%d,\"%s\",\"%s\",INET_ATON(\"%s\"),%d,\"%s\",\"%s\",%s)",GetPVarInt(playerid,"AccountID"),GetPlayerNameEx(playerid, ENameType_CharName),GPCI,ip,bannersqlid,admin,reason_esc,timestamp);
	mysql_function_query(g_mysql_handle, query, true, "EmptyCallback", "");
	Kick(playerid);
	return 1;
}
Thats an example of my old tempban
before I majorly updated
Reply


Messages In This Thread
Temp Ban! rep+ - by OscarJohnson - 11.06.2015, 22:11
Re: Temp Ban! rep+ - by Bingo - 11.06.2015, 22:14
Re: Temp Ban! rep+ - by Prokill911 - 12.06.2015, 02:00

Forum Jump:


Users browsing this thread: 1 Guest(s)