[Release] TruckerJob v0.3 [UPDATE 29th January]

job.lua
TriggerServerEvent(‘Job:success’,currentMission[4])

server.lua
RegisterServerEvent(‘Job:success’)
AddEventHandler(‘Job:success’,function(price)
print("user_id = "…user_id)
– Get the players money amount
vRP.getUserId({source},function(user_id)
total = price;
– update player money amount
vRP.giveMoney(user_id,total)
end)
end)

  • Anyone knows whats wrong?

  • i want to use the triggerevent to sent the event to server.lua so it adds money to your “Wallet”

  • Trying to Convert it from ES to vRP

4 Likes

I’ve got the same problem :confused:
Any help please? :frowning:

can someone tell me why i only see a " armored van " blip on the map and there is nothing, that’s the only thing that truckingjob does on my server, any pointers?

i converted it now :wink:

The truckerjob itself works fine, but the payments didnt work. So i converted it into vRP,

Did you miss installing missiontext?

Very nice script.

But i can’t create new trailer mission, where i have done 1 mission, and from the finish destination to new destination with same truck.

i think same script from Delivery job -> [Release] GoPostal delivery job
but someone can give me code for how i can start new trailermission after finish destination, and new destination to drive from last destination ?

How do you get his money from there

Could u show how u solve problem tiwh vRP givemoney? I triel to make proxy and tunnel, but it doesnt work.

For FXServer or CFX?

CFX please. And also u can show for FXServer for future, maybe another users want to solve this problem too.

1 Like

You have to translate it from danish then.

CFX
__resource.lua

server_script "server.lua"

client_script "truckerjob.lua"

CFX
server.lua

local Tunnel = require("resources/vrp/lib/Tunnel")
local Proxy = require("resources/vrp/lib/Proxy")

vRP = Proxy.getInterface("vRP")
vRPclient = Tunnel.getInterface("vRP","vRP_truckerjob")

RegisterServerEvent('truckerJob:success') -- calls the event from client file
AddEventHandler('truckerJob:success', function(amount) -- handles the event
    local user_id = vRP.getUserId({source}) --get user id
	vRPclient.notify(source,{"Betaling ~g~"..amount.."DKK."}) -- notifies the player that they have been paid
    if vRP.giveMoney({user_id,amount}) then -- gives the money and the amount
    end
end)

FXServer
__resource.lua

dependency "vrp"

server_scripts{
	"@vrp/lib/utils.lua",
	"server.lua"
}

client_script "truckerjob.lua"

FXServer
server.lua

local Tunnel = module("vrp", "lib/Tunnel")
local Proxy = module("vrp", "lib/Proxy")
 
vRP = Proxy.getInterface("vRP")
vRPclient = Tunnel.getInterface("vRP","vRP_truckerJob")

RegisterServerEvent('truckerJob:success') -- calls the event from client file
AddEventHandler('truckerJob:success', function(amount) -- handles the event
    local user_id = vRP.getUserId({source})
	local player = vRP.getUserSource({user_id})
    vRP.giveMoney({user_id,amount})
    vRPclient.notify(player,{"Du blev betalt ~g~"..amount.."DKK."})
end)

CFX And FXServer!

in truckerjob.lua, replace or comment line 203 (by default)
MISSION.getMoney()
by
TriggerServerEvent(‘truckerJob:success’,currentMission[4])

then you are done.

  • minor update on FXServer server.lua
3 Likes

Works perfectly, thank you!

Dunwell can you help me

im not sure, but i can try.

Can you help and install it for trucks

Hm, download and follow instructions. If u need reward like money use this post [Release] TruckerJob v0.3 [UPDATE 29th January]

I can not find out of that money

just replace 203 line in truckerjob.lua

MISSION.getMoney()

by

TriggerServerEvent(‘truckerJob:success’,currentMission[4])

and follow instruction in message before. I dont know FXserver or CFX u using.

I am using fxserver Do you want to help me can not

So use instruction from link above for FXServer, and i think it will work. Cause i use CFX and it works.