CityRP Documentation Repository

core.plugins.xp-bar.sv_init

Functions

Servermeska.xpbar.hide(ply)Source ☍

Immediately hides the experience bar for a specified player. This function sends a network message to the client to hide the XP bar interface without any fade-out animation or transition effects. The function includes player validation to ensure the target is a valid entity before attempting to send the network message.

Parameters

  • plyanyPlayer The player entity for whom the XP bar should be hidden.
Servermeska.xpbar.show(ply, skill, expGained, currentExp, currentLevel, previousLevel, nextLevelExp)Source ☍

Displays an experience bar to a player with skill progression data. This function handles the display of XP gain notifications for all skills except the general skill. It calculates progress percentages and sends network data to the client for UI rendering. The function filters out the general skill and computes level progression metrics including experience within current level and progress toward next level.

Parameters

  • plyanyPlayer The player entity to display the XP bar for.
  • skillanystring The skill identifier (general will be ignored).
  • expGainedanynumber The amount of experience points gained in this event.
  • currentExpanynumber The player's total accumulated experience points.
  • currentLevelanynumber The player's current skill level.
  • previousLevelanynumber The player's previous skill level before this gain.
  • nextLevelExpanynumber The total experience required to reach the next level.