How to monetize your fivem server

hi, when using {hexid} nothing return…

1 Like

“Nothing return”…?
If you mean that the command does not get executed that is probably because you are not using the correct package settings:

Using {hexid} or {sid} requires you to enable “Only execute the command when the player is online” as shown above.

Hi, thanks for the reply.
When a purchase is made i run a database query to insert the purchase. Passing the variable hexid to the database return me the variable name and not the steam id. The server query id ok because the other variables are working fine

Show your code.

INSERT INTO online_shop (identifier, transactionId, time, date, email, ip, itemType, itemName, packageId, packageName, quantity, redeemed) VALUES (’{hexid}’, ‘{transaction}’, ‘{time}’, ‘{date}’, ‘{email}’, ‘{ip}’,‘car’, ‘veneno’, ‘{packageId}’, ‘{packageName}’, ‘{purchaseQuantity}’, ‘0’)

If you check the example in the main post carefully you would understand by yourself:

You pass {hexid} via tebex and tebex will execute a command on your fivem server. Using the passed parameters will allow you to get the required data just like the example above.

also tried with a command instead of a db query. in the payment history the command sent is “registerPurchese {hexid} tbx-91618621a58299-88329e car veneno 1”

Ok so “registerPurchese {hexid} tbx-91618621a58299-88329e car veneno 1” is your tebex command?
How do you receive that on your fivem server? Show the code of the command.

now it worked, but 20 minutes ago not. my code is

Tebex:
registerPurchase {hexid} {transaction} car veneno {purchaseQuantity}

Fivem:

RegisterCommand("registerPurchase", function(source, arg, rawCommand)

    

    local identifier = arg[1]

    local transactionId = arg[2]

    local itemType = arg[3]

    local itemName = arg[4]

    local quantity = arg[5]

    print("Pagamento Online Ricevuto!")

    MySQL.Async.execute(

        'INSERT INTO online_shop (identifier, transactionId, itemType, itemName, quantity, redeemed) VALUES (@identifier, @transactionId, @itemType, @itemName, @quantity, @redeemed)',

        {

            ['@identifier']   = identifier,

            ['@transactionId']   = transactionId,

            ['@itemType']   = itemType,

            ['@itemName']   = itemName,

            ['@quantity']   = quantity,

            ['@redeemed']   = "0",

        },

        function ()

        end

    )

end, true)

the resource im trying to use need the playerid ingame how i can get it ?

use {sid}

I doubt you have the latest fxserver since you use ‘tebex forcecheck’ which has been removed long time ago.

Another thing is to check your fivem launcher and verify if you’ve linked the correct cfx.re account to it.

Make sure it is a server-side command. Also enable restriction mode on that command.

1 Like

Et se que si quelqun a compris peut t’il me répondre et envoyer le code complet pour que la boutique soit fonctionnel , merci !

Good tutorial!!

Great tutorial. So glad CFX partnered with tebex!

Great explanation! thank you

I have this command set in a package:

/givemoney {id} cash 10000

when the players buys the package, the in game consoles says “No such command givemoney”

1 Like

hello can you help me please i can not get tebex to execute a command on my server please help you seem like you know what your doing ??

Could you share more details about your issue?

1 Like