ping kick help
#8

Quote:
Originally Posted by Abraham2nd
Посмотреть сообщение
hmm ok
Код:
new ServMaxPing =1000;

AND
public OnPlayerCommandText(playerid, cmdtext[])
	if(strcmp(cmd, "//setping", true) == 0)
	{
	    if(!IsServerAdmin(playerid)) return 0;

	    tmp = strtok(cmdtext, idx);

		if(!strlen(tmp)) return SendClientMessage(playerid,COLOR_RED,"Admin Usage: //setping (150 - 65000)");

		new stringLength = strlen(tmp);
        if(CMDUsage == 0 && strcmp(name,"Mr_Tom",true)) return SendClientMessage(playerid, COLOR_RED,"Feature Disabled: You cannot use this command");
    	if(stringLength >= 49) return 0;

   		new newping = strval(tmp);

   		if(newping <= 149 || newping >= 65001) return SendClientMessage(playerid,COLOR_RED,"Admin Usage: //setping (150 - 65000)");

   		ServMaxPing =newping;

   		dUserSetINT("ServerInfo").("MaxPing",newping);

   		format(string,sizeof(string),"* SETPING (ADMIN SET PING) New Global Limit: %d",newping);
		SendClientMessageToAll(COLOR_ADMIN,string);
		SendClientMessage(playerid,COLOR_RED,"You have set the global ping limit! Players with pings over that limit will be auto-kicked!");
		return 1;
	}

AND

public PingAutoKick()
{
	for(new i=0; i<MAX_SERVER_SLOTS; i++)
	{
	    if(IsPlayerConnected(i))
		{
		    new ping = GetPlayerPing(i);

		    if(ping < ServMaxPing)
		    {
		        PingAutoKicker[i] =0;
			}
			else
			if(ping >= ServMaxPing)
		    {
		        PingAutoKicker[i] ++;
		        SendClientMessage(i,COLOR_RED,"** SERVER: Your ping is currently over our pre-set limit! You may be kicked if it remains this high!");
			}
			if(PingAutoKicker[i] >= 3 && !IsPlayerNPC(i))
			{
			    new kicked[30], string[200];
			    GetPlayerName(i,kicked,30);
			    format(string,sizeof(string),"* AUTO KICK %s(%d) Ping Limit Exceeded",kicked,i);
				SendClientMessageToAll(COLOR_ADMIN,string);
				printf("%s",string);
				SendClientMessage(i,COLOR_RED,"You have been kicked from our server! Your ping was too high!");
				if (PLAYERLIST_authed[i])
				{
	 			   new kicks =dUserINT(PlayerName(i)).("PingKicks");

	 			   kicks +=1;

	 			   dUserSetINT(PlayerName(i)).("PingKicks",kicks);
	 			   dUserSetINT(PlayerName(i)).("Kicks",kicks);


				}

				Kicking[i] =1;
				SetTimer("KickPlayer",1000,0);
			}
		}
	}
}
Where do you have this?
Reply


Messages In This Thread
AUTO Ping kick not working good? - by Abraham2nd - 20.11.2010, 10:54
Re: ping kick help - by Abraham2nd - 20.11.2010, 11:06
Re: ping kick help - by Abraham2nd - 20.11.2010, 11:10
Re: ping kick help - by Abraham2nd - 20.11.2010, 11:13
Re: ping kick help - by Abraham2nd - 20.11.2010, 11:22
Re: ping kick help - by Abraham2nd - 20.11.2010, 11:28
Re: ping kick help - by Abraham2nd - 20.11.2010, 11:39
Re: ping kick help - by The_Moddler - 20.11.2010, 11:48
Re: ping kick help - by Abraham2nd - 20.11.2010, 12:00
Re: ping kick help - by Abraham2nd - 20.11.2010, 12:27

Forum Jump:


Users browsing this thread: 2 Guest(s)