Server keep crashing
#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


Messages In This Thread
Server keep crashing - by Ha$H_Sexyboy - 22.12.2015, 11:17
Re: Server keep crashing - by Ha$H_Sexyboy - 22.12.2015, 14:22
Re: Server keep crashing - by MD5 - 22.12.2015, 15:05
Re: Server keep crashing - by Ha$H_Sexyboy - 22.12.2015, 21:45
Re: Server keep crashing - by Ha$H_Sexyboy - 23.12.2015, 09:58
Re: Server keep crashing - by cm666 - 23.12.2015, 10:27
Re: Server keep crashing - by Ha$H_Sexyboy - 23.12.2015, 11:34
Re: Server keep crashing - by cm666 - 23.12.2015, 11:39
Re: Server keep crashing - by Ha$H_Sexyboy - 23.12.2015, 17:23

Forum Jump:


Users browsing this thread: 3 Guest(s)