Server crashed ONPLAYERTEXT (+rep)
#4

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
pawn Код:
assert(AntiFlood_Check(playerid));
This function aborts the execution if AntiFlood_Checkreturns 0. I don't even know why you use it in the first place, it's only meant for testing functions so you can be sure everything works properly with them.

Since crashdetect fails to report (assuming you already have the latest version, if not; update), debug it manually - more print lines.
This is AntiFlood_Check:
Код HTML:
AntiFlood_Check( playerid, bool:inc=true )
{
	AntiFlood_Data[playerid][floodRate] += inc ? RATE_INC : 0;
	AntiFlood_Data[playerid][floodRate] = AntiFlood_Data[playerid][floodRate] - ( GetTickCount() - AntiFlood_Data[playerid][lastCheck] );
	AntiFlood_Data[playerid][lastCheck] = GetTickCount();
	AntiFlood_Data[playerid][floodRate] = AntiFlood_Data[playerid][floodRate] < 0 ? 0 : AntiFlood_Data[playerid][floodRate];

	if ( AntiFlood_Data[playerid][floodRate] >= RATE_MAX )
	{
		#if THRESOLD_ACTION == 1
			SendClientMessage(playerid,COLOR_LIGHTRED,"Kick: You got kicked because you did spam.");
			Kick(playerid);
		#elseif THRESOLD_ACTION == 2
			SendClientMessage(playerid,COLOR_LIGHTRED,"Kick: You got kicked because you did spam.");
			Kick(playerid);
		#else
			SendClientMessage(playerid, COLOR_LIGHTRED, "Please stop spam." );
		#endif

		return false;
	}

	return true;
}
So, do I have to remove assert(AntiFlood_Check(playerid)); ?

Thanks
Reply


Messages In This Thread
Server crashed ONPLAYERTEXT (+rep) - by Nin9r - 04.07.2017, 17:39
Re: Server crashed ONPLAYERTEXT (+rep) - by Nin9r - 05.07.2017, 08:29
Re: Server crashed ONPLAYERTEXT (+rep) - by Konstantinos - 05.07.2017, 08:36
Re: Server crashed ONPLAYERTEXT (+rep) - by Nin9r - 05.07.2017, 13:47

Forum Jump:


Users browsing this thread: 1 Guest(s)