Temp Ban! rep+
#1

Hai, Im looking for Temp ban system like /ban [playerid] [days] [reason] Im using script with mysql
Reply
#2

Check this out.

https://sampforum.blast.hk/showthread.php?pid=1205522#pid1205522

Hope helps.
Reply
#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


Forum Jump:


Users browsing this thread: 1 Guest(s)