Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- +--------------------------+
- | _ |
- | (_) |
- | _ ___ _ __ __ _ |
- | | |/ __| '__/ _` | |
- | | | (__| | | (_| | |
- | |_|\___|_| \__,_| |
- | |
- +--------------------------+
- [!] Automatic Cheats Detector R2.0
- [!] Developed by icra
- [!] Please, keep credits!
- */
- // Stores player positions at spawn so it can be restored after cheat check.
- new
- Float:ACD_pSpawn[MAX_PLAYERS][4],
- ACD_pInterior[MAX_PLAYERS];
- // Main configuration, type "true" or "false" to enable/disable something.
- new
- bool:ACD_Toggled = true; // Enable or disables the cheat check. Console / RCON (in game) command: togacd
- public OnPlayerSpawn(playerid) {
- if(ACD_Toggled) {
- SetCameraBehindPlayer(playerid); // Stops possible camera moving
- TogglePlayerControllable(playerid, false); // Freezes the player
- GetPlayerPos(playerid, ACD_pSpawn[playerid][0], ACD_pSpawn[playerid][1], ACD_pSpawn[playerid][2]); // Stores current player position
- GetPlayerFacingAngle(playerid, ACD_pSpawn[playerid][3]); // Stores current player facing angle
- ACD_pInterior[playerid] = GetPlayerInterior(playerid); // Stores current player interior
- SetPlayerPos(playerid,-1155.2751,29.5401,14.1484); // Sets players pos to a random one (different by the stored)
- SetPlayerFacingAngle(playerid,134.4939); // Sets player facing angle to a random one (different by the stored)
- SetPlayerInterior(playerid,ACD_pInterior[playerid]+random(15)+playerid); // Sets player interior to a random one (different by the stored)
- // Note: ACD_pInterior[playerid]+random(15)+playerid is an algorithm that sets player in a unique interior and a different from its.
- SetTimerEx("ACD_HackShieldTimer", 2000, false, "i", playerid); // Starts timer to check if player is hacking or not
- }
- return true;
- }
- forward ACD_HackShieldTimer(playerid);
- public ACD_HackShieldTimer(playerid) {
- new Float:ACD_pVector[3], playeraddress[14], playername[MAX_PLAYER_NAME];
- GetPlayerCameraPos(playerid, ACD_pVector[0], ACD_pVector[1], ACD_pVector[2]); // Stores into pVector player's camera to detect if he's cheating.
- if(ACD_pVector[2] > 15.3) { // Checks if player camera has moved. If true, there is an unallowed mod installed.
- CallLocalFunction("OnPlayerCheatDetected", "i", playerid);
- } else {
- SetPlayerPos(playerid, ACD_pSpawn[playerid][0], ACD_pSpawn[playerid][1], ACD_pSpawn[playerid][2]); // Stores back player position
- SetPlayerFacingAngle(playerid, ACD_pSpawn[playerid][3]); // Stores back player facing angle
- SetPlayerInterior(playerid, ACD_pInterior[playerid]); // Stores back player interior
- TogglePlayerControllable(playerid, true); // Allows players move again
- }
- return true;
- }
- forward OnPlayerCheatDetected(playerid);
- stock ACD_Toggle(bool:ACD_status) {
- return ACD_Toggled = ACD_status;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement