[Release] Rookie4DEXP , Experience and Level Bar for user store in database

yeah, that definitely sounds like a better way of handling it.
i see what you mean, thank you for the explanation. Appreciate it

That’s a nice addon, thanks for release.

Thx Man :]

thank you too for taking the time using it :]

Nice little script there! :slight_smile:
Just wanted to explain something to you since your new to scripting you say.

Client Side
You don’t need to define source on client side.
Source only needs to be defined when your sending information from server to client.

TriggerEvent('rookie4dexp:addexp', 4)

This will always run on the client it is called from so you don’t need to define “source”.

Server Side
If your triggering a client even from the server, you have to define which client or clients you are sending it to:

Sending it back to the source:

TriggerClientEvent('rookie4dexp:addexp', source, 4)

Sending it to all clients

TriggerClientEvent('rookie4dexp:addexp', -1, 4)
2 Likes

Thank you very much for taking the time :smile:

1 Like

Hi i have some question if i want to add exp when player get paycheck how i can do?
sorry by English is very bad

Hello,

I want to add XP when you kill someone and if you are ingame for like 10 minutes, how can i do that?

hi, how can i add a credit from [ESX] Credit System when i get a level?

just make some variable to get player online time
if playeronlinetime > 10mn
then

TriggerEvent('rookie4dexp:addexp', 4)

this is on clientside

just find the code where it trigger the paycheck of player like salary month , Xplayer.addMoney(amount)
add under it

TriggerClientEvent('rookie4dexp:addexp', amount)

serverside

RegisterServerEvent(‘rookie4dexp:addonelevel’)

AddEventHandler(‘rookie4dexp:addonelevel’, function(currentlevel)

local _source = source

local xPlayer = ESX.GetPlayerFromId(_source)

    MySQL.Async.execute('UPDATE player_exp SET level = @level WHERE identifier = @identifier', {

  ['@identifier'] = xPlayer.identifier,

  ['@level'] = currentlevel + 1 

}, function (rowsChanged)
    local amount = 1000

    TriggerEvent("utk_c:addcredit", _source, amount)
end)

good work bro

i want i help i just tried the sql and ui is working perfect wheen i call the add exp nothing happens is this right

I want to give player an item when reaches a level how could I do this . Pls Help