SA-MP Forums Archive
Akcslimit bug - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Akcslimit bug (/showthread.php?tid=556035)



Akcslimit bug - CloW - 09.01.2015

Код:
Warning: client exceeded 'ackslimit' 5.43.68.93:52706 (9840) Limit: 8000/sec
How to fix this?


Re: Akcslimit bug - PowerPC603 - 09.01.2015

Do you have alot of code in OnPlayerUpdate, especially loops?

This is the result of too many messages per second between server and client.

A good example could be having "Kill(playerid)" inside OnPlayerDeath.
This one was posted a few weeks ago on the forum.

Killing a player called OnPlayerDeath, which killed the player again, calling OnPlayerDeath again.
A never-ending loop, which communicates alot between server and client.

The default max-limit is set to 3000 and using normal and good written code should never even come close to that.
You have 9840 messages sent between server and client every second.
Search for big loops, fast timers and such things to spot the problem.


Re: Akcslimit bug - CloW - 09.01.2015

Код:
public OnPlayerUpdate(playerid)
{
	if(!IsPlayerConnected(playerid)) return 0;

	if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
	{
		for(new i = 1; i < sizeof(SpikeInfo); i++)
		{
			if(IsPlayerInRangeOfPoint(playerid, 3.0, SpikeInfo[i][sgX], SpikeInfo[i][sgY], SpikeInfo[i][sgZ]))
			{
				if(SpikeInfo[i][sgCreated] == 1)
				{
					new panels, tires;
					new carid = GetPlayerVehicleID(playerid);
					GetVehicleDamageStatus(carid, panels, doors, lights, tires);
					tires = encode_tires(1, 1, 1, 1);
					UpdateVehicleDamageStatus(carid, panels, doors, lights, tires);
					return 0;
				}
			}
		}
	}

	return 1;
}
This is my OnPlayerUpdate.


Re: Akcslimit bug - CloW - 10.01.2015

BUMP!


Re: Akcslimit bug - bigboy81 - 10.01.2015

put this on the end line in server.cfg

ackslimit 100000
messageholelimit 100000
messageslimit 100000
playertimeout 100000


Re: Akcslimit bug - CloW - 10.01.2015

I want to fix this,i set ackslimit on 40000 then block players because acks is bigger than ackslimit.
How to fix this?


Re: Akcslimit bug - ball - 10.01.2015

Код:
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
	{
		for(new i = 1; i < sizeof(SpikeInfo); i++)
		{
			if(IsPlayerInRangeOfPoint(playerid, 3.0, SpikeInfo[i][sgX], SpikeInfo[i][sgY], SpikeInfo[i][sgZ]))
			{
				if(SpikeInfo[i][sgCreated] == 1)
				{
					new panels, tires;
					new carid = GetPlayerVehicleID(playerid);
					GetVehicleDamageStatus(carid, panels, doors, lights, tires);
					tires = encode_tires(1, 1, 1, 1);
					UpdateVehicleDamageStatus(carid, panels, doors, lights, tires);
					return 0;
				}
			}
		}
	}
Man, OPU is called very frequently per second (something like timer for 40ms). Move this code to timer for 1000ms.


Re: Akcslimit bug - CloW - 10.01.2015

Thanks man.I think this is fixed,if don't work i will open thread.