Server keep crashing
#9

BanWithReason :
Код:
stock BanWithReason(playerid , reason[], admin, cleanreason[]="")
{
	switch(PlayerInfo[playerid][Banned])
	{
		case 0:
		{
			/*
			new INI:File = INI_Open(UserPath(playerid)), year, month, day;

			INI_SetTag(File,"Ban Data");
			INI_WriteInt(File,"Banned",1);
			INI_WriteInt(File,"Banyear",year);
			INI_WriteInt(File,"Banmonth",month);
			INI_WriteInt(File,"Banday",day);
			INI_WriteString(File,"BanAdmin",Baner);
			INI_WriteString(File,"Reason",reason);
			INI_Close(File);*/


			/* MySQL Part */

			new query[215], IPP[26], year, month, day;
			getdate(year,month,day);
			GetPlayerIp(playerid, IPP, sizeof(IPP));

			if(admin != SYSTEM_ID) mysql_format(connection_handle, query, sizeof(query), "UPDATE `"USERSTABLE"` SET Banned=1, BanYear=%d, BanMonth=%d, BanDay=%d, adminid='%d', Reason='%e' WHERE ID='%d'", year, month, day, PlayerInfo[admin][AccountID], cleanreason, PlayerInfo[playerid][AccountID]);
			else mysql_format(connection_handle, query, sizeof(query), "UPDATE `"USERSTABLE"` SET Banned=1, BanYear=%d, BanMonth=%d, BanDay=%d, adminid='%d', Reason='%e' WHERE ID='%d'", year, month, day, SYSTEM_ID, cleanreason, PlayerInfo[playerid][AccountID]);

			mysql_pquery(connection_handle, query, "", "");

			if(admin != SYSTEM_ID) mysql_format(connection_handle, query, sizeof(query), "SELECT User_Name FROM `"BANSTABLE"` WHERE userid='%d' AND Reason='%e' AND adminid='%d' LIMIT 1", PlayerInfo[playerid][AccountID], cleanreason, PlayerInfo[admin][AccountID]);
			else mysql_format(connection_handle, query, sizeof(query), "SELECT User_Name FROM `"BANSTABLE"` WHERE userid='%d' AND Reason='%e' AND adminid='%d' LIMIT 1", PlayerInfo[playerid][AccountID], cleanreason, SYSTEM_ID);

			mysql_pquery(connection_handle, query, "BanResult", "dsds", admin, cleanreason, playerid, IPP);
			/* ------------------ */
			printf("%s has been banned by %s for %s\n", GetName(playerid), GetName(admin),reason);
			SetTimerEx("BanTimer",1000,0,"i",playerid);
			format(PString[playerid],127,"[INGAME BAN]%s",reason);
		}
		case 1:
		{
			KickPlayer(playerid);
		}
	}
	return 1;
}




SendGlobalAdminMessage :










Код:
stock SendGlobalAdminMSG(msg[])
{
	new str[1000];

	format(str, sizeof(str), ""ldgray"|- SERVER -| "lwhite"%s", msg);

	SendMessageToAdmins(-1, str);
	return true;
}
Reply


Messages In This Thread
Server keep crashing - by Ha$H_Sexyboy - 22.12.2015, 11:17
Re: Server keep crashing - by Ha$H_Sexyboy - 22.12.2015, 14:22
Re: Server keep crashing - by MD5 - 22.12.2015, 15:05
Re: Server keep crashing - by Ha$H_Sexyboy - 22.12.2015, 21:45
Re: Server keep crashing - by Ha$H_Sexyboy - 23.12.2015, 09:58
Re: Server keep crashing - by cm666 - 23.12.2015, 10:27
Re: Server keep crashing - by Ha$H_Sexyboy - 23.12.2015, 11:34
Re: Server keep crashing - by cm666 - 23.12.2015, 11:39
Re: Server keep crashing - by Ha$H_Sexyboy - 23.12.2015, 17:23

Forum Jump:


Users browsing this thread: 2 Guest(s)