Server keep crashing
#1

Hello

I don't have to say a lot the title is pretty much explaining everything,only clue i got is this :




Код:
[12:01:56] [debug] Server crashed while executing ****.amx
[12:01:56] [debug] AMX backtrace:
[12:01:56] [debug] #0 00000021 in ?? () at <unknown file>:0
[12:01:56] [debug] #1 00000021 in public OnPlayerWeaponShot () at <unknown file>:0
Reply
#2

Bump
Reply
#3

Someone is crashing it via OnPlayerWeaponShot.
Reply
#4

well,any patches?
Reply
#5

bump
Reply
#6

show code OnPlayerWeaponShot
Reply
#7

Quote:
Originally Posted by cm666
Посмотреть сообщение
show code OnPlayerWeaponShot
Код:
public OnPlayerWeaponShot( playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ )
{
	/*
	new Float:lx, Float:ly, Float:lz;
	GetPlayerPos(playerid, lx, ly, lz);

	//Desync weapon IDs that don't fire bullets
	if (weaponid < 22 || weaponid > 38)
		return 0;

	//Desync shots with Z pos out of bounds
	if(!(-20000.0 <= lz <= 20000.0))
    		return 0;
	*/
    if( hittype != BULLET_HIT_TYPE_NONE ) // Bullet Crashing uses just this hittype
	{
        if( !( -1000.0 <= fX <= 1000.0 ) || !( -1000.0 <= fY <= 1000.0 ) || !( -1000.0 <= fZ <= 1000.0 ) ) // a valid offset, it's impossible that a offset bigger than 1000 is legit (also less than -1000.0 is impossible, not used by this hack, but still, let's check for it, just for the future, who knows what hacks will appear). The object with biggest offset is having ~700-800 radius.
		{
			/* If you want, here you can kick the cheater */
			new tmp[128];
			format(tmp, sizeof(tmp), "{%06x}%s "lwhite"has been suspected for Bullet Crasher. "lred"Please check ID: %d", GetPlayerColor(playerid) >>> 8, GetName(playerid), playerid);
			SendGlobalAdminMSG(tmp);
			return 0; // let's desynchronize that bullet, so players won't crash
		}
	}

	//==============================================================================
	//==============================(Anti No-Reload)================================
	//==============================================================================

	if(weaponid == PlayerInfo[playerid][OldWeapon])
	{
	   // SendClientMessage(playerid,-1,"called");
		if(GetPlayerAmmo(playerid) == PlayerInfo[playerid][OldAmmo] && IsAllowedWeapon(weaponid) && weaponid != 29)
		{
		    switch(PlayerInfo[playerid][FAW])
		    {
		        case 6:return 1;
		        case 5:
				{
					new string[128];
					format(string,sizeof(string),"%s has been banned for possible no-reload/rapidfire/frozen ammo", GetName(playerid));
					//SendClientMessageToAll(COLOR_RED, string);

					SendGlobalAdminMSG(string);

		            BanWithReason(playerid, string, SYSTEM_ID, "No-reload/Frozen Ammo");
		            PlayerInfo[playerid][FAW] = 6;
				}
				default:
				{
				    PlayerInfo[playerid][FAW] ++;
				//	SendClientMessage(playerid,COLOR_RED, "warning");
				}
		    }
			return 1;
		}
	}
	PlayerInfo[playerid][FAW] = 0;
	PlayerInfo[playerid][OldWeapon] = weaponid;
	PlayerInfo[playerid][OldAmmo] = GetPlayerAmmo(playerid);
	return 1;
}

forward IsAllowedWeapon(weapon);
public IsAllowedWeapon(weapon)
{
	switch(weapon)
	{
	    case 22..36 :return 1;
	    default: return 0;
	}
	return 1;
}
Reply
#8

show code
BanWithReason
SendGlobalAdminMSG
Reply
#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


Forum Jump:


Users browsing this thread: 3 Guest(s)