### Configure Server Startup Parameters Source: https://context7.com/vanillaplusplus/vpp-admin-tools/llms.txt Add the required dependencies and mod paths to your server's batch file or launch script. ```bash # Server startup parameters - add to your batch file or launch script # CF (Community Framework) is a required dependency DayZServer_x64.exe -config=serverDZ.cfg -mod=@CF;@VPPAdminTools -profiles=ServerProfiles # Directory structure after first startup: # ServerProfiles/VPPAdminTools/ # ├── Permissions/ # │ ├── SuperAdmins/ # │ │ └── SuperAdmins.txt # List of Super Admin Steam64 IDs # │ ├── UserGroups/ # │ │ └── UserGroups.json # User groups and their permissions # │ └── credentials.txt # Admin password (gets hashed on first run) # ├── ConfigurablePlugins/ # │ ├── TeleportManager/ # │ ├── WeatherManager/ # │ ├── ItemManager/ # │ └── WebHooksManager/ # └── BanList.json ``` -------------------------------- ### Add Mods to Server Startup Parameters Source: https://github.com/vanillaplusplus/vpp-admin-tools/wiki/Installation-&-Configuration Append this string to your DayZ server's startup parameters to include the VPPAdminTools and CF mods. Ensure correct formatting, especially regarding semicolons and profile directory. ```batch -mod=@CF;@VPPAdminTools -profiles=NameOfFolder ``` -------------------------------- ### Configure Super Admin IDs Source: https://context7.com/vanillaplusplus/vpp-admin-tools/llms.txt Add Steam64 IDs to the SuperAdmins.txt file to grant full administrative privileges. ```bash # SuperAdmins.txt - Add one Steam64 ID per line # Location: /VPPAdminTools/Permissions/SuperAdmins/SuperAdmins.txt 76561198420222029 76561198321354754 # Note: Do NOT add commas or spaces between IDs # Find your Steam64 ID at https://steamid.io/ ``` -------------------------------- ### Configure Admin Credentials Source: https://context7.com/vanillaplusplus/vpp-admin-tools/llms.txt Set the initial admin password in credentials.txt, which will be automatically hashed upon server restart. ```bash # credentials.txt - Set your admin password # Location: /VPPAdminTools/Permissions/credentials.txt # On first startup, replace the entire contents with your password (max 32 characters) MySecureAdminPassword123 # After server restart, the password will be automatically hashed # Store the original password securely - you cannot recover it from the hash # Optional: Disable password protection in serverDZ.cfg vppDisablePassword = 1; ``` -------------------------------- ### Navigate Between Players (Goto, Bring, Return) Source: https://context7.com/vanillaplusplus/vpp-admin-tools/llms.txt Handles player navigation between locations using VPPAT_TeleportType enum (GOTO, BRING, RETURN). Allows going to another player, bringing a player to your location, or returning a player to their previous position. ```cpp // Go to another player's location array targets = {"76561198420222029"}; GetRPCManager().VSendRPC( "RPC_PlayerManager", "TeleportHandle", new Param2>(VPPAT_TeleportType.GOTO, targets), true ); // Bring a player to your location GetRPCManager().VSendRPC( "RPC_PlayerManager", "TeleportHandle", new Param2>(VPPAT_TeleportType.BRING, targets), true ); // Return a player to their previous position GetRPCManager().VSendRPC( "RPC_PlayerManager", "TeleportHandle", new Param2>(VPPAT_TeleportType.RETURN, targets), true ); // VPPAT_TeleportType enum: GOTO, BRING, RETURN ``` -------------------------------- ### VSendRPC Integration Source: https://context7.com/vanillaplusplus/vpp-admin-tools/llms.txt Demonstrates sending RPCs between client and server and registering new RPC handlers. ```cpp // Client to Server RPC (password automatically included) GetRPCManager().VSendRPC( "RPC_PlayerManager", // Module name "HealPlayers", // Function name new Param1>(playerIds), // Parameters true, // Guaranteed delivery null, // Target identity (null = server) null // Target object ); // Server to Client RPC GetRPCManager().VSendRPC( "RPC_MenuPlayerManager", // Client-side module "HandlePlayerStats", // Client function new Param1(stats), true, // Guaranteed sender // Target client identity ); // Register new RPC handlers in your plugin constructor GetRPCManager().AddRPC( "RPC_MyModule", // Module name "MyFunction", // Function to call this, // Instance SingleplayerExecutionType.Server // Execution context ); ``` -------------------------------- ### Configure Webhook Endpoints Source: https://context7.com/vanillaplusplus/vpp-admin-tools/llms.txt Create and register new webhook configurations to receive specific message types. ```cpp // Create a new webhook configuration WebHook newHook = new WebHook(); newHook.SetName("Discord Admin Log"); newHook.SetURL("https://discord.com/api/webhooks/your-webhook-url"); newHook.SetMessageTypes({ AdminActivityMessage, KillDeathMessage, JoinLeaveMessage }); GetRPCManager().VSendRPC( "RPC_WebHooksManager", "CreateWebHooks", new Param1(newHook), true ); ``` -------------------------------- ### Add New Teleport Preset Source: https://context7.com/vanillaplusplus/vpp-admin-tools/llms.txt Creates a new teleport location preset with a given name and world coordinates. Presets are saved to a JSON file in the VPPAdminTools configuration directory. ```cpp // Add a new teleport preset string presetName = "MyBase"; vector position = Vector(5000.0, 200.0, 8000.0); GetRPCManager().VSendRPC( "RPC_TeleportManager", "AddNewPreset", new Param2(presetName, position), true ); // Presets are saved to: /VPPAdminTools/ConfigurablePlugins/TeleportManager/TeleportLocation.json ``` -------------------------------- ### Manage User Groups via RPC Source: https://context7.com/vanillaplusplus/vpp-admin-tools/llms.txt Create groups, add members, and update permissions using remote procedure calls. ```cpp // Remote creation of a new user group // Client sends: GetRPCManager().VSendRPC("RPC_PermissionManager", "RemoteCreateUserGroup", // new Param1("Moderators"), true); // Adding users to a group // map format: Steam64ID -> Username map newMembers = new map; newMembers.Insert("76561198420222029", "PlayerName"); newMembers.Insert("76561198321354754", "AnotherPlayer"); GetRPCManager().VSendRPC( "RPC_PermissionManager", "RemoteAddUsersToGroup", new Param2, string>(newMembers, "Moderators"), true ); // Update group permissions array permissions = { "MenuPlayerManager", "PlayerManager:KickPlayer", "PlayerManager:HealPlayers", "MenuTeleportManager", "TeleportManager:TPSelf" }; GetRPCManager().VSendRPC( "RPC_PermissionManager", "RemoteUpdateGroupPerms", new Param2, string>(permissions, "Moderators"), true ); ``` -------------------------------- ### Spawn Items via RPC Source: https://context7.com/vanillaplusplus/vpp-admin-tools/llms.txt Configures and sends an RPC request to spawn items into player inventories, on the ground, or at a crosshair position. ```cpp // Item spawn parameters // placementType: 0 = IN_INVENTORY, 1 = ON_GROUND, 2 = AT_CROSSHAIR // condition: 0 = PRISTINE, 1 = WORN, 2 = DAMAGED, 3 = BADLY_DAMAGED, 4 = RUINED ItemSpawnParams params = new ItemSpawnParams(); params.presetName = "AKM"; // Item class name params.placementType = 0; // IN_INVENTORY params.condition = 0; // PRISTINE params.quantity = 1; // Quantity/stack size params.useCEDef = true; // Use Central Economy defaults params.targets = {"76561198420222029"}; // Target player IDs (empty = self) params.position = Vector(0, 0, 0); // Position for AT_CROSSHAIR GetRPCManager().VSendRPC( "RPC_VPPItemManager", "SpawnItem", new Param1(params), true ); // Spawn at crosshair (self only) params.placementType = 2; // AT_CROSSHAIR params.targets = null; params.position = crosshairWorldPos; ``` -------------------------------- ### Manage Weather Presets Source: https://context7.com/vanillaplusplus/vpp-admin-tools/llms.txt Saves specific weather configurations as named presets and applies them to the server. ```cpp // Save a weather preset array overcast = {0.9, 0.01, 300.0}; array fog = {0.5, 0.01, 300.0}; array rain = {0.7, 0.02, 600.0}; float wind = 20.0; string presetName = "Stormy Weather"; GetRPCManager().VSendRPC( "RPC_WeatherManager", "AddWeatherSettingToServer", new Param5, array, array, float, string>( overcast, fog, rain, wind, presetName ), true ); // Apply a saved preset by name GetRPCManager().VSendRPC( "RPC_WeatherManager", "ApplyPreset", new Param1("Stormy Weather"), true ); ``` -------------------------------- ### Item Preset Spawning API Source: https://context7.com/vanillaplusplus/vpp-admin-tools/llms.txt Allows spawning of complete item sets, including parent items and their attachments, as predefined presets. ```APIDOC ## POST /rpc/VPPItemManager/RemoteSpawnPreset ### Description Spawns a complete item preset, which can include a parent item and all its attachments. ### Method POST ### Endpoint /rpc/VPPItemManager/RemoteSpawnPreset ### Parameters #### Request Body - **presetName** (string) - Required - The name of the item preset to spawn (e.g., "Black Camo AKM"). - **placementType** (integer) - Optional - Specifies where the item should be placed: 0 = IN_INVENTORY, 1 = ON_GROUND, 2 = AT_CROSSHAIR. Defaults to IN_INVENTORY if not specified. - **condition** (integer) - Optional - The condition of the spawned items: 0 = PRISTINE, 1 = WORN, 2 = DAMAGED, 3 = BADLY_DAMAGED, 4 = RUINED. - **targets** (array of strings) - Optional - Player Steam IDs to target. If empty or null, targets the calling player. ### Request Example ```json { "presetName": "Black Camo AKM", "placementType": 0, "targets": null } ``` ### Response #### Success Response (200) Indicates the RPC call was successfully processed. Specific return data may vary. #### Response Example ```json { "success": true } ``` ``` -------------------------------- ### Apply Weather Conditions Source: https://context7.com/vanillaplusplus/vpp-admin-tools/llms.txt Modifies server weather parameters including overcast, fog, rain, and wind speed via RPC. ```cpp // Weather parameters: [actual_value, rate_of_change, duration] // Values range from 0.0 to 1.0 for weather, wind in m/s array overcast = {0.8, 0.01, 300.0}; // Heavy clouds array fog = {0.3, 0.01, 300.0}; // Light fog array rain = {0.5, 0.02, 600.0}; // Moderate rain float wind = 15.0; // Wind speed m/s GetRPCManager().VSendRPC( "RPC_WeatherManager", "ApplyWeather", new Param4, array, array, float>(overcast, fog, rain, wind), true ); // Clear weather example: array clearOvercast = {0.0, 0.05, 60.0}; array noFog = {0.0, 0.05, 60.0}; array noRain = {0.0, 0.05, 60.0}; float calmWind = 2.0; ``` -------------------------------- ### Register Custom Chat Commands Source: https://context7.com/vanillaplusplus/vpp-admin-tools/llms.txt Extend functionality by creating a class inheriting from ChatCommand and registering it in the ChatCommandManager. ```cpp // Create a custom chat command module class MyCustomChatModule : ChatCommand { void MyCustomChatModule() { // Command string, min arguments, permission name, targets players ChatCommand("/mycommand", 1, "Chat:MyCommand", true); } override void ExecuteCommand(PlayerBase caller, array targets, array args) { foreach(Man target : targets) { PlayerBase player = PlayerBase.Cast(target); // Execute command logic on each target DoSomething(player, args); } } } // Register in ChatCommandManager OnInit override void OnInit() { super.OnInit(); AddChatCommand(new MyCustomChatModule()); } ``` -------------------------------- ### Spawn Item Presets Source: https://context7.com/vanillaplusplus/vpp-admin-tools/llms.txt Spawns complex item sets, such as vehicles or fully equipped weapons, using predefined presets. ```cpp // Create and spawn item presets (e.g., fully equipped vehicle or weapon) // Presets include a parent item and all attachments ItemSpawnParams presetParams = new ItemSpawnParams(); presetParams.presetName = "Black Camo AKM"; // Preset name presetParams.placementType = 0; // IN_INVENTORY presetParams.condition = 0; // PRISTINE presetParams.targets = null; // Self GetRPCManager().VSendRPC( "RPC_VPPItemManager", "RemoteSpawnPreset", new Param1(presetParams), true ); // Default presets include: // - "Civilian Sedan Car": Full vehicle with all parts // - "Black Camo AKM": Weapon with suppressor, stock, optic, magazine ``` -------------------------------- ### Manage Server Bans Source: https://context7.com/vanillaplusplus/vpp-admin-tools/llms.txt Create ban entries and check ban status using the BansManager. Adding a ban entry will automatically kick the player if they are currently online. ```cpp // Create a ban entry BanDuration duration = new BanDuration( 2025, // Year 12, // Month 31, // Day 23, // Hour 59, // Minute false // Not permanent (set true for permanent ban) ); string issuerInfo = string.Format("%1|%2", adminName, adminSteamId); BannedPlayer banEntry = new BannedPlayer( "PlayerName", // Player's name "76561198420222029", // Steam64 ID "hashedGUID", // Player GUID duration, // Ban duration issuerInfo, // Who issued the ban "Cheating detected" // Ban reason ); // Add to ban list (kicks player immediately if online) bool success = GetBansManager().AddToBanList(banEntry); // Check if player is banned bool isBanned = GetBansManager().IsPlayerBanned("76561198420222029"); ``` -------------------------------- ### Item Spawning API Source: https://context7.com/vanillaplusplus/vpp-admin-tools/llms.txt Provides functionality to spawn items into player inventories, onto the ground, or at the player's crosshair position. ```APIDOC ## POST /rpc/VPPItemManager/SpawnItem ### Description Spawns items into player inventories, on the ground, or at the crosshair position. ### Method POST ### Endpoint /rpc/VPPItemManager/SpawnItem ### Parameters #### Request Body - **presetName** (string) - Required - The class name or preset name of the item to spawn. - **placementType** (integer) - Required - Specifies where the item should be placed: 0 = IN_INVENTORY, 1 = ON_GROUND, 2 = AT_CROSSHAIR. - **condition** (integer) - Optional - The condition of the spawned item: 0 = PRISTINE, 1 = WORN, 2 = DAMAGED, 3 = BADLY_DAMAGED, 4 = RUINED. - **quantity** (integer) - Optional - The stack size or quantity of the item. - **useCEDef** (boolean) - Optional - Whether to use Central Economy defaults. - **targets** (array of strings) - Optional - Player Steam IDs to target. If empty or null, targets the calling player. - **position** (object) - Required for AT_CROSSHAIR placement - The world position for the item. - **x** (float) - X coordinate. - **y** (float) - Y coordinate. - **z** (float) - Z coordinate. ### Request Example ```json { "presetName": "AKM", "placementType": 0, "condition": 0, "quantity": 1, "useCEDef": true, "targets": ["76561198420222029"] } ``` ### Response #### Success Response (200) Indicates the RPC call was successfully processed. Specific return data may vary. #### Response Example ```json { "success": true } ``` ``` -------------------------------- ### Request Server Restart Source: https://context7.com/vanillaplusplus/vpp-admin-tools/llms.txt Initiates a timed server restart with a countdown. Players receive notifications until the countdown reaches zero. ```cpp // Request server restart with countdown (in seconds) int countdownSeconds = 300; // 5 minute warning GetRPCManager().VSendRPC( "RPC_ServerManager", "RequestRestartServer", new Param1(countdownSeconds), true ); // Players receive countdown notifications every second // Server disconnects all sessions when countdown reaches 0 ``` -------------------------------- ### Manage Custom Item Presets Source: https://context7.com/vanillaplusplus/vpp-admin-tools/llms.txt Registers new item presets and updates existing ones with specific child items or attachments. ```cpp // Create a new item preset string presetName = "Survival Kit"; GetRPCManager().VSendRPC( "RPC_VPPItemManager", "AddPreset", new Param1(presetName), true ); // Edit preset to add items PresetItemData preset = new PresetItemData( "Survival Kit", // Display name "MountainBag_Green", // Parent item class { // Child items/attachments "SodaCan_Cola", "TunaCan", "HuntingKnife", "Compass", "Map" } ); GetRPCManager().VSendRPC( "RPC_VPPItemManager", "EditPreset", new Param1(preset), true ); ``` -------------------------------- ### Player Management API Source: https://context7.com/vanillaplusplus/vpp-admin-tools/llms.txt API endpoints for managing player states such as godmode, spectating, and freezing. ```APIDOC ## ToggleGodmode and GiveGodmode ### Description Enable or disable invincibility for admins or other players. ### Method RPC Call ### Endpoint RPC_PlayerManager ### Parameters #### Request Body - **targetPlayerId** (string) - Optional - The ID of the player to affect. If null, affects the admin making the call. - **enable** (boolean) - Required - True to enable godmode, false to disable. ### Request Example ```cpp // Toggle godmode for yourself (admin) GetRPCManager().VSendRPC("RPC_PlayerManager", "ToggleGodmode", null, true); // Give/revoke godmode to another player string targetPlayerId = "76561198420222029"; GetRPCManager().VSendRPC("RPC_PlayerManager", "GiveGodmode", new Param1(targetPlayerId), true); ``` ### Response Godmode state is toggled for the specified player. ### Note Godmode persists until toggled off or player disconnects. ``` ```APIDOC ## SpectatePlayer ### Description Enter spectator mode to observe another player's gameplay. ### Method RPC Call ### Endpoint RPC_PlayerManager ### Parameters #### Request Body - **targetId** (string) - Required - The ID of the player to spectate. ### Request Example ```cpp string targetId = "76561198420222029"; GetRPCManager().VSendRPC("RPC_PlayerManager", "SpectatePlayer", new Param1(targetId), true); ``` ### Response The admin's character is deleted and they enter a spectate camera following the target player's movements and actions. ### Note Cannot spectate yourself - returns an error. ``` ```APIDOC ## FreezePlayers ### Description Immobilize players by disabling their movement controls. ### Method RPC Call ### Endpoint RPC_PlayerManager ### Parameters #### Request Body - **playerIds** (array) - Required - An array of player IDs to freeze or unfreeze. ### Request Example ```cpp array playerIds = {"76561198420222029", "76561198321354754"}; GetRPCManager().VSendRPC("RPC_PlayerManager", "FreezePlayers", new Param1>(playerIds), true); ``` ### Response Toggles the freeze state for the specified players. Frozen players cannot move but can still look around. ### Note Call again with the same player IDs to unfreeze them. ``` ```APIDOC ## GotoPlayer, BringPlayer, and ReturnPlayer ### Description Navigate between players with position memory for return trips. ### Method RPC Call ### Endpoint RPC_PlayerManager ### Parameters #### Request Body - **teleportType** (VPPAT_TeleportType) - Required - The type of teleportation action (GOTO, BRING, RETURN). - **targets** (array) - Required - An array of player IDs to perform the action on. ### Request Example ```cpp // Go to another player's location array targets = {"76561198420222029"}; GetRPCManager().VSendRPC("RPC_PlayerManager", "TeleportHandle", new Param2>(VPPAT_TeleportType.GOTO, targets), true); // Bring a player to your location GetRPCManager().VSendRPC("RPC_PlayerManager", "TeleportHandle", new Param2>(VPPAT_TeleportType.BRING, targets), true); // Return a player to their previous position GetRPCManager().VSendRPC("RPC_PlayerManager", "TeleportHandle", new Param2>(VPPAT_TeleportType.RETURN, targets), true); ``` ### Note VPPAT_TeleportType enum: GOTO, BRING, RETURN. ``` -------------------------------- ### Custom Item Preset Management API Source: https://context7.com/vanillaplusplus/vpp-admin-tools/llms.txt Enables the creation and editing of custom item presets for streamlined spawning of item configurations. ```APIDOC ## POST /rpc/VPPItemManager/AddPreset ### Description Creates a new custom item preset. ### Method POST ### Endpoint /rpc/VPPItemManager/AddPreset ### Parameters #### Request Body - **presetName** (string) - Required - The name for the new custom preset. ### Request Example ```json { "presetName": "Survival Kit" } ``` ## POST /rpc/VPPItemManager/EditPreset ### Description Edits an existing custom item preset by defining its parent item and child items/attachments. ### Method POST ### Endpoint /rpc/VPPItemManager/EditPreset ### Parameters #### Request Body - **presetData** (object) - Required - Data for the preset. - **displayName** (string) - Required - The display name of the preset. - **parentItem** (string) - Required - The class name of the parent item. - **childItems** (array of strings) - Required - An array of class names for child items or attachments. ### Request Example ```json { "presetData": { "displayName": "Survival Kit", "parentItem": "MountainBag_Green", "childItems": [ "SodaCan_Cola", "TunaCan", "HuntingKnife", "Compass", "Map" ] } } ``` ### Response #### Success Response (200) Indicates the RPC call was successfully processed. Specific return data may vary. #### Response Example ```json { "success": true } ``` ``` -------------------------------- ### Verify User Permissions Source: https://context7.com/vanillaplusplus/vpp-admin-tools/llms.txt Use the VerifyPermission function to check if a user is authorized to perform specific administrative actions. ```cpp // Permission verification with target checking // Returns true if the action is authorized // Basic permission check (no target) bool canAccessMenu = GetPermissionManager().VerifyPermission( sender.GetPlainId(), // Steam64 ID of the requesting admin "MenuPlayerManager", // Permission name to check "", // Target ID (empty = self/no target) true // Send notification on rejection (default: true) ); // Permission check with target player bool canKickPlayer = GetPermissionManager().VerifyPermission( sender.GetPlainId(), // Admin's Steam64 ID "PlayerManager:KickPlayer", // Specific action permission targetPlayer.GetPlainId() // Target player's Steam64 ID ); // Silent permission check (no notification on rejection) bool hasPermission = GetPermissionManager().VerifyPermission( adminId, "TeleportManager:ViewPlayerPositions", "", false // Don't notify on rejection ); // Permission hierarchy ensures lower-level admins cannot target higher-level ones // Super Admins bypass all permission checks ``` -------------------------------- ### Post Webhook Notifications Source: https://context7.com/vanillaplusplus/vpp-admin-tools/llms.txt Send administrative activity logs to external services using the WebHooksManager. ```cpp // Post admin activity to configured webhooks GetWebHooksManager().PostData( AdminActivityMessage, new AdminActivityMessage( sender.GetPlainId(), // Admin Steam64 ID sender.GetName(), // Admin name "[PlayerManager] Kicked 5 player(s)" // Activity description ) ); ``` -------------------------------- ### Kick Player via RPC Source: https://context7.com/vanillaplusplus/vpp-admin-tools/llms.txt Remove players from the server with a specified reason. ```cpp // Kick multiple players with a reason array playerIds = {"76561198420222029"}; string kickReason = "Violation of server rules"; GetRPCManager().VSendRPC( "RPC_PlayerManager", "KickPlayer", new Param2, string>(playerIds, kickReason), true ); ``` -------------------------------- ### Weather Control API Source: https://context7.com/vanillaplusplus/vpp-admin-tools/llms.txt Allows dynamic modification of server weather conditions, including overcast, fog, rain, and wind. ```APIDOC ## POST /rpc/WeatherManager/ApplyWeather ### Description Dynamically modifies server weather conditions. ### Method POST ### Endpoint /rpc/WeatherManager/ApplyWeather ### Parameters #### Request Body - **overcast** (array of floats) - Required - [actual_value, rate_of_change, duration]. Values range from 0.0 to 1.0. - **fog** (array of floats) - Required - [actual_value, rate_of_change, duration]. Values range from 0.0 to 1.0. - **rain** (array of floats) - Required - [actual_value, rate_of_change, duration]. Values range from 0.0 to 1.0. - **wind** (float) - Required - Wind speed in m/s. ### Request Example ```json { "overcast": [0.8, 0.01, 300.0], "fog": [0.3, 0.01, 300.0], "rain": [0.5, 0.02, 600.0], "wind": 15.0 } ``` ### Response #### Success Response (200) Indicates the RPC call was successfully processed. Specific return data may vary. #### Response Example ```json { "success": true } ``` ``` -------------------------------- ### Teleport Players to Town Preset Source: https://context7.com/vanillaplusplus/vpp-admin-tools/llms.txt Teleports specified players to predefined town locations. Uses a town name and an empty vector for position. ```cpp // Teleport yourself to a saved location array ids = {"self"}; string townName = "Cherno"; vector emptyPos = Vector(0, 0, 0); GetRPCManager().VSendRPC( "RPC_TeleportManager", "RemoteTeleportPlayers", new Param3, string, vector>(ids, townName, emptyPos), true ); // Teleport other players to a location array targetIds = {"76561198420222029"}; GetRPCManager().VSendRPC( "RPC_TeleportManager", "RemoteTeleportPlayers", new Param3, string, vector>(targetIds, "NWAF", emptyPos), true ); // Default preset locations include: // Cherno, Elektro, Berez, Severograd, NWAF, NEAF, Tisy, etc. ``` -------------------------------- ### Execute Built-in Chat Commands Source: https://context7.com/vanillaplusplus/vpp-admin-tools/llms.txt Administrative actions can be performed via chat commands using specific target identifiers or coordinates. ```text // Chat command format: /command target,target2 or /command argument // Player-targeted commands (target by name, "self", or "all"): /kill PlayerName // Kill a player /heal PlayerName // Heal a player /strip PlayerName // Remove all items from player /bring PlayerName // Teleport player to you /goto PlayerName // Teleport to player /return PlayerName // Return player to previous position // Teleport commands: /tpt Cherno // Teleport to town preset /tpp 5000,200,8000 // Teleport to coordinates (x,y,z) // Spawn commands: /spi AKM // Spawn in inventory /sph Canteen // Spawn in hands /spg TentLarge // Spawn on ground /ammo // Spawn ammo for current weapon /spawncar // Spawn a random vehicle // Utility commands: /refuel // Refuel current vehicle /unban 76561198420222029 // Unban a player by Steam64 ID ``` -------------------------------- ### Weather Preset Management API Source: https://context7.com/vanillaplusplus/vpp-admin-tools/llms.txt Enables saving and applying weather configurations as named presets. ```APIDOC ## POST /rpc/WeatherManager/AddWeatherSettingToServer ### Description Saves the current weather configuration as a named preset on the server. ### Method POST ### Endpoint /rpc/WeatherManager/AddWeatherSettingToServer ### Parameters #### Request Body - **overcast** (array of floats) - Required - [actual_value, rate_of_change, duration]. Values range from 0.0 to 1.0. - **fog** (array of floats) - Required - [actual_value, rate_of_change, duration]. Values range from 0.0 to 1.0. - **rain** (array of floats) - Required - [actual_value, rate_of_change, duration]. Values range from 0.0 to 1.0. - **wind** (float) - Required - Wind speed in m/s. - **presetName** (string) - Required - The name for the weather preset. ### Request Example ```json { "overcast": [0.9, 0.01, 300.0], "fog": [0.5, 0.01, 300.0], "rain": [0.7, 0.02, 600.0], "wind": 20.0, "presetName": "Stormy Weather" } ``` ## POST /rpc/WeatherManager/ApplyPreset ### Description Applies a previously saved weather preset. ### Method POST ### Endpoint /rpc/WeatherManager/ApplyPreset ### Parameters #### Request Body - **presetName** (string) - Required - The name of the weather preset to apply. ### Request Example ```json { "presetName": "Stormy Weather" } ``` ### Response #### Success Response (200) Indicates the RPC call was successfully processed. Specific return data may vary. #### Response Example ```json { "success": true } ``` ``` -------------------------------- ### RPC_ServerManager: RequestRestartServer Source: https://context7.com/vanillaplusplus/vpp-admin-tools/llms.txt Initiates a timed server restart with player notifications. ```APIDOC ## RPC_ServerManager: RequestRestartServer ### Description Initiate a timed server restart with player notifications. Players receive countdown notifications every second, and the server disconnects all sessions when the countdown reaches 0. ### Method RPC (Remote Procedure Call) ### Parameters #### Request Body - **countdownSeconds** (int) - Required - The duration in seconds until the server restarts. ### Request Example GetRPCManager().VSendRPC("RPC_ServerManager", "RequestRestartServer", new Param1(300), true); ``` -------------------------------- ### Chat Commands API Source: https://context7.com/vanillaplusplus/vpp-admin-tools/llms.txt API for executing built-in administrative chat commands and registering custom chat command modules. ```APIDOC ## AddChatCommand ### Description Registers a custom chat command module to extend the server's chat functionality. ### Method Class Override ### Parameters - **commandModule** (ChatCommand) - Required - An instance of a class inheriting from ChatCommand. ``` -------------------------------- ### Set Player Stats via RPC Source: https://context7.com/vanillaplusplus/vpp-admin-tools/llms.txt Modify specific player statistics like health, blood, water, or energy. ```cpp // Set a specific stat for a player // Supported stat types: "Blood", "Health", "Shock", "Water", "Energy" float newValue = 5000.0; // Blood values: 0-5000 string targetId = "76561198420222029"; string statType = "Blood"; GetRPCManager().VSendRPC( "RPC_PlayerManager", "SetPlayerStats", new Param3(newValue, targetId, statType), true ); ``` -------------------------------- ### Register Custom Permission Types Source: https://context7.com/vanillaplusplus/vpp-admin-tools/llms.txt Extend the mod by registering new permission types within your plugin's constructor. ```cpp // Register custom permissions for your mod extension // Call this during your plugin's constructor void MyCustomPlugin() { // Register multiple permissions at once GetPermissionManager().AddPermissionType({ "MenuMyPlugin", // Menu access permission "MyPlugin:Action1", // Specific action permissions "MyPlugin:Action2", "MyPlugin:DangerousAction" }); } // Built-in permission categories: // - Menu permissions: "MenuPlayerManager", "MenuTeleportManager", etc. // - Action permissions: "PlayerManager:KickPlayer", "TeleportManager:TPSelf", etc. ``` -------------------------------- ### Ban Management API Source: https://context7.com/vanillaplusplus/vpp-admin-tools/llms.txt Methods for adding players to the ban list, checking ban status, and updating existing ban details. ```APIDOC ## AddToBanList ### Description Adds a player to the server ban list with a specified duration and reason. ### Method Internal Method ### Parameters - **banEntry** (BannedPlayer) - Required - The object containing player details, duration, and reason. ### Response - **success** (bool) - Returns true if the player was successfully added to the ban list. ``` ```APIDOC ## UpdateBanDuration ### Description Updates the duration of an existing ban for a list of players. ### Method RPC (BanManagerServer) ### Parameters - **playerIds** (array) - Required - List of Steam64 IDs. - **newDuration** (BanDuration) - Required - The new expiration date and time. ``` -------------------------------- ### Heal Players via RPC Source: https://context7.com/vanillaplusplus/vpp-admin-tools/llms.txt Server-side handler and client-side call for restoring player health and stats. ```cpp // Server-side RPC handler for healing players void HealPlayers(CallType type, ParamsReadContext ctx, PlayerIdentity sender, Object target) { if (type == CallType.Server) { Param1> data; if (!ctx.Read(data)) return; string adminID = sender.GetPlainId(); if (!GetPermissionManager().VerifyPermission(adminID, "PlayerManager:HealPlayers")) return; array playerIds = data.param1; foreach(string id : playerIds) { if (GetPermissionManager().VerifyPermission(adminID, "PlayerManager:HealPlayers", id)) { PlayerBase targetPlayer = GetPermissionManager().GetPlayerBaseByID(id); if (targetPlayer != null) { targetPlayer.VPPHealPlayer(); // Restores: Health, Blood, Shock, Water, Energy } } } } } // Client-side call to heal players array targets = {"76561198420222029", "76561198321354754"}; GetRPCManager().VSendRPC( "RPC_PlayerManager", "HealPlayers", new Param1>(targets), true ); ``` -------------------------------- ### Toggle Godmode for Self Source: https://context7.com/vanillaplusplus/vpp-admin-tools/llms.txt Toggles godmode for the admin executing the command. Godmode persists until toggled off or the player disconnects. ```cpp // Toggle godmode for yourself (admin) GetRPCManager().VSendRPC( "RPC_PlayerManager", "ToggleGodmode", null, true ); ``` -------------------------------- ### Request Kick All Players Source: https://context7.com/vanillaplusplus/vpp-admin-tools/llms.txt Removes all players from the server except the admin who initiated the request. ```cpp // Kick all players with reason string kickReason = "Server maintenance in progress"; GetRPCManager().VSendRPC( "RPC_ServerManager", "RequestKickAllPlayers", new Param1(kickReason), true ); // The requesting admin is excluded from the kick // All kicked players see the reason message ``` -------------------------------- ### Spectate Player Source: https://context7.com/vanillaplusplus/vpp-admin-tools/llms.txt Enters spectator mode to observe another player's gameplay using their ID. The admin's character is deleted and replaced with a spectator camera. Cannot spectate yourself. ```cpp // Start spectating a player string targetId = "76561198420222029"; GetRPCManager().VSendRPC( "RPC_PlayerManager", "SpectatePlayer", new Param1(targetId), true ); // The admin's character is deleted and they enter a spectate camera // Following the target player's movements and actions // Cannot spectate yourself - returns an error ``` -------------------------------- ### VerifyPermission Source: https://context7.com/vanillaplusplus/vpp-admin-tools/llms.txt Validates whether a user has authorization to perform specific administrative actions, supporting hierarchical checks and target-based validation. ```APIDOC ## VerifyPermission ### Description Validates if a user is authorized to perform a specific action. Supports checking against a target player and toggling rejection notifications. ### Method Function Call (C++) ### Parameters - **senderId** (string) - Required - Steam64 ID of the requesting admin. - **permissionName** (string) - Required - The permission string to validate (e.g., "MenuPlayerManager"). - **targetId** (string) - Optional - Steam64 ID of the target player, or empty string for non-target actions. - **notifyOnRejection** (bool) - Optional - Whether to send a notification to the user if access is denied (default: true). ### Response - **bool** - Returns true if the action is authorized, false otherwise. ``` -------------------------------- ### Update Ban Details Source: https://context7.com/vanillaplusplus/vpp-admin-tools/llms.txt Modify existing ban durations or reasons for specific players using RPC calls. ```cpp // Update ban duration for multiple players array playerIds = {"76561198420222029"}; BanDuration newDuration = new BanDuration(2024, 6, 15, 12, 0, false); GetRPCManager().VSendRPC( "BanManagerServer", "UpdateBanDuration", new Param2, ref BanDuration>(playerIds, newDuration), true ); // Update ban reason string newReason = "Updated: Multiple rule violations"; GetRPCManager().VSendRPC( "BanManagerServer", "UpdateBanReason", new Param2, string>(playerIds, newReason), true ); ``` -------------------------------- ### RPC_PermissionManager: RemoteCreateUserGroup Source: https://context7.com/vanillaplusplus/vpp-admin-tools/llms.txt Creates a new user group for delegating administrative powers. ```APIDOC ## RPC_PermissionManager: RemoteCreateUserGroup ### Description Creates a new user group on the server. ### Method RPC ### Endpoint RPC_PermissionManager:RemoteCreateUserGroup ### Parameters #### Request Body - **groupName** (string) - Required - The name of the group to create. ``` -------------------------------- ### Teleport Manager API Source: https://context7.com/vanillaplusplus/vpp-admin-tools/llms.txt API endpoints for teleporting players to predefined locations or specific coordinates. ```APIDOC ## TeleportToTown ### Description Teleports players to predefined location presets. ### Method RPC Call ### Endpoint RPC_TeleportManager ### Parameters #### Request Body - **ids** (array) - Required - Array of player IDs to teleport. Use `{"self"}` to teleport the admin. - **townName** (string) - Required - The name of the preset town location (e.g., "Cherno", "NWAF"). - **emptyPos** (vector) - Required - Must be `Vector(0, 0, 0)` for town teleports. ### Request Example ```cpp // Teleport yourself to a saved location array ids = {"self"}; string townName = "Cherno"; vector emptyPos = Vector(0, 0, 0); GetRPCManager().VSendRPC("RPC_TeleportManager", "RemoteTeleportPlayers", new Param3, string, vector>(ids, townName, emptyPos), true); // Teleport other players to a location array targetIds = {"76561198420222029"}; GetRPCManager().VSendRPC("RPC_TeleportManager", "RemoteTeleportPlayers", new Param3, string, vector>(targetIds, "NWAF", emptyPos), true); ``` ### Response Players are teleported to the specified town location. ### Note Default preset locations include: Cherno, Elektro, Berez, Severograd, NWAF, NEAF, Tisy, etc. ``` ```APIDOC ## TeleportToPosition ### Description Teleport players to specific world coordinates. ### Method RPC Call ### Endpoint RPC_TeleportManager ### Parameters #### Request Body - **ids** (array) - Required - Array of player IDs to teleport. Use `{"self"}` to teleport the admin. - **emptyName** (string) - Required - Must be an empty string `""` for coordinate teleports. - **targetPos** (vector) - Required - The target world coordinates (X, Y, Z). ### Request Example ```cpp // Teleport to exact coordinates array ids = {"self"}; string emptyName = ""; vector targetPos = Vector(8428.0, 106.75, 12767.1); GetRPCManager().VSendRPC("RPC_TeleportManager", "RemoteTeleportPlayers", new Param3, string, vector>(ids, emptyName, targetPos), true); // Teleport directly to crosshair position GetRPCManager().VSendRPC("RPC_TeleportManager", "TeleportToPosition", new Param1(crosshairPosition), true); ``` ### Response Players are teleported to the specified coordinates. ### Note Vehicles are teleported with the player if they're inside one. ``` ```APIDOC ## AddNewPreset ### Description Create new teleport location presets. ### Method RPC Call ### Endpoint RPC_TeleportManager ### Parameters #### Request Body - **presetName** (string) - Required - The name for the new teleport preset. - **position** (vector) - Required - The world coordinates (X, Y, Z) for the preset location. ### Request Example ```cpp string presetName = "MyBase"; vector position = Vector(5000.0, 200.0, 8000.0); GetRPCManager().VSendRPC("RPC_TeleportManager", "AddNewPreset", new Param2(presetName, position), true); ``` ### Response Adds a new location preset that can be used with the `TeleportToTown` function. ### Note Presets are saved to: `/VPPAdminTools/ConfigurablePlugins/TeleportManager/TeleportLocation.json`. ``` -------------------------------- ### AddPermissionType Source: https://context7.com/vanillaplusplus/vpp-admin-tools/llms.txt Registers new permission types to extend the mod with custom administrative actions. ```APIDOC ## AddPermissionType ### Description Registers new permission strings into the system, allowing them to be assigned to user groups and checked via VerifyPermission. ### Method Function Call (C++) ### Parameters - **permissions** (array of strings) - Required - A list of permission strings to register (e.g., ["MenuMyPlugin", "MyPlugin:Action1"]). ``` -------------------------------- ### RPC_ServerManager: RequestKickAllPlayers Source: https://context7.com/vanillaplusplus/vpp-admin-tools/llms.txt Removes all players from the server except the requesting admin. ```APIDOC ## RPC_ServerManager: RequestKickAllPlayers ### Description Remove all players from the server except the requesting admin. All kicked players receive the specified reason message. ### Method RPC (Remote Procedure Call) ### Parameters #### Request Body - **kickReason** (string) - Required - The message displayed to players upon being kicked. ### Request Example GetRPCManager().VSendRPC("RPC_ServerManager", "RequestKickAllPlayers", new Param1("Server maintenance in progress"), true); ``` -------------------------------- ### Check Super Admin Status Source: https://context7.com/vanillaplusplus/vpp-admin-tools/llms.txt Verify if a user has Super Admin privileges before executing sensitive operations. ```cpp // Check Super Admin status before allowing sensitive operations if (GetPermissionManager().IsSuperAdmin(sender.GetPlainId())) { // User is a Super Admin - allow unrestricted access ExecuteDangerousOperation(); } else { // Regular admin - perform normal permission checks if (GetPermissionManager().VerifyPermission(sender.GetPlainId(), "SpecialAction")) { ExecuteOperation(); } } ```