Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #define LoopPlayers(%0,%1) for(new %0 = 0; %0 < %1;++ %0) if(IsPlayerConnected(%0) && !IsPlayerNPC(%0))
- #define VERMELHO 0xC9170EFF //0xFF0000AA
- #define NOME_BOT "[BOT]DKN" //- Nome do Bot que Cuida dos Server -//
- #define SLOTS 50
- #define AntiSyncrobugAmount 20
- #define Distancecheck 200
- #define Minimumhealth 0
- #define Defaulthpchecks 10
- #define DefaultQuickturnChecks 5
- #define DefaultVehicleNosHackChecks 3
- #define DefaultAnimationHackChecks 10
- #define DefaultCheckpointHack 4
- #define CreateLog 1
- new
- TimerValue[ 0 ] = 5000,
- Weaponshot[ SLOTS ],
- Ammunationcheck[ SLOTS ],
- x_sobcheck[13][2],
- x_gun[ SLOTS ],
- x_ammo[ SLOTS ],
- Float: Portcheck[ SLOTS ],
- Float: cur_x, Float: cur_y, Float: cur_z,
- s0beit_name[ MAX_PLAYER_NAME ],
- Float: x_health,
- Healthhackcheck[ SLOTS ],
- Float: x_oldangle,
- x_Quickturn[ SLOTS ],
- x_Animationhack[ SLOTS ],
- x_VehicleNosHack[ SLOTS ],
- bool: x_Animationcheck[ SLOTS ],
- bool: x_VehicleMod[ SLOTS ],
- x_AntiPortCheckpoint[ SLOTS ],
- Ammucheck[ SLOTS ];
- forward Anticheat();
- forward OnAntiCheatInit();
- forward OnAntiCheatPlayerKeyStateChange(playerid, newkeys, oldkeys);
- forward CheckPositions();
- forward OnAntiCheatPlayerDisconnect(playerid);
- forward OnAntiCheatPlayerConnect(playerid);
- forward OnAntiCheatVehicleMod(playerid,vehicleid,componentid);
- forward OnAntiCheatEnterCheckpoint(playerid);
- forward AntiCheatLog(string[]);
- forward OnAntiCheatPlayerText(playerid, text[]);
- public OnFilterScriptInit()
- {
- SetTimer("Anticheat", TimerValue[ 0 ], true);
- SetTimer("CheckPositions", TimerValue[ 0 ]*5, true);
- return 1;
- }
- stock SetPlayerSavePos(playerid, Float: sob_x, Float: sob_y, Float: sob_z)
- {
- GetPlayerPos(playerid, cur_x, cur_y, cur_x);
- new Float:oldpos_all = floatadd(cur_x, cur_y, cur_x);
- SetPlayerPos(playerid, sob_x, sob_y, sob_z);
- new Float:newpos_all = floatadd(sob_x, sob_y, sob_z);
- new Float:difference_newposoldpos = floatsub(oldpos_all, newpos_all);
- Portcheck[ playerid ] = difference_newposoldpos;
- return 1;
- }
- stock SetPlayerSaveSpecialAction(playerid, actionid)
- {
- x_Animationcheck[ playerid ] = true;
- SetPlayerSpecialAction(playerid, actionid);
- return 1;
- }
- public OnAntiCheatEnterCheckpoint(playerid)
- {
- if(x_AntiPortCheckpoint[ playerid ] >= DefaultCheckpointHack) { SendClientMessage(playerid, 0xB4B5B7FF, " U have been kicked cause of an s0beit Checkpoint Cheat"); Kick(playerid);}
- x_AntiPortCheckpoint[ playerid ]++;
- return 1;
- }
- public CheckPositions()
- {
- LoopPlayers(x_anti,SLOTS)
- {
- GetPlayerPos(x_anti, cur_x, cur_y, cur_z);
- GetPlayerHealth(x_anti, x_health);
- new x_veh = GetPlayerVehicleID(x_anti);
- GetVehicleZAngle(x_veh, x_oldangle);
- x_AntiPortCheckpoint[ x_anti ]--;
- if(GetPlayerSpecialAction(x_anti) == SPECIAL_ACTION_NONE) { x_Animationcheck[ x_anti ] = false; }
- }
- return 1;
- }
- public OnPlayerDisconnect(playerid)
- {
- GetPlayerName(playerid, s0beit_name, sizeof(s0beit_name));
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- new
- quickconnect_name[ MAX_PLAYER_NAME ],
- string[ MAX_PLAYER_NAME ];
- GetPlayerName(playerid, quickconnect_name, sizeof(quickconnect_name));
- if(format(string, sizeof(string), "%s", s0beit_name) == format(string, sizeof(string),"%s", quickconnect_name))
- {
- SendClientMessage(playerid, 0xB4B5B7FF, "VocΓͺ foi Kickado por Suspeita de Bot");
- Kick(playerid);
- }
- return 1;
- }
- public OnAntiCheatVehicleMod(playerid,vehicleid,componentid)
- {
- if(componentid == 1008 || componentid == 1009 || componentid == 1010 )
- {
- if(x_VehicleMod[ playerid ] == false && x_VehicleNosHack[ playerid ] < DefaultVehicleNosHackChecks) { x_VehicleNosHack[ playerid ]++; }
- else if(x_VehicleMod[ playerid ] == false && x_VehicleNosHack[ playerid ] >= DefaultVehicleNosHackChecks) { KickEx(playerid,"Nitro Hack",NOME_BOT); }
- }
- return 1;
- }
- public Anticheat()
- {
- LoopPlayers(x_anti,SLOTS)
- {
- new Float: x_newangle, Float: CurrentPos_X, Float: CurrentPos_Y, Float: CurrentPos_Z, Float: CurrentPos_Angle, Float: AllPos_Angle[ SLOTS ], Float: x_statichealth;
- GetPlayerPos(x_anti, CurrentPos_X, CurrentPos_Y, CurrentPos_Z);
- GetPlayerWeaponData(x_anti, 0, x_sobcheck[0][0], x_sobcheck[0][1]);
- x_sobcheck[0][1] = Ammucheck[ x_anti ];
- Ammucheck[ x_anti ] = GetPlayerAmmo(x_anti);
- GetPlayerFacingAngle(x_anti, AllPos_Angle[ x_anti ]);
- GetPlayerHealth(x_anti, x_statichealth);
- if(GetPlayerSpecialAction(x_anti) == SPECIAL_ACTION_DANCE1 || GetPlayerSpecialAction(x_anti) == SPECIAL_ACTION_DANCE2 || GetPlayerSpecialAction(x_anti) == SPECIAL_ACTION_DANCE3 || GetPlayerSpecialAction(x_anti) == SPECIAL_ACTION_DANCE4) { if(x_Animationcheck[ x_anti ] == false) { x_Animationhack[ x_anti ]++; } }
- if(x_Animationhack[ x_anti ] >= DefaultAnimationHackChecks) { KickEx(x_anti,"Dance Hack",NOME_BOT); }
- if(x_newangle != x_oldangle && x_newangle-x_oldangle > 135 || x_newangle-x_oldangle < 135 && x_Quickturn[ x_anti ] < DefaultQuickturnChecks) { x_Quickturn[ x_anti ]++;}
- if(Minimumhealth > x_health-x_statichealth && Healthhackcheck[ x_anti ] < Defaulthpchecks) { Healthhackcheck[ x_anti ]++; }
- else if(Healthhackcheck[ x_anti ] > Defaulthpchecks) { KickEx(x_anti,"Health Hack",NOME_BOT); }
- if(GetPlayerState(x_anti) == 1) { if(Portcheck[ x_anti ] > 30 || Portcheck[ x_anti ] < -30) { KickEx(x_anti,"Air Break",NOME_BOT); } }
- if(GetPlayerFacingAngle(x_anti, CurrentPos_Angle) == AllPos_Angle[ x_anti]) { KickEx(x_anti,"Aim Hack",NOME_BOT); }
- if(Portcheck[ x_anti ] < 100 || Portcheck[ x_anti ] > -100)
- {
- if(CurrentPos_X - cur_x > Distancecheck || CurrentPos_X - cur_x < Distancecheck) { }
- else { Portcheck[ x_anti ] += CurrentPos_X - cur_x; }
- }
- else if(Portcheck[ x_anti ] > 100 || Portcheck[ x_anti ] < -100) { KickEx(x_anti,"Teleport",NOME_BOT); }
- if(Weaponshot[ x_anti ] > 5)
- {
- if(Ammucheck[ x_anti ] < Ammucheck[ x_anti ] - AntiSyncrobugAmount) {KickEx(x_anti,"Weapown Hack",NOME_BOT); }
- }
- else
- {
- Weaponshot[ x_anti ] = 0;
- }
- }
- return 1;
- }
- public OnAntiCheatPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- x_gun[ playerid ] = GetPlayerWeapon(playerid);
- x_ammo[ playerid ] = GetPlayerAmmo(playerid);
- if(newkeys == KEY_FIRE && x_gun[ playerid ] > 15 && x_gun[ playerid ] < 44 && x_ammo[ playerid ] == Ammucheck[ playerid ])
- {
- GetPlayerWeaponData(playerid, 0, x_sobcheck[0][0], x_sobcheck[0][1]);
- x_sobcheck[0][1] = Ammucheck[ playerid ];
- Ammucheck[ playerid ]--;
- Ammunationcheck[ playerid ] = x_sobcheck[0][1];
- }
- else if(x_ammo[ playerid ] != Ammucheck[ playerid ])
- {
- Weaponshot[ playerid ]++;
- x_ammo[ playerid ] = Ammucheck[ playerid ];
- }
- return 1;
- }
- stock KickEx(playerid,motivo[],kickou[])
- {
- new name[24],string[128],salvar[128],plrIP[16];
- GetPlayerName(playerid, name,24);
- GetPlayerIp(playerid, plrIP, sizeof(plrIP));
- format(string, sizeof(string), "[FeK]: O player %s(%d) foi Kickado pelo Administrador %s | Motivo: %s",name,playerid,kickou,motivo);
- SendClientMessageToAll(VERMELHO, string);
- PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
- Kick(playerid);
- format(salvar, sizeof(salvar), "Player %s | Admin: %s |Motivo: %s |IP: %s \r\n",name,kickou,motivo,plrIP);
- new File:KicksLogs = fopen("LogKicks.ini",io_append);
- fwrite(KicksLogs,salvar);
- fclose(KicksLogs);
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement