Live
Sphinkter reviewed Compost HelperSphinkter reviewed Better JackhammerSphinkter reviewed Extraction LooterCalvinRF reacted 👍 to Rage Cheating DetectionCalvinRF published Rage Cheating DetectionKhaled updated Recycler StationMayonnaiseScc published Porta-Potty / OuthouseSnaplatack reacted 😮 to Electric VehiclesRickySpanish updated PurgeFXFlecksel updated Rust Valley GPArox followed @WizlaVoodooLights updated MyTimedEventsVoodooLights published MyTimedEventsbadgyver updated The Day After TomorrowBrad Copp reacted 🚀 to Silent Shadows - Grimwood HollowTheGamingChurch published Silent Shadows - Haunted MansionTheGamingChurch published Silent Shadows - Haunted CemeteryTheGamingChurch published Silent Shadows - Quagknocker's Haunted AbodeTheGamingChurch published Silent Shadows - Grimwood HollowTheGamingChurch published Silent Shadows - Halloween Fair Safe ZoneJeffGoldblume followed @bigtexryderJeffGoldblume reacted 😮 to Radio StudioWrecks updated Skybase (Community Center)RickySpanish updated Escape RoomRickySpanish reacted 🔥 to LootFloatEM$Ø updated rPhonebadgyver updated Extractiondrifter reacted ❤️ to OverWatch HUD UIWrecks published OverWatch HUD UIWrecks updated Beast Master - (Aura & Effect Update)

Lang API

Khan★ 0.0 (0)v1.0.5Oxide
Lang API
Automatically translates rust item display names & descriptions to use in you're plugins
Description

Automatically translates rust item display names & descriptions to use in you're plugins.

Most Recent Update for Repo is 12-16-2021 at 1 pm ( Pacific Standard Time )

Features

  • No config!
  • Automatic language generations!
  • Supports All 30 Rust Native Translations!
  • Works With the latest GUIShop beta branch, StackModifier, and EasyResearch!
  • GitHub repository is updated when Facepunch updates which in return means as soon as your server is rebooted or you reload this plugin it will take effect!
  • // OnLangAPIFinished is called when LangAPI is finished processing
    private bool _isLangAPIReady;
    private void OnLangAPIFinished()
    {
      _isLangAPIReady = true;
    }
    
    // Added IsReady bool which will return true/false when your plugin is loaded to know if it's ready
    // Example usage below.
    private void OnServerInitialized()
    {
      if (LangAPI != null && LangAPI.IsLoaded)
        _isLangAPIReady = LangAPI.Call<bool>("IsReady");
    }
    
    //How to properly check valid displaynames when using custom item displaynames in plugins.
    //Example first hook call usage method expects item.DisplayName.english ( returns true or false )
    //Example second hook call usage method expects item.shortname, item.DisplayName.english, player.UserIDString
    string GetItemDisplayName(string shorname, string displayName, string userID)
    {
      if (LangAPI != null && LangAPI.Call<bool>("IsDefaultDisplayName", displayName))
      {
        return LangAPI.Call<string>("GetItemDisplayName", shorname, displayName, userID) ?? displayName;
      }
      return displayName;
    }
    
    
    //Example expects the item.shortname, item.displayName.english, player.UserIDString
    //Return type is string
    LangAPI.Call<string>("GetItemDisplayName", "rifle.ak", "Assault Rilfe", player.UserIDString)
    
    //Example expects the item.shortname, item.displayDescription.english, player.UserIDString
    //Return type is string
    LangAPI.Call<string>("GetItemDescription", "rifle.ak", "High damage machine rilfe", player.UserIDString)
     
    //Added a new API bool check to detect valid item display names.
    //Return type is bool
    LangAPI.Call<bool>("IsDefaultDisplayName", "Assault Rifle")
    
    // IsReady bool will return true/false when your plugin is loaded to know if it's ready
    LangAPI.Call<bool>("IsReady")
Sponsored
RCONtrol
RCONtrol

Command your Rust server. Live WebRCON console, performance and player monitoring, quick actions, groups and permissions, and plugin management.

Visit site ↗
Free
Download
Views1.1k
Downloads41
Purchases0
Rating★ 0.0
Version1.0.5
PlatformRust
CategoryPlugins
CompatibleOxide
Size5 KB
PublishedNov 30, 2021
UpdatedDec 23, 2021
✓ Reviewed for safety and integrity