29.10.2017, 09:15
Anti - BadBullet (Anti - Cheat)
This code will block players who are trying to flood you in server_log "bullet data"
This code will block players who are trying to flood you in server_log "bullet data"
Code:
const BULLET_SYNC = 206; IPacket:BULLET_SYNC(playerid, BitStream:bs) { new bulletData[PR_BulletSync]; BS_IgnoreBits(bs, 8); BS_ReadBulletSync(bs, bulletData); if (!(-35000.0 <= bulletData[PR_origin][0] <= 35000.0) || !(-35000.0 <= bulletData[PR_origin][1] <= 35000.0) || !(-35000.0 <= bulletData[PR_origin][2] <= 35000.0)) { new string[144],name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); format(string,sizeof(string),"{FF0000}[Anti-BadBulletDataOrigin]: {FFFF00}%s {999999}(ID:%d) {00FF00}auto-kicked {FF0000}[Reason: BadBulletDataOrigin]", name,playerid); SendClientMessageToAll(-1, string); string[0] = EOS; Kick(playerid); return false; } if (!(-35000.0 <= bulletData[PR_hitPos][0] <= 35000.0) || !(-35000.0 <= bulletData[PR_hitPos][1] <= 35000.0) || !(-35000.0 <= bulletData[PR_hitPos][2] <= 35000.0)) { new string[144],name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); format(string,sizeof(string),"{FF0000}[Anti-BadBulletDataHitPos]: {FFFF00}%s {999999}(ID:%d) {00FF00}auto-kicked {FF0000}[Reason: BadBulletDataHitPos]", name,playerid); SendClientMessageToAll(-1, string); string[0] = EOS; Kick(playerid); return false; } return true; }