NAT2K15 Development
DiscordStoreConfigGithubStatus Page
  • NAT2K15 Documentation
  • Paid Scripts
    • FiveM Framework
      • 💻Choose your hosting
        • 💻Windows Hosting
          • 🛢️MySQL Installation (xampp)
          • 🛢️MySQL Connection String
          • 👨‍💻Installing Framework
        • 🐧Linux Hosting
          • 🛢️MySQL Installation
          • 🛢️MySQL Connection String
          • 👨‍💻Installing Framework
        • 🎮Panel Hosting
      • 📋Framework Addons
        • FiveM Scoreboard
        • ☎️Framework 911 (paid)
        • 📲NPWD X Framework
          • 📋Editing NPWD Config
          • 🧠Installing npwd-framework
      • ✒️Change Logs
      • ✍️Developers Usage
        • Client Side Exports
        • Server Side Exports
      • ❌Frequent Issues
    • Personal Vehicle V2
      • Discord Bot Token
      • Installing Dependency
      • Editing the Config
    • FiveM Discord Whitelist
      • Discord Bot Token
      • Edit the config
  • FiveM vMenu Modification
  • FiveM Vehicle & Weapon Management System
    • Installing Dependency
    • Configuration Guide
  • FiveM Admin Zone
  • Paid Bots
    • Ticket Bot V2
      • 💻Windows Hosting Guide
        • 🛢️MySQL Installation (xampp)
        • 👨‍💻Installing Node.js
    • Multi Server Control
      • 💻Windows Hosting Guide
        • 👨‍💻Installing Node.js
        • 🚂Starting The Bot
Powered by GitBook
On this page

Was this helpful?

Edit on GitHub
  1. Paid Scripts
  2. FiveM Framework
  3. Developers Usage

Client Side Exports

This docs is fairly new does not have all of the export we provide please be patient while we slowly work on this.

PreviousDevelopers UsageNextServer Side Exports

Last updated 3 months ago

Was this helpful?

At the top of your client file. You will need to call the Framework's exports. This step is very crucial for all the exports to work properly.

Framework = exports["framework"]:getClientFunctions()    

The "framework" will be the folder name the FiveM owner has in its resource. We recommend making this option configurable as not all users will have the default folder called framework.

Framework.isPlayerLoadedIn()

This will check if the player is fully loaded in to a character. It will return either a false or true here is an example.

Citizen.CreateThread(function()
    while true do 
        Citizen.Wait(500)
        if Framework.isPlayerLoadedIn() then
            print("Player is loaded in")
        else 
            print("Player is not loaded in")
        end
    end
end)
Framework.getPlayer(Framework.serverId)

In the client side you can only request the clients data. We have disabled the option to allow you to request any users data as it should all be done on the server side. To simply request the data do

local player = Framework.getPlayer(Framework.serverId) 
print(json.encode(player)) -- this will print all of the users data

Here is an example of it working in a command

RegisterCommand("whatsmyname", function(source, args, message)
    local player = Framework.getPlayer(Framework.serverId)
    if(player) then
        TriggerEvent('chatMessage', "Your name is " .. player.char_name)
    else 
        TriggerEvent('chatMessage', "you are not loaded in via the framework")
    end
end)
Framework.getCurrentAop()

Will return the current AOP you have in the server. If the AOP is disabled in the framework it will return a nil value.

Command example
RegisterCommand("getcurrentaop", function(source, args, message) then
    local aop = Framework.getAop()
    if(aop) then    
        print("The current AOP is " .. aop)
    else 
        print("AOP has been disabled in the framework")
    end
end)
Framework.ShowInfo()

If you want to show text on the bottom left of the screen above the hud you can now simply do that with this export

RegisterCommand('showinfo', function(source, args, message) 
    Framework.ShowInfo("This is a test message")
end)

Framework.DisplayHelpText()

This export will display the message on the top left of your screen.

RegisterCommand('showhelp', function(source, args, message) 
    Framework.DisplayHelpText("I need help")
end)
Framework.setHealth()

Very simple export that will set the players health. It will set the clients health to the amount provided.

Framework.setHealth(100)
Framework.setArmor()

Very simple export that will set the players armor. It will set the clients armor to the amount provided.

Framework.setArmor(100)

✍️