### NexAC Settings Configuration File Example Source: https://github.com/nexiustailer/nex-ac/blob/master/_autodocs/configuration.md Example content for nex-ac_settings.cfg, specifying enable/disable state for anti-cheat codes. Line number corresponds to the anti-cheat code. ```text 1 1 0 1 ... ``` -------------------------------- ### NexAC NOP Settings Configuration File Example Source: https://github.com/nexiustailer/nex-ac/blob/master/_autodocs/configuration.md Example content for nex-ac_nop_settings.cfg, specifying enable/disable state for NOP protections. Line number corresponds to the NOP protection code. ```text 1 1 1 ... ``` -------------------------------- ### Install NexAC in Gamemode Source: https://github.com/nexiustailer/nex-ac/blob/master/_autodocs/configuration.md Include NexAC in your gamemode after a_samp. Customize defines before inclusion if necessary. ```pawn // In your gamemode, include nex-ac AFTER a_samp: #define DEBUG #include #include // Customize defines BEFORE inclusion if needed: #define AC_MAX_PING 300 #define AC_USE_CASINOS false #include #include ``` -------------------------------- ### Install NexAC in Filterscript Source: https://github.com/nexiustailer/nex-ac/blob/master/_autodocs/configuration.md Include NexAC in your filterscript after a_samp. ```pawn In all filterscripts, include after a_samp: #define FILTERSCRIPT #include ``` -------------------------------- ### Compile Gamemode Source: https://github.com/nexiustailer/nex-ac/blob/master/_autodocs/quick-start.md Compile your modified gamemode using pawno.exe to finalize the installation. ```bash pawno.exe gamemode.pwn ``` -------------------------------- ### Complete Nex-AC Integration Example Source: https://github.com/nexiustailer/nex-ac/blob/master/_autodocs/README.md This snippet shows a complete integration of Nex-AC, including defining constants, including necessary headers, and implementing callbacks for cheat detection and warnings. It demonstrates how to log detected cheats and handle warnings. ```pawn #define AC_MAX_PING 600 #define AC_USE_STATISTICS 1 #include #include public OnCheatDetected(playerid, const ip[], type, code) { new name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof name); printf("[AC] %s kicked for code %d", name, code); Kick(playerid); return 1; } public OnCheatWarning(playerid, const ip[], type, code, code2, count) { if(count >= 5) { printf("[AC] %d warnings for player %d code %d", count, playerid, code); } return 1; } ``` -------------------------------- ### Wrapper Functions - Player Spawn Source: https://github.com/nexiustailer/nex-ac/blob/master/_autodocs/exported-symbols.md Functions that wrap SA:MP native functions for player spawning and class setup. ```APIDOC ## Wrapper Functions - Player Spawn ### acc_SpawnPlayer Spawns a player at their current position. ### Method N/A (Function Call) ### Signature `acc_SpawnPlayer(playerid)` ### Parameters - **playerid** (int) - The ID of the player to spawn. --- ### acc_SetSpawnInfo Sets the spawn information for a player, including team, skin, position, rotation, and initial weapons. ### Method N/A (Function Call) ### Signature `acc_SetSpawnInfo(playerid, team, skin, Float:x, Float:y, Float:z, Float:rotation, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo)` ### Parameters - **playerid** (int) - The ID of the player. - **team** (int) - The player's team. - **skin** (int) - The player's skin ID. - **x** (Float) - The spawn X coordinate. - **y** (Float) - The spawn Y coordinate. - **z** (Float) - The spawn Z coordinate. - **rotation** (Float) - The spawn rotation. - **weapon1** (int) - The ID of the first weapon. - **weapon1_ammo** (int) - The ammo for the first weapon. - **weapon2** (int) - The ID of the second weapon. - **weapon2_ammo** (int) - The ammo for the second weapon. - **weapon3** (int) - The ID of the third weapon. - **weapon3_ammo** (int) - The ammo for the third weapon. --- ### acc_AddPlayerClass Adds a player class with default parameters. ### Method N/A (Function Call) ### Signature `acc_AddPlayerClass(...)` ### Parameters - **...** - Placeholder for class definition parameters. --- ### acc_AddPlayerClassEx Adds a player class with extended parameters. ### Method N/A (Function Call) ### Signature `acc_AddPlayerClassEx(...)` ### Parameters - **...** - Placeholder for extended class definition parameters. ``` -------------------------------- ### Enable Anticheat at Runtime Source: https://github.com/nexiustailer/nex-ac/blob/master/_autodocs/quick-start.md Ensure anticheats are enabled at runtime, especially if they were disabled by default or at compile time. This example shows how to enable rapid fire detection in the OnGameModeInit callback. ```pawn public OnGameModeInit() { // Enable rapid fire detection EnableAntiCheat(26, 1); return 1; } ``` -------------------------------- ### Configure Max Ping and Message Color Source: https://github.com/nexiustailer/nex-ac/blob/master/_autodocs/quick-start.md Customize Nex-AC settings at compile time by defining constants before including the nex-ac module. This example sets the maximum ping and the color for warning messages. ```pawn // Maximum ping (ms) - set 0 for unlimited #define AC_MAX_PING 500 // Disable a specific anticheat at compile time // (Still can be enabled at runtime via EnableAntiCheat) #define AC_DEFAULT_COLOR 0xFF0000FF // Red messages #define DEBUG #include #include ``` -------------------------------- ### Basic Nex-AC Integration Source: https://github.com/nexiustailer/nex-ac/blob/master/_autodocs/00-START-HERE.md Integrate Nex-AC into your SA:MP gamemode by including the necessary headers and implementing the OnCheatDetected callback. This example shows how to kick a player when a cheat is detected. ```pawn // In your gamemode, after #include : #include #include // Implement this callback: public OnCheatDetected(playerid, const ip_address[], type, code) { Kick(playerid); return 1; } ``` -------------------------------- ### Enable Configuration Files Source: https://github.com/nexiustailer/nex-ac/blob/master/_autodocs/configuration.md Enable loading anticheat settings from external configuration files. If disabled, compiled-in defaults are used. ```pawn #if !defined AC_USE_CONFIG_FILES #define AC_USE_CONFIG_FILES true #endif ``` -------------------------------- ### Get Last Pickup ID Collected By Player Source: https://github.com/nexiustailer/nex-ac/blob/master/_autodocs/api-reference.md Retrieves the ID of the last pickup a player picked up. Use this to get the pickup ID of a connected player. ```pawn stock AntiCheatGetLastPickup(playerid) ``` -------------------------------- ### Basic Compile-Time Configuration Source: https://github.com/nexiustailer/nex-ac/blob/master/_autodocs/configuration.md Include Nex-AC with basic debug and language settings enabled. Ensure these defines are set before including the main Nex-AC header. ```pawn #define DEBUG #include #include ``` -------------------------------- ### Get Last Weapon ID Shot By Player Source: https://github.com/nexiustailer/nex-ac/blob/master/_autodocs/api-reference.md Retrieves the ID of the last weapon a player shot from. Use this to get the weapon ID of a connected player. ```pawn stock AntiCheatGetLastShotWeapon(playerid) ``` -------------------------------- ### Adjust False Positive Thresholds Source: https://github.com/nexiustailer/nex-ac/blob/master/_autodocs/quick-start.md To reduce false positives from legitimate players, adjust the warning thresholds for specific cheats. This example increases the thresholds for speed hacking and rapid fire. ```pawn // Increase speed hack warning threshold #define AC_MAX_SPEEDHACK_WARNINGS 10 // Increase rapid fire threshold #define AC_MAX_RAPID_FIRE_WARNINGS 20 #include ``` -------------------------------- ### Get Player Spawn Position Source: https://github.com/nexiustailer/nex-ac/blob/master/_autodocs/api-reference.md Retrieves a player's spawn position (X, Y, Z coordinates). This function is specifically for getting the coordinates where a player last spawned. ```pawn stock AntiCheatGetSpawnPos(playerid, &Float:x, &Float:y, &Float:z) { // Implementation details omitted for brevity return 0; // Placeholder } ``` -------------------------------- ### Get Player's Previous Special Action ID Source: https://github.com/nexiustailer/nex-ac/blob/master/_autodocs/api-reference.md Retrieves the player's previous special action ID. Use this to get the action ID of a connected player. ```pawn stock AntiCheatGetLastSpecialAction(playerid) ``` -------------------------------- ### Set Main Configuration File Path Source: https://github.com/nexiustailer/nex-ac/blob/master/_autodocs/configuration.md Specify the name of the main anticheat settings configuration file. This file is located in the 'scriptfiles/' directory. ```pawn #if !defined AC_CONFIG_FILE #define AC_CONFIG_FILE "nex-ac_settings.cfg" #endif ``` -------------------------------- ### Get Player's Current Special Action ID Source: https://github.com/nexiustailer/nex-ac/blob/master/_autodocs/api-reference.md Retrieves the player's current special action ID. Use this to get the action ID of a connected player. ```pawn stock AntiCheatGetSpecialAction(playerid) ``` -------------------------------- ### Get Player's Last Spawn Tick Time Source: https://github.com/nexiustailer/nex-ac/blob/master/_autodocs/api-reference.md Retrieves the tick time of the player's last spawn. Use this to get the last spawn time of a connected player. ```pawn stock AntiCheatGetLastSpawnTime(playerid) ``` -------------------------------- ### Add Player Class Ex Wrapper Source: https://github.com/nexiustailer/nex-ac/blob/master/_autodocs/wrapper-functions.md Wraps AddPlayerClassEx() to record team-specific class spawn weapons for validation. Use the original AddPlayerClassEx() function directly. ```pawn stock acc_AddPlayerClassEx(teamid, modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo) ``` -------------------------------- ### Add Player Class Wrapper Source: https://github.com/nexiustailer/nex-ac/blob/master/_autodocs/wrapper-functions.md Wraps AddPlayerClass() to record all class spawn weapons for validation. Use the original AddPlayerClass() function directly. ```pawn stock acc_AddPlayerClass(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo) ``` -------------------------------- ### Get Player's Last Update Tick Time Source: https://github.com/nexiustailer/nex-ac/blob/master/_autodocs/api-reference.md Retrieves the tick time of the player's last update. Use this to get the last update time of a connected player. ```pawn stock AntiCheatGetLastUpdateTime(playerid) ``` -------------------------------- ### Spawn Player Wrapper Source: https://github.com/nexiustailer/nex-ac/blob/master/_autodocs/wrapper-functions.md Wraps the standard SpawnPlayer() function to track spawn events and initialize anticheat player data. Use the original SpawnPlayer() function directly. ```pawn stock acc_SpawnPlayer(playerid) ``` -------------------------------- ### Get Player's Last Shot Tick Time Source: https://github.com/nexiustailer/nex-ac/blob/master/_autodocs/api-reference.md Retrieves the tick time of the player's last weapon shot. Use this to get the last shot time of a connected player. ```pawn stock AntiCheatGetLastShotTime(playerid) ``` -------------------------------- ### Get Player's Last Reload Tick Time Source: https://github.com/nexiustailer/nex-ac/blob/master/_autodocs/api-reference.md Retrieves the tick time of the player's last weapon reload. Use this to get the last reload time of a connected player. ```pawn stock AntiCheatGetLastReloadTime(playerid) ``` -------------------------------- ### Get Player's Last Vehicle Entry Tick Time Source: https://github.com/nexiustailer/nex-ac/blob/master/_autodocs/api-reference.md Retrieves the tick time of the player's last vehicle entry attempt. Use this to get the last vehicle entry time of a connected player. ```pawn stock AntiCheatGetLastEnteredVehTime(playerid) ``` -------------------------------- ### Set Player Spawn Information Wrapper Source: https://github.com/nexiustailer/nex-ac/blob/master/_autodocs/wrapper-functions.md Wraps SetSpawnInfo() to record spawn weapon and position data for validation. Use the original SetSpawnInfo() function directly. ```pawn stock acc_SetSpawnInfo(playerid, team, skin, Float:x, Float:y, Float:z, Float:rotation, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo) ``` -------------------------------- ### Wrapper Functions - Pickup & Interior Source: https://github.com/nexiustailer/nex-ac/blob/master/_autodocs/exported-symbols.md Functions for managing pickups, interiors, and player animations. ```APIDOC ## Wrapper Functions - Pickup & Interior ### acc_AddStaticPickup Adds a static pickup to the game world. ### Method N/A (Function Call) ### Signature `acc_AddStaticPickup(model, type, Float:X, Float:Y, Float:Z, virtualworld = 0)` ### Parameters - **model** (int) - The model ID of the pickup. - **type** (int) - The type of the pickup. - **X** (Float) - The X coordinate. - **Y** (Float) - The Y coordinate. - **Z** (Float) - The Z coordinate. - **virtualworld** (int, optional) - The virtual world. Defaults to 0. --- ### acc_CreatePickup Creates a pickup at the specified location. ### Method N/A (Function Call) ### Signature `acc_CreatePickup(model, type, Float:X, Float:Y, Float:Z, virtualworld = 0)` ### Parameters - **model** (int) - The model ID of the pickup. - **type** (int) - The type of the pickup. - **X** (Float) - The X coordinate. - **Y** (Float) - The Y coordinate. - **Z** (Float) - The Z coordinate. - **virtualworld** (int, optional) - The virtual world. Defaults to 0. ### Return int - The ID of the created pickup. --- ### acc_DestroyPickup Destroys a pickup. ### Method N/A (Function Call) ### Signature `acc_DestroyPickup(pickup)` ### Parameters - **pickup** (int) - The ID of the pickup to destroy. --- ### acc_DisableInteriorEnterExits Disables entering and exiting interiors. ### Method N/A (Function Call) ### Signature `acc_DisableInteriorEnterExits()` --- ### acc_UsePlayerPedAnims Enables the use of player ped animations. ### Method N/A (Function Call) ### Signature `acc_UsePlayerPedAnims()` ``` -------------------------------- ### AntiCheatGetVehicleDriver Source: https://github.com/nexiustailer/nex-ac/blob/master/README.md Gets the ID of the driver of a vehicle. ```APIDOC ## AntiCheatGetVehicleDriver(vehicleid) ### Description Use to get the ID of the driver of a vehicle. ### Parameters #### Path Parameters - **vehicleid** (integer) - The ID of the vehicle. ``` -------------------------------- ### Include Nex-AC in Gamemode Source: https://github.com/nexiustailer/nex-ac/blob/master/_autodocs/quick-start.md Add these lines at the very top of your main gamemode file, after including a_samp, to integrate Nex-AC. ```pawn #define DEBUG #include // Or your preferred language #include ``` -------------------------------- ### AntiCheatGetSpawnPos Source: https://github.com/nexiustailer/nex-ac/blob/master/README.md Gets the spawn position of a player. Returns 1 on success, 0 if player not connected. ```APIDOC ## AntiCheatGetSpawnPos(playerid, &Float:x, &Float:y, &Float:z) ### Description Use to get the spawn position of a player. ### Parameters #### Path Parameters - **playerid** (integer) - The ID of the player to get the spawn position of. - **&Float:x** (float reference) - A variable to store the x coordinate in, passed by reference. - **&Float:y** (float reference) - A variable to store the y coordinate in, passed by reference. - **&Float:z** (float reference) - A variable to store the z coordinate in, passed by reference. ### Returns - `1` (true) if the function executed successfully. - `0` (false) if the player is not connected. ``` -------------------------------- ### Set NOP Configuration File Path Source: https://github.com/nexiustailer/nex-ac/blob/master/_autodocs/configuration.md Specify the name of the NOP (null operation) settings configuration file. This file is also located in the 'scriptfiles/' directory. ```pawn #if !defined AC_NOP_CONFIG_FILE #define AC_NOP_CONFIG_FILE "nex-ac_nop_settings.cfg" #endif ``` -------------------------------- ### AntiCheatGetDialog Source: https://github.com/nexiustailer/nex-ac/blob/master/README.md Gets the ID of the dialog currently opened for a player. Returns -1 if the player is not connected. ```APIDOC ## AntiCheatGetDialog(playerid) ### Description Use to get the ID of the opened dialog for a player. ### Parameters #### Path Parameters - **playerid** (integer) - The ID of the player to get the active dialog ID for ### Returns - The ID of the dialog (integer) - `-1` if the player is not connected ``` -------------------------------- ### Get Player Speed Source: https://github.com/nexiustailer/nex-ac/blob/master/_autodocs/api-reference.md Retrieves the current speed of a player. Use this to check how fast a player is moving. ```pawn stock AntiCheatGetSpeed(playerid) { // Implementation details omitted for brevity return 0; // Placeholder } new speed = AntiCheatGetSpeed(playerid); if(speed > 100) { // Player is moving fast } ``` -------------------------------- ### Enable Server Query Handling Source: https://github.com/nexiustailer/nex-ac/blob/master/_autodocs/configuration.md Enable the handling of server query responses. This is crucial for anticheat systems that rely on server communication. ```pawn #if !defined AC_USE_QUERY #define AC_USE_QUERY true #endif ``` -------------------------------- ### AntiCheatGetLastSpecialAction Source: https://github.com/nexiustailer/nex-ac/blob/master/README.md Gets the ID of the player's previous special action. Returns 0 if the player is not connected. ```APIDOC ## AntiCheatGetLastSpecialAction(playerid) ### Description Use to get the ID of the player's previous special action. ### Parameters #### Path Parameters - **playerid** (integer) - The ID of the player to get the previous special action of ### Returns - The ID of the previous special action (integer) - `0` if the player is not connected ``` -------------------------------- ### AntiCheatGetSpeed Source: https://github.com/nexiustailer/nex-ac/blob/master/README.md Gets the current speed of a player based on anti-cheat data. Returns 0 if the player is not connected. ```APIDOC ## AntiCheatGetSpeed(playerid) ### Description Use to get the speed of a player. ### Parameters #### Path Parameters - **playerid** (integer) - The ID of the player to get the speed of ### Returns - The player's speed (float) - `0` if the player is not connected ``` -------------------------------- ### Get Pickup Position Source: https://github.com/nexiustailer/nex-ac/blob/master/_autodocs/api-reference.md Retrieves the position of a given pickup. Returns 1 if successful, 0 if the pickup does not exist. ```pawn stock AntiCheatGetPickupPos(pickupid, &Float:x, &Float:y, &Float:z) ``` -------------------------------- ### Nex-AC Optional Warning Callbacks Source: https://github.com/nexiustailer/nex-ac/blob/master/_autodocs/quick-start.md Implement these optional callbacks to receive notifications for specific events like flood protection or NOP (No Operation) protection warnings. ```pawn // Optional - flood protection warnings public OnFloodWarning(playerid, publicid, count) { } // Optional - NOP protection warnings public OnNOPWarning(playerid, nopid, count) { } ``` -------------------------------- ### Get Vehicle Paintjob Source: https://github.com/nexiustailer/nex-ac/blob/master/_autodocs/api-reference.md Retrieves the paintjob ID of a vehicle. Returns the paintjob ID or 3 if the vehicle does not exist. ```pawn stock AntiCheatGetVehiclePaintjob(vehicleid) ``` -------------------------------- ### Show Player Dialog Wrapper Source: https://github.com/nexiustailer/nex-ac/blob/master/_autodocs/wrapper-functions.md Wrapper for ShowPlayerDialog(). Tracks open dialogs for flood protection. Use this to display dialogs to players while ensuring anticheat compliance. ```pawn stock acc_ShowPlayerDialog(playerid, dialogid, style, AC_CONST caption[], AC_CONST info[], AC_CONST button1[], AC_CONST button2[]) ``` -------------------------------- ### Callbacks (Implement in Your Code) Source: https://github.com/nexiustailer/nex-ac/blob/master/_autodocs/README.md These are callback functions that you should implement in your gamemode to handle detected cheats, warnings, and other events triggered by the Nex-AC system. ```APIDOC ## Callbacks (Implement in Your Code) ### Description Callbacks that your gamemode must implement to react to detected cheats and warnings from the Nex-AC system. ### Required Callbacks - `public OnCheatDetected(playerid, const ip_address[], type, code)` - **Description:** Called when a cheat is detected. - **Parameters:** - `playerid` (integer) - The ID of the player who triggered the detection. - `ip_address[]` (string) - The IP address of the player. - `type` (integer) - The detection type (0 for player-specific, 1 for IP-based). - `code` (integer) - The anti-cheat code that was detected. - **Return:** (integer) - Return 1 to indicate the callback was handled. ### Recommended Callbacks - `public OnCheatWarning(playerid, const ip_address[], type, code, code2, count)` - **Description:** Called when a potential cheat is flagged, providing more details than a full detection. - **Parameters:** - `playerid` (integer) - The ID of the player. - `ip_address[]` (string) - The IP address of the player. - `type` (integer) - The detection type. - `code` (integer) - The primary anti-cheat code. - `code2` (integer) - A secondary code, if applicable. - `count` (integer) - The number of times this violation has occurred. - **Return:** (integer) - Return 1 to indicate the callback was handled. ### Optional Callbacks - `public OnFloodWarning(playerid, publicid, count)` - **Description:** Called when a player triggers a flood warning for protected callbacks. - **Parameters:** - `playerid` (integer) - The ID of the player. - `publicid` (integer) - The ID of the protected callback that was flooded. - `count` (integer) - The number of violations. - **Return:** (integer) - Return 1 to indicate the callback was handled. - `public OnNOPWarning(playerid, nopid, count)` - **Description:** Called when a player triggers a 'No Operation' (NOP) warning. - **Parameters:** - `playerid` (integer) - The ID of the player. - `nopid` (integer) - The ID of the NOP protection triggered. - `count` (integer) - The number of violations. - **Return:** (integer) - Return 1 to indicate the callback was handled. ``` -------------------------------- ### Get Vehicle Driver Source: https://github.com/nexiustailer/nex-ac/blob/master/_autodocs/api-reference.md Retrieves the player ID of the driver of a vehicle. Returns the player ID or INVALID_PLAYER_ID if the vehicle does not exist. ```pawn stock AntiCheatGetVehicleDriver(vehicleid) ``` -------------------------------- ### Include Nex-AC in Gamemode Source: https://github.com/nexiustailer/nex-ac/blob/master/README.md Include the Nex-AC anticheat and its language file in your gamemode. Ensure the language file is placed in the correct directory and included before the main Nex-AC include. ```pawn #define DEBUG #include //or any other #include ``` -------------------------------- ### Get Vehicle Speed Source: https://github.com/nexiustailer/nex-ac/blob/master/_autodocs/api-reference.md Retrieves the current speed of a vehicle. Returns the vehicle's speed or 0 if the vehicle does not exist. ```pawn stock AntiCheatGetVehicleSpeed(vehicleid) ``` -------------------------------- ### Wrapper Functions - Position & Movement Source: https://github.com/nexiustailer/nex-ac/blob/master/_autodocs/exported-symbols.md Functions for setting player position, velocity, and interior. ```APIDOC ## Wrapper Functions - Position & Movement ### acc_SetPlayerPos Sets the position of a player. ### Method N/A (Function Call) ### Signature `acc_SetPlayerPos(playerid, Float:x, Float:y, Float:z)` ### Parameters - **playerid** (int) - The ID of the player. - **x** (Float) - The target X coordinate. - **y** (Float) - The target Y coordinate. - **z** (Float) - The target Z coordinate. --- ### acc_SetPlayerPosFindZ Sets the position of a player and finds the appropriate Z coordinate. ### Method N/A (Function Call) ### Signature `acc_SetPlayerPosFindZ(playerid, Float:x, Float:y, Float:z)` ### Parameters - **playerid** (int) - The ID of the player. - **x** (Float) - The target X coordinate. - **y** (Float) - The target Y coordinate. - **z** (Float) - The target Z coordinate (used as a base for finding Z). --- ### acc_SetPlayerVelocity Sets the velocity of a player. ### Method N/A (Function Call) ### Signature `acc_SetPlayerVelocity(playerid, Float:X, Float:Y, Float:Z)` ### Parameters - **playerid** (int) - The ID of the player. - **X** (Float) - The target X velocity component. - **Y** (Float) - The target Y velocity component. - **Z** (Float) - The target Z velocity component. --- ### acc_SetPlayerInterior Sets the interior ID for a player. ### Method N/A (Function Call) ### Signature `acc_SetPlayerInterior(playerid, interiorid)` ### Parameters - **playerid** (int) - The ID of the player. - **interiorid** (int) - The ID of the interior. ``` -------------------------------- ### Get Vehicle Velocity Source: https://github.com/nexiustailer/nex-ac/blob/master/_autodocs/api-reference.md Retrieves a vehicle's velocity vector. Returns 1 on success, 0 if the vehicle does not exist. ```pawn stock AntiCheatGetVehicleVelocity(vehicleid, &Float:x, &Float:y, &Float:z) ``` -------------------------------- ### acc_SpawnPlayer Source: https://github.com/nexiustailer/nex-ac/blob/master/_autodocs/wrapper-functions.md Wrapper for SpawnPlayer(). Tracks spawn events and initializes anticheat player data. ```APIDOC ## acc_SpawnPlayer ### Description Wrapper for `SpawnPlayer()`. Tracks spawn events and initializes anticheat player data. ### Parameters #### Path Parameters - **playerid** (int) - Required - Player to spawn ### Return Value `int` — Same as original `SpawnPlayer()` ### Usage Use the standard `SpawnPlayer()` function; the wrapper is automatically called. ``` -------------------------------- ### acc_SetSpawnInfo Source: https://github.com/nexiustailer/nex-ac/blob/master/_autodocs/wrapper-functions.md Wrapper for SetSpawnInfo(). Records spawn weapon and position data for validation. ```APIDOC ## acc_SetSpawnInfo ### Description Wrapper for `SetSpawnInfo()`. Records spawn weapon and position data for validation. ### Parameters #### Path Parameters - **playerid** (int) - Required - Player to configure - **team** (int) - Required - Team ID - **skin** (int) - Required - Skin model ID - **x** (Float) - Required - Spawn X coordinate - **y** (Float) - Required - Spawn Y coordinate - **z** (Float) - Required - Spawn Z coordinate - **rotation** (Float) - Required - Spawn rotation (Z angle) - **weapon1** (int) - Required - First spawn weapon - **weapon1_ammo** (int) - Required - First weapon ammo - **weapon2** (int) - Required - Second spawn weapon - **weapon2_ammo** (int) - Required - Second weapon ammo - **weapon3** (int) - Required - Third spawn weapon - **weapon3_ammo** (int) - Required - Third weapon ammo ### Return Value `int` — Same as original `SetSpawnInfo()` ``` -------------------------------- ### Get Vehicle Interior Source: https://github.com/nexiustailer/nex-ac/blob/master/_autodocs/api-reference.md Retrieves the interior ID of the interior a vehicle is currently in. Returns the interior ID or 0 if the vehicle does not exist. ```pawn stock AntiCheatGetVehicleInterior(vehicleid) ``` -------------------------------- ### AntiCheatGetLastShotTime Source: https://github.com/nexiustailer/nex-ac/blob/master/README.md Gets the player's last weapon shot tick based on anti-cheat data. Returns 0 if the player is not connected. ```APIDOC ## AntiCheatGetLastShotTime(playerid) ### Description Use to get the player's last weapon shot tick. ### Parameters #### Path Parameters - **playerid** (integer) - The ID of the player to get the last shot tick of ### Returns - The tick of the last shot (integer) - `0` if the player is not connected ``` -------------------------------- ### Wrapper Functions - Tuning Source: https://github.com/nexiustailer/nex-ac/blob/master/_autodocs/exported-symbols.md Functions for vehicle tuning, including paintjobs, interior links, and parameters. ```APIDOC ## Wrapper Functions - Tuning ### acc_ChangeVehiclePaintjob Changes the paintjob of a vehicle. ### Method N/A (Function Call) ### Signature `acc_ChangeVehiclePaintjob(vehicleid, paintjobid)` ### Parameters - **vehicleid** (int) - The ID of the vehicle. - **paintjobid** (int) - The ID of the paintjob to apply. --- ### acc_LinkVehicleToInterior Links a vehicle to a specific interior. ### Method N/A (Function Call) ### Signature `acc_LinkVehicleToInterior(vehicleid, interiorid)` ### Parameters - **vehicleid** (int) - The ID of the vehicle. - **interiorid** (int) - The ID of the interior. --- ### acc_SetVehicleParamsEx Sets extended parameters for a vehicle. ### Method N/A (Function Call) ### Signature `acc_SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective)` ### Parameters - **vehicleid** (int) - The ID of the vehicle. - **engine** (int) - Engine status (0: off, 1: on). - **lights** (int) - Lights status (0: off, 1: on). - **alarm** (int) - Alarm status (0: off, 1: on). - **doors** (int) - Doors status (0: unlocked, 1: locked). - **bonnet** (int) - Bonnet status (0: closed, 1: open). - **boot** (int) - Boot status (0: closed, 1: open). - **objective** (int) - Objective status (0: off, 1: on). --- ### acc_SetVehicleParamsForPlayer Sets vehicle parameters for a specific player. ### Method N/A (Function Call) ### Signature `acc_SetVehicleParamsForPlayer(vehicleid, playerid, objective, doorslocked)` ### Parameters - **vehicleid** (int) - The ID of the vehicle. - **playerid** (int) - The ID of the player. - **objective** (int) - Objective status for the player (0: off, 1: on). - **doorslocked** (int) - Doors locked status for the player (0: unlocked, 1: locked). --- ### acc_SetVehicleToRespawn Sets a vehicle to respawn. ### Method N/A (Function Call) ### Signature `acc_SetVehicleToRespawn(vehicleid)` ### Parameters - **vehicleid** (int) - The ID of the vehicle. ``` -------------------------------- ### AntiCheatGetLastReloadTime Source: https://github.com/nexiustailer/nex-ac/blob/master/README.md Gets the player's last weapon reload tick based on anti-cheat data. Returns 0 if the player is not connected. ```APIDOC ## AntiCheatGetLastReloadTime(playerid) ### Description Use to get the player's last weapon reload tick. ### Parameters #### Path Parameters - **playerid** (integer) - The ID of the player to get the last reload tick of ### Returns - The tick of the last reload (integer) - `0` if the player is not connected ``` -------------------------------- ### Wrapper Functions - Health & Armor Source: https://github.com/nexiustailer/nex-ac/blob/master/_autodocs/exported-symbols.md Functions to set player health and armor. ```APIDOC ## Wrapper Functions - Health & Armor ### acc_SetPlayerHealth Sets the health of a player. ### Method N/A (Function Call) ### Signature `acc_SetPlayerHealth(playerid, Float:health)` ### Parameters - **playerid** (int) - The ID of the player. - **health** (Float) - The desired health value. --- ### acc_SetPlayerArmour Sets the armor of a player. ### Method N/A (Function Call) ### Signature `acc_SetPlayerArmour(playerid, Float:armour)` ### Parameters - **playerid** (int) - The ID of the player. - **armour** (Float) - The desired armor value. ``` -------------------------------- ### AntiCheatGetLastPickup Source: https://github.com/nexiustailer/nex-ac/blob/master/README.md Gets the ID of the last pickup item a player collected, based on anti-cheat data. Returns -1 if the player is not connected. ```APIDOC ## AntiCheatGetLastPickup(playerid) ### Description Use to get the ID of the last pickup which a player picked up. ### Parameters #### Path Parameters - **playerid** (integer) - The ID of the player to get the last picked up pickup ID of ### Returns - The ID of the last picked up pickup (integer) - `-1` if the player is not connected ``` -------------------------------- ### Nex-AC OnCheatWarning Callback Source: https://github.com/nexiustailer/nex-ac/blob/master/_autodocs/quick-start.md This callback is triggered before a player is kicked, providing an opportunity to issue warnings or perform other actions. It should be implemented. ```pawn // Should implement - warnings before kick public OnCheatWarning(playerid, const ip[], type, code, code2, count) { } ``` -------------------------------- ### AntiCheatGetVehicleSeat Source: https://github.com/nexiustailer/nex-ac/blob/master/README.md Gets the seat ID of the vehicle a player is currently occupying, based on anti-cheat data. Returns -1 if the player is not connected. ```APIDOC ## AntiCheatGetVehicleSeat(playerid) ### Description Use to get the seat of the vehicle a player is currently in (according to anticheat data). ### Parameters #### Path Parameters - **playerid** (integer) - The ID of the player to get the seat of ### Returns - The ID of the seat (integer) - `-1` if the player is not connected ``` -------------------------------- ### Customize Nex-AC Configuration Source: https://github.com/nexiustailer/nex-ac/blob/master/_autodocs/README.md Modify these preprocessor directives to customize Nex-AC behavior, such as adjusting ping tolerance, disabling features, or changing warning thresholds. ```pawn // Increase max ping tolerance #define AC_MAX_PING 1000 // Disable optional features to save memory #define AC_USE_CASINOS 0 #define AC_USE_VENDING_MACHINES 0 // Increase warning threshold for rapid fire #define AC_MAX_RAPID_FIRE_WARNINGS 20 // Customize message color #define AC_DEFAULT_COLOR 0xFF0000FF // Red #include ``` -------------------------------- ### Implement Nex-AC Callbacks in Pawn Gamemode Source: https://github.com/nexiustailer/nex-ac/blob/master/_autodocs/callbacks.md This snippet shows a full implementation of Nex-AC callbacks for cheat detection, warnings, and flood/NOP alerts in a Pawn gamemode. It includes logging detections to a file and kicking offending players. Ensure Nex-AC is included and callbacks are declared as 'forward' and defined as 'public'. ```pawn #define DEBUG #include #include // Logging file handle new File:logFile; public OnGameModeInit() { // Open cheat log logFile = fopen("cheat_log.txt", io_append); return 1; } public OnGameModeExit() { if(logFile != File:0) fclose(logFile); return 1; } public OnCheatDetected(playerid, const ip_address[], type, code) { new codeName[64], logMsg[256], timestamp[32]; // Determine cheat name switch(code) { case 0: codeName = "Anti-AirBreak (onfoot)"; case 1: codeName = "Anti-AirBreak (in vehicle)"; case 9: codeName = "Anti-SpeedHack (onfoot)"; case 10: codeName = "Anti-SpeedHack (in vehicle)"; case 14: codeName = "Anti-Money hack"; case 26: codeName = "Anti-Rapid Fire"; case 42: codeName = "Anti-Rcon hack"; default: format(codeName, sizeof codeName, "Code %d", code); } // Get timestamp new hour, minute, second; gettime(hour, minute, second); format(timestamp, sizeof timestamp, "[%02d:%02d:%02d]", hour, minute, second); // Log the detection format(logMsg, sizeof logMsg, "%s CHEAT DETECTED | Player: %d | IP: %s | Type: %s", timestamp, playerid, ip_address, codeName); printf("%s", logMsg); if(logFile != File:0) { fwrite(logFile, logMsg); fwrite(logFile, "\r\n"); } // Kick the player Kick(playerid); return 1; } public OnCheatWarning(playerid, const ip_address[], type, code, code2, count) { // Warn player at warning level 3 if(count == 3) { SendClientMessage(playerid, 0xFF0000FF, "*** WARNING: Suspicious activity detected! ***"); } // Log high warning counts if(count >= 5) { printf("[WARNING] Player %d accumulated %d warnings for code %d", playerid, count, code); } return 1; } public OnFloodWarning(playerid, publicid, count) { // Ignore first flood warnings if(count > 3) { printf("[FLOOD] Player %d exceeded flood threshold on public %d (count: %d)", playerid, publicid, count); } return 1; } public OnNOPWarning(playerid, nopid, count) { if(count == 1) { printf("[NOP] Player %d triggered NOP check %d", playerid, nopid); } return 1; } ``` -------------------------------- ### AntiCheatGetVehicleID Source: https://github.com/nexiustailer/nex-ac/blob/master/README.md Gets the ID of the vehicle a player is currently occupying, based on anti-cheat data. Returns 0 if the player is not connected or not in a vehicle. ```APIDOC ## AntiCheatGetVehicleID(playerid) ### Description Use to get the ID of the vehicle a player is currently in (according to anticheat data). ### Parameters #### Path Parameters - **playerid** (integer) - The ID of the player in the vehicle to get the ID of ### Returns - The ID of the vehicle (integer) - `0` if the player is not connected or not in a vehicle ``` -------------------------------- ### Get Player Interior ID Source: https://github.com/nexiustailer/nex-ac/blob/master/_autodocs/api-reference.md Retrieves the interior ID of the interior a player is currently in. Returns the interior ID or 0 if the player is not connected. ```pawn stock AntiCheatGetInterior(playerid) ``` -------------------------------- ### Enable Statistics Collection Source: https://github.com/nexiustailer/nex-ac/blob/master/_autodocs/configuration.md Enable the collection and logging of anticheat statistics. These statistics are typically printed when the server shuts down. ```pawn #if !defined AC_USE_STATISTICS #define AC_USE_STATISTICS true #endif ``` -------------------------------- ### acc_AddPlayerClassEx Source: https://github.com/nexiustailer/nex-ac/blob/master/_autodocs/wrapper-functions.md Wrapper for AddPlayerClassEx(). Records team-specific class spawn weapons. ```APIDOC ## acc_AddPlayerClassEx ### Description Wrapper for `AddPlayerClassEx()`. Records team-specific class spawn weapons. ### Parameters #### Path Parameters - **teamid** (int) - Required - Team ID for the player class - **modelid** (int) - Required - Model ID for the player class - **spawn_x** (Float) - Required - Spawn X coordinate - **spawn_y** (Float) - Required - Spawn Y coordinate - **spawn_z** (Float) - Required - Spawn Z coordinate - **z_angle** (Float) - Required - Spawn Z angle - **weapon1** (int) - Required - First spawn weapon - **weapon1_ammo** (int) - Required - First weapon ammo - **weapon2** (int) - Required - Second spawn weapon - **weapon2_ammo** (int) - Required - Second weapon ammo - **weapon3** (int) - Required - Third spawn weapon - **weapon3_ammo** (int) - Required - Third weapon ammo ### Return Value `int` — Class ID assigned or -1 on failure ``` -------------------------------- ### Get Player Vehicle Seat Source: https://github.com/nexiustailer/nex-ac/blob/master/_autodocs/api-reference.md Retrieves the seat ID a player is occupying within a vehicle. Returns -1 if the player is not connected or not in a vehicle. ```pawn stock AntiCheatGetVehicleSeat(playerid) ``` -------------------------------- ### Get Player Weapon Source: https://github.com/nexiustailer/nex-ac/blob/master/_autodocs/api-reference.md Retrieves the weapon ID the player is currently holding, according to anticheat data. Returns -1 if the player is not connected. ```pawn stock AntiCheatGetWeapon(playerid) { // Implementation details omitted for brevity return -1; // Placeholder } ``` -------------------------------- ### acc_ShowPlayerDialog Source: https://github.com/nexiustailer/nex-ac/blob/master/_autodocs/wrapper-functions.md Wrapper for ShowPlayerDialog(). Tracks open dialogs for flood protection. ```APIDOC ## acc_ShowPlayerDialog ### Description Wrapper for `ShowPlayerDialog()`. Tracks open dialogs for flood protection. ### Parameters #### Path Parameters - **playerid** (int) - Required - Player to show the dialog to - **dialogid** (int) - Required - The dialog ID - **style** (int) - Required - The dialog style - **caption** (AC_CONST string) - Required - The dialog caption - **info** (AC_CONST string) - Required - The dialog information - **button1** (AC_CONST string) - Required - Text for the first button - **button2** (AC_CONST string) - Required - Text for the second button ### Return Value `int` — Same as original function ``` -------------------------------- ### Get Player Animation Index Source: https://github.com/nexiustailer/nex-ac/blob/master/_autodocs/api-reference.md Retrieves the index (ID) of the player's current animation. Returns the animation ID or 0 if the player is not connected. ```pawn stock AntiCheatGetAnimationIndex(playerid) ``` -------------------------------- ### Handle Cheat Detections Source: https://github.com/nexiustailer/nex-ac/blob/master/_autodocs/quick-start.md Implement the OnCheatDetected callback to log and kick players who trigger cheat detections. The OnCheatWarning callback can be used to warn players after a certain number of warnings. ```pawn public OnCheatDetected(playerid, const ip_address[], type, code) { // Get player name for logging new playerName[MAX_PLAYER_NAME]; GetPlayerName(playerid, playerName, sizeof(playerName)); // Get cheat name new cheatName[64]; switch(code) { case 0: cheatName = "Anti-AirBreak (onfoot)"; case 1: cheatName = "Anti-AirBreak (in vehicle)"; case 9: cheatName = "Anti-SpeedHack (onfoot)"; case 10: cheatName = "Anti-SpeedHack (in vehicle)"; case 14: cheatName = "Anti-Money hack"; case 26: cheatName = "Anti-Rapid Fire"; case 42: cheatName = "Anti-RCON hack"; default: format(cheatName, sizeof(cheatName), "Cheat code %d", code); } // Log the detection printf("[ANTI-CHEAT] %s (%d) detected for %s from IP: %s", playerName, playerid, cheatName, ip_address); // Kick the cheater Kick(playerid); return 1; } public OnCheatWarning(playerid, const ip_address[], type, code, code2, count) { // Warn player at 3rd warning if(count == 3) { SendClientMessage(playerid, 0xFF0000FF, "WARNING: Suspicious activity detected!"); } return 1; } ``` -------------------------------- ### Get Vehicle Position Source: https://github.com/nexiustailer/nex-ac/blob/master/_autodocs/api-reference.md Retrieves a vehicle's position coordinates according to anticheat data. Returns 1 on success, 0 if the vehicle does not exist. ```pawn stock AntiCheatGetVehiclePos(vehicleid, &Float:x, &Float:y, &Float:z) ``` -------------------------------- ### Nex-AC Language Support Source: https://github.com/nexiustailer/nex-ac/blob/master/_autodocs/quick-start.md Include the appropriate language file for Nex-AC to use translations. The default is English. Ensure the language file exists in the 'lang/' folder. ```pawn // English (default) #include // Or German #include // Or Spanish #include // Check the lang/ folder for all available languages #include ``` -------------------------------- ### Get Vehicle Health Source: https://github.com/nexiustailer/nex-ac/blob/master/_autodocs/api-reference.md Retrieves a vehicle's health status according to anticheat data. Returns 1 on success, 0 if the vehicle does not exist. ```pawn stock AntiCheatGetVehicleHealth(vehicleid, &Float:health) ``` -------------------------------- ### Wrap SetPlayerVelocity Source: https://github.com/nexiustailer/nex-ac/blob/master/_autodocs/wrapper-functions.md Wraps the SetPlayerVelocity function to track velocity changes for speed detection. ```pawn stock acc_SetPlayerVelocity(playerid, Float:X, Float:Y, Float:Z) ``` -------------------------------- ### Get Player Last Entered Vehicle Seat Source: https://github.com/nexiustailer/nex-ac/blob/master/_autodocs/api-reference.md Retrieves the seat ID the player last attempted to enter. Returns -1 if the player is not connected. ```pawn stock AntiCheatGetEnterVehicleSeat(playerid) ``` -------------------------------- ### Wrapper Functions - Control Source: https://github.com/nexiustailer/nex-ac/blob/master/_autodocs/exported-symbols.md Functions for controlling player actions like spectating and vehicle entry. ```APIDOC ## Wrapper Functions - Control ### acc_TogglePlayerControllable Toggles whether a player can control their character. ### Method N/A (Function Call) ### Signature `acc_TogglePlayerControllable(playerid, toggle)` ### Parameters - **playerid** (int) - The ID of the player. - **toggle** (bool) - True to enable control, false to disable. --- ### acc_TogglePlayerSpectating Toggles whether a player is in spectating mode. ### Method N/A (Function Call) ### Signature `acc_TogglePlayerSpectating(playerid, toggle)` ### Parameters - **playerid** (int) - The ID of the player. - **toggle** (bool) - True to enable spectating, false to disable. --- ### acc_PutPlayerInVehicle Places a player into a vehicle. ### Method N/A (Function Call) ### Signature `acc_PutPlayerInVehicle(playerid, vehicleid, seatid)` ### Parameters - **playerid** (int) - The ID of the player. - **vehicleid** (int) - The ID of the vehicle. - **seatid** (int) - The seat ID within the vehicle. --- ### acc_RemovePlayerFromVehicle Removes a player from their current vehicle. ### Method N/A (Function Call) ### Signature `acc_RemovePlayerFromVehicle(playerid)` ### Parameters - **playerid** (int) - The ID of the player. ``` -------------------------------- ### Get Player Vehicle ID Source: https://github.com/nexiustailer/nex-ac/blob/master/_autodocs/api-reference.md Retrieves the vehicle ID a player is currently in, according to anticheat data. Returns 0 if the player is not connected or not in a vehicle. ```pawn stock AntiCheatGetVehicleID(playerid) ``` -------------------------------- ### acc_PlayerSpectateVehicle Source: https://github.com/nexiustailer/nex-ac/blob/master/_autodocs/wrapper-functions.md Wrapper for vehicle spectating. ```APIDOC ## acc_PlayerSpectateVehicle ### Description Wrapper for vehicle spectating. ### Parameters #### Path Parameters - **playerid** (int) - Required - **targetvehicleid** (int) - Required - **mode** (int) - Optional - Defaults to SPECTATE_MODE_NORMAL ### Return Value `int` — 1 if successful ``` -------------------------------- ### Use Player Ped Animations Source: https://github.com/nexiustailer/nex-ac/blob/master/_autodocs/wrapper-functions.md Wraps the native UsePlayerPedAnims function, registering custom ped animations with anticheat. Use this to enable custom character animations. ```pawn stock acc_UsePlayerPedAnims() { // Wrapper for UsePlayerPedAnims() } ``` -------------------------------- ### Get Player Dialog ID Source: https://github.com/nexiustailer/nex-ac/blob/master/_autodocs/api-reference.md Retrieves the ID of the dialog currently open for a player. Returns the dialog ID or -1 if the player is not connected or has no dialog open. ```pawn stock AntiCheatGetDialog(playerid) ```