server crash when /ban
#1

hey guys
i have problem when i type /ban id hour minute reason, the server crash
im using this FilterScript: https://sampforum.blast.hk/showthread.php?tid=503631
and i created Bans ,IP folders in ScriptFile
please can someone tell me what wrong ?
Reply
#2

You should ask him in his thread or leave him a PM/VM.
Reply
#3

It's easy to script command /ban, Why you need a filterscript for it? I script a little /ban command to you, Try this

Код:
CMD:ban(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= 2)//This is for admin level
	{
		new string[128], giveplayerid, reason[64];
		if(sscanf(params, "us[64]", giveplayerid, reason)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /ban [playerid/partofname] [reason]");

		if(IsPlayerConnected(giveplayerid))
		{
			if(PlayerInfo[giveplayerid][pAdmin] > PlayerInfo[playerid][pAdmin])
			{
				if(AdminDuty[playerid] == 1)
				{
					new username[MAX_PLAYER_NAME];
					GetPVarString(playerid, "TempNameName", username, sizeof(username));
					SetPVarInt(playerid, "TempName", 0);
					SetPlayerName(playerid, username);
				}
				format(string, sizeof(string), "AdmCmd: %s has been auto-banned, reason: Trying to /ban a higher admin.", PlayerInfo[playerid][pAdminName]);
				ABroadCast(COLOR_YELLOW,string,1);
				PlayerInfo[playerid][pBanned] = 1;
				new ip[32];
				GetPlayerIp(playerid,ip,sizeof(ip));
				AddBan(ip);
				Kick(giveplayerid);
				return 1;
			}
			else
			{
				new playerip[32];
				GetPlayerIp(giveplayerid, playerip, sizeof(playerip));

				if(AdminDuty[giveplayerid] == 1)
				{
					new username[MAX_PLAYER_NAME];
					GetPVarString(giveplayerid, "TempNameName", username, sizeof(username));
					SetPVarInt(giveplayerid, "TempName", 0);
					SetPlayerName(giveplayerid, username);

					format(string, sizeof(string), "AdmCmd: %s(IP:%s) was banned by %s, reason: %s", PlayerInfo[giveplayerid][pAdminName], playerip, GetPlayerNameEx(playerid), reason);
					Log("logs/ban.log", string);
					format(string, sizeof(string), "AdmCmd: %s was banned by %s, reason: %s", PlayerInfo[giveplayerid][pAdminName], GetPlayerNameEx(playerid), reason);
				}
				else
				{
					format(string, sizeof(string), "AdmCmd: %s(IP:%s) was banned by %s, reason: %s", GetPlayerNameEx(giveplayerid), playerip, GetPlayerNameEx(playerid), reason);
					Log("logs/ban.log", string);
					format(string, sizeof(string), "AdmCmd: %s was banned by %s, reason: %s", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason);
				}


				SendClientMessageToAllEx(COLOR_LIGHTRED, string);
				PlayerInfo[giveplayerid][pBanned] = 1;
				new ip[32];
				GetPlayerIp(giveplayerid,ip,sizeof(ip));
				AddBan(ip);
				Kick(giveplayerid);
				return 1;
			}

		} else SendClientMessage(playerid, COLOR_GRAD1, "Invalid player specified.");
	}
	return 1;
}
Please reply if something wrong.
Reply
#4

Quote:
Originally Posted by LarryTiger
Посмотреть сообщение
It's easy to script command /ban, Why you need a filterscript for it? I script a little /ban command to you, Try this

Код:
CMD:ban(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= 2)//This is for admin level
	{
		new string[128], giveplayerid, reason[64];
		if(sscanf(params, "us[64]", giveplayerid, reason)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /ban [playerid/partofname] [reason]");

		if(IsPlayerConnected(giveplayerid))
		{
			if(PlayerInfo[giveplayerid][pAdmin] > PlayerInfo[playerid][pAdmin])
			{
				if(AdminDuty[playerid] == 1)
				{
					new username[MAX_PLAYER_NAME];
					GetPVarString(playerid, "TempNameName", username, sizeof(username));
					SetPVarInt(playerid, "TempName", 0);
					SetPlayerName(playerid, username);
				}
				format(string, sizeof(string), "AdmCmd: %s has been auto-banned, reason: Trying to /ban a higher admin.", PlayerInfo[playerid][pAdminName]);
				ABroadCast(COLOR_YELLOW,string,1);
				PlayerInfo[playerid][pBanned] = 1;
				new ip[32];
				GetPlayerIp(playerid,ip,sizeof(ip));
				AddBan(ip);
				Kick(giveplayerid);
				return 1;
			}
			else
			{
				new playerip[32];
				GetPlayerIp(giveplayerid, playerip, sizeof(playerip));

				if(AdminDuty[giveplayerid] == 1)
				{
					new username[MAX_PLAYER_NAME];
					GetPVarString(giveplayerid, "TempNameName", username, sizeof(username));
					SetPVarInt(giveplayerid, "TempName", 0);
					SetPlayerName(giveplayerid, username);

					format(string, sizeof(string), "AdmCmd: %s(IP:%s) was banned by %s, reason: %s", PlayerInfo[giveplayerid][pAdminName], playerip, GetPlayerNameEx(playerid), reason);
					Log("logs/ban.log", string);
					format(string, sizeof(string), "AdmCmd: %s was banned by %s, reason: %s", PlayerInfo[giveplayerid][pAdminName], GetPlayerNameEx(playerid), reason);
				}
				else
				{
					format(string, sizeof(string), "AdmCmd: %s(IP:%s) was banned by %s, reason: %s", GetPlayerNameEx(giveplayerid), playerip, GetPlayerNameEx(playerid), reason);
					Log("logs/ban.log", string);
					format(string, sizeof(string), "AdmCmd: %s was banned by %s, reason: %s", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason);
				}


				SendClientMessageToAllEx(COLOR_LIGHTRED, string);
				PlayerInfo[giveplayerid][pBanned] = 1;
				new ip[32];
				GetPlayerIp(giveplayerid,ip,sizeof(ip));
				AddBan(ip);
				Kick(giveplayerid);
				return 1;
			}

		} else SendClientMessage(playerid, COLOR_GRAD1, "Invalid player specified.");
	}
	return 1;
}
Please reply if something wrong.
no is ban command with temp
Reply
#5

Download this plug-in, - and put it in your server.cfg, and then execute the ban command. If the server does crash, - a log with some information should show up in the server_log file. If so, post it here.
Reply
#6

Код:
[21:20:12] [debug] #4 00004270 in public OnPlayerCommandText (0x00000000, 0x00061d14) from TempBanSystem.amx
[21:20:12] [debug] #3 native CallLocalFunction () from samp03svr
[21:20:12] [debug] #2 00000036 in public cmd_ban () from TempBanSystem.amx
[21:20:12] [debug] #1 00002410 in ?? (0x00000032, 0x00000000, 0x54270dec, 0x00000000, 0x54270dec, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, ... <2 arguments>) from TempBanSystem.amx
[21:20:12] [debug] #0 00000036 in ?? (0x00000032, 0x00000000, 0x00064eb8) from TempBanSystem.amx
[21:20:12] [debug] AMX backtrace:
[21:20:12] [debug] Server crashed while executing TempBanSystem.amx
any one know what problem ?
Reply
#7

Bump.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)