Ark Utils

From Ark & Atlas Server API
Jump to: navigation, search

Go Back: Plugin_Development

Reference To Utils

ArkApi::GetApiUtils().

Functions

GetWorld

Returns a pointer to UWorld

ArkApi::GetApiUtils().GetWorld();

GetShooterGameMode

Returns a pointer to AShooterGameMode

ArkApi::GetApiUtils().GetShooterGameMode();

GetStatus

Returns the current server status

ArkApi::GetApiUtils().GetStatus();

SendServerMessage

Sends server message to the specific player

  • shooter_controller Player
  • msg_color Message color
  • msg Message
  • args Optional arguments
ArkApi::GetApiUtils().SendServerMessage(shooter_controller, FColorList::Green, L"Test Message: {}", L"Test arg");

SendNotification

Sends notification (on-screen message) to the specific player

  • shooter_controller Player
  • color Message color
  • display_scale Size of text
  • display_time Display time
  • icon Message icon (optional)
  • msg Message
  • args Optional arguments
ArkApi::GetApiUtils().SendNotification(shooter_controller, FColorList::Green, 1, 10, nullptr, L"Test Message: {}", L"Test arg");

SendChatMessage

Sends chat message to the specific player

  • shooter_controller Player
  • sender_name Name of the sender
  • msg_color Message color
  • msg Message
  • args Optional arguments
ArkApi::GetApiUtils().SendChatMessage(shooter_controller, L"Server Name", L"Test Message: {}", L"Test arg");

SendServerMessageToAll

Sends server message to all players

  • msg_color Message color
  • msg Message
  • args Optional arguments
ArkApi::GetApiUtils().SendServerMessageToAll(FColorList::Green, L"Test Message: {}", L"Test arg");

SendNotificationToAll

Sends notification (on-screen message) to all players

  • color Message color
  • display_scale Size of text
  • display_time Display time
  • icon Message icon (optional)
  • msg Message
  • args Optional arguments
ArkApi::GetApiUtils().SendNotificationToAll(FColorList::Green, 1, 10, nullptr, L"Test Message: {}", L"Test arg");

SendChatMessageToAll

Sends chat message to the specific player

  • shooter_controller Player
  • sender_name Name of the sender
  • msg_color Message color
  • msg Message
  • args Optional arguments
ArkApi::GetApiUtils().SendChatMessageToAll(shooter_controller, L"Server Name", L"Test Message: {}", L"Test arg");

GetSteamIdFromController

Returns Steam ID from player controller

  • shooter_controller Player
ArkApi::GetApiUtils().GetSteamIdFromController(shooter_controller);

FindPlayerFromSteamName

Finds player from the given steam name

  • steam_name Steam name

Pointer to AShooterPlayerController

AShooterPlayerController* shooter_controller = ArkApi::GetApiUtils().FindPlayerFromSteamName(L"SteamNameHere");

FindControllerFromCharacter

Finds player controller from the given player character

  • character Player character

Pointer to AShooterPlayerController

AShooterPlayerController* shooter_controller = ArkApi::GetApiUtils().FindControllerFromCharacter(aShooterCharacter);

FindPlayerFromCharacterName

Finds all matching players from the given character name

  • character_name Character name
  • search Type
  • full_match Will match the full length of the string if true
  • return Array of AShooterPlayerController*
TArray<AShooterPlayerController*> PlayerControllersArray = ArkApi::GetApiUtils().FindPlayerFromCharacterName(L"CharacterNameHere", ESearchCase::IgnoreCase, false);

GetCharacterName

Returns the character name of player

  • shooter_controller Player
ArkApi::GetApiUtils().GetCharacterName(shooter_controller);

GetSteamName

Returns the steam name of player

  • shooter_controller Player
ArkApi::GetApiUtils().GetSteamName(shooter_controller);

FindPlayerFromSteamId

Finds player from the given steam id

  • steam_id Steam id
  • return Pointer to AShooterPlayerController
AShooterPlayerController* shooter_controller = ArkApi::GetApiUtils().FindPlayerFromSteamId(steam_id);

SpawnDino

Spawns a dino near player or at specific coordinates

  • player Player. If null, random player will be chosen. At least one player should be on the map
  • blueprint Blueprint path
  • location Spawn position. If null, dino will be spawned near player
  • lvl Level of the dino
  • force_tame Force tame
  • neutered Neuter dino
  • return Spawned dino pointer or null
APrimalDinoCharacter* Dinosaur = ArkApi::GetApiUtils().SpawnDino(shooter_controller, L"Blueprint'/Game/PrimalEarth/Dinos/Ptero/Ptero_Character_BP.Ptero_Character_BP'", nullptr, 100, true, false);

IsRidingDino

Returns true if character is riding a dino, false otherwise

  • shooter_controller Player
ArkApi::GetApiUtils().IsRidingDino(shooter_controller);

GetRidingDino

Returns the dino the character is riding

  • shooter_controller Player
  • returns a pointer to APrimalDinoCharacter
APrimalDinoCharacter* Dinosaur = ArkApi::GetApiUtils().GetRidingDino(shooter_controller);

GetPosition

Returns the position of a player

  • shooter_controller Player
  • returns the position of the character in FVector
FVector Position = ArkApi::GetApiUtils().GetPosition(shooter_controller);

TeleportToPlayer

Teleport one player to another

  • me Player
  • him Other Player
  • check_for_dino If set true prevents players teleporting with dino's or teleporting to a player on a dino
  • max_dist Is the max distance the characters can be away from each other -1 is disabled
FVector Position = ArkApi::GetApiUtils().TeleportToPlayer(My_shooter_controller, Other_shooter_controller, false, -1);

TeleportToPos

Teleports player to the given position

  • shooter_controller Player
  • pos New position
FVector pos;
pos.X = 243214;
pos.Y = 5235235;
pos.Z = 432432;
ArkApi::GetApiUtils().TeleportToPos(shooter_controller, &pos);

GetInventoryItemCount

Counts a specific items quantity

  • shooter_controller Player
  • item_name The name of the item you want to count the quantity of
  • returns On success, the function returns amount of items player has. Returns -1 if the function has failed.
int ItemCount = ArkApi::GetApiUtils().GetInventoryItemCount(shooter_controller, L"Sword");

GetIPAddress

Returns IP address of player

  • shooter_controller Player
FString IPAddress = ArkApi::GetApiUtils().GetIPAddress(shooter_controller);

GetItemBlueprint

Returns blueprint from UPrimalItem

  • item a pointer to a UPrimalItem
FString ItemName = ArkApi::GetApiUtils().GetItemBlueprint(uPrimalItem);

IsPlayerDead

Returns true if player is dead, false otherwise

  • shooter_controller Player
if(ArkApi::GetApiUtils().IsPlayerDead(shooter_controller))
{
	//Is Dead
}

GetPlayerID

Returns player linked id

  • aPrimalCharacter character
uint64 PlayerID = ArkApi::GetApiUtils().GetPlayerID(aPrimalCharacter);

GetPlayerID

Returns player linked id

  • aController Player
uint64 PlayerID = ArkApi::GetApiUtils().GetPlayerID(aController);

GetSteamIDForPlayerID

Returns steam id from player linked id

  • player_id player linked id
uint64 SteamID = ArkApi::GetApiUtils().GetSteamIDForPlayerID(player_id);

Go Back: Plugin_Development