TWH-Scripts
  • 👋Welcome!
  • About us
    • 🚀Vision, Mission & Focus
      • Vision
      • Mission
      • Focus
    • 💖Values
  • Team
    • 👋Meet the Team!
  • Collaborating
    • 🤝How we Work Together
  • Resources
    • 📄Script-Documentations
      • Addiction
      • Bankrob
      • BodyStatusText
      • Calendar-Rewards
      • Collect
      • Lumber & Mining Essentials
      • Collector's Conquest Bundle
        • Tradingcards
        • Boosterpacks
        • Tradingcard Upgrades
      • Custom Dates
      • Dispatch-System
      • Lawmen
      • Mapmarker
      • NPC-Guides
      • Oilcorp.
      • Processing
      • Promotion-Pass
      • Social-Level System
      • Social-Pass
      • Storage
    • 📂Open Source
    • 📝Useful Snippets and Info
      • Addiction and Metabolism
  • Services
    • 🛠️Custom Orders and Personalized Development Services
    • 📖Advanced Logging System
Powered by GitBook
On this page
  • Instruction manual
  • Installation
  1. Resources
  2. Script-Documentations

Social-Level System

Frameworks: VORP

Introducing the twh_social script, an innovative experience system for your RedM RP server. This script provides an engaging and customizable progression system that rewards players for their time and dedication in the game.

Key Features:

  1. Experience System Setup: Easily configure an experience system tailored to your server's unique needs.

  2. Customizable Progression: Players gain experience points by playing on your server, with the option for linear or custom leveling progress.

  3. User or Character-based Levels: Choose between per-user or per-character leveling to suit your gameplay preferences.

  4. Adjustable Experience Gain: Modify the experience points awarded based on time spent or distance traveled in-game.

  5. Optional Currency Rewards: Enable or disable the addition of in-game currency alongside experience points.

  6. Level-up Notifications: Notify players when they achieve a new level for a sense of accomplishment and progress.

  7. Player Level Command: Implement a command for players to easily view their current level.

  8. API Integration: Seamlessly access the 'getSocialLevel' API for extended functionality.

  9. Compatibility with syn_stable Supporter-System: Ensure smooth integration with existing systems.

Perk Developer Addon:

  1. Custom Perks: Create unique perks with specific level requirements to enhance player progression.

  2. API for Perk Management: Utilize the API to request current levels or add experience points.

  3. Database Integration: All perk experience is securely saved in the database for seamless tracking.

With the twh_social script, you can create a dynamic and captivating experience system that motivates players and adds depth to your RedM RP server. Customize the progression, rewards, and level requirements to suit your server's unique needs and give your players a sense of growth and achievement.

Initialization

--Clientside
local lvlAPI = exports['twh_social'].lvlAPI()



--Serverside
local lvlAPI = exports['twh_social'].lvlAPI_server()

Usage

Clientside

local perkLevel = lvlAPI.getPerkLevel(perk) -- "perk" is crafting for example
local socialLevel = lvlAPI.getSocialLevel() 
lvlAPI.addPerkExp(perk,exp) --increase exp amount of a specific perk
lvlAPI.removePerkExp(perk,exp) --remove exp amount of a specific perk

Serverside

local perkLevel = lvlAPI.getPerkLevel(source,perk) -- "perk" is crafting for example
local perkExp = lvlAPI.getPerkExp(source,perk)
local xpneededforLevelup = lvlAPI.getExpNeededForLevelup(source,perk)
local socialLevel = lvlAPI.getSocialLevel(source) 

lvlAPI.addPerkExp(source,perk,exp) --increase exp amount of a specific perk
lvlAPI.removePerkExp(source,perk,exp) --remove exp amount of a specific perk
lvlAPI.setPerkExp(source,perk,exp)

Instruction manual

Installation

Go into vorp_core and navigate to sv_loadusers.lua and add an additional parameter to the insert for new users that it looks like following

MySQL.insert("INSERT INTO users VALUES(?,?,?,?,?,?,?)", { identifier, "user", 0, 0, 0, Config.MaxCharacters, 0 })

Add following line to your server.cfg or ressource.cfg:

  • ensure twh_social

PreviousPromotion-PassNextSocial-Pass

Last updated 1 year ago

📄
TWH-Scripts | twh_social
Logo