[Release] vRP Framework

Watch your commas. I was able to get the code you provided working by simply adding a single comma. Where you ask? When you add a garage, it needs to have a comma at the end to indicate another garage is in the list, for the most part you had it right, but your bankdriver garage does not have an ending comma to indicate that the final garage BikeToGo is also present. So your code:

[“bankdriver”] = {
_config = {vtype=“car”,blipid=67,blipcolor=4,permissions={“bankdriver.vehicle”}},
[“stockade”] = {“stockade”,0, “stockade”}
}

Should instead be:

[“bankdriver”] = {
_config = {vtype=“car”,blipid=67,blipcolor=4,permissions={“bankdriver.vehicle”}},
[“stockade”] = {“stockade”,0, “stockade”}
},

Make sure to watch out for this when adding new garages to the end of your list! I don’t see anything with your groups.lua, but I also have not implemented whitelisting, so am not sure if you need a:

_config = { gtype = “job”,

Under the cop, ems, or moderator jobs or not

Thanks m8 I really appreciate the help <3 @Guidion

hy how do you manage to make it work?

is it possible that you could help me out?? seems to have some trouble making the garage into using the cardealer script and remove the garages so you buy there… but so you acctually just get you car from the garage??

what Fxserver build does this use?

Hi, I have a problem, when using the animation to sit, the character hangs in the air for 1 meter. Configuration did not change, but as I understood the problem in the file resources\vrp\client\base.lua

Where do i get creditcards for the hacker job??

Police and medic’s can’t take calls any idea what i fucked up?

Hey, is there anyone that knows how to change the currency from $ to another thing like € or £ ??

Im hosting a server via Zap Hosting, when i start the server with vRP i get this message ‘‘connection vRP not found’’ and when I join the server vRP doesn’t work. Please help <3

make sure u have configured vrp properly by going to vrp/cfg/base and entered the sql information there.

Server stack trace:
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR (System.Int32 errorCode) [0x0000a] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0
at (wrapper cominterop) CitizenFX.Core.IScriptHost:OpenHostFile (string)
at (wrapper cominterop-invoke) CitizenFX.Core.IScriptHost:OpenHostFile (string)
at CitizenFX.Core.MonoScriptRuntime+WrapScriptHost.OpenHostFile (System.String fileName) [0x00000] in C:\gl\builds\4ff63adb\0\cfx\fivem\code\client\clrcore\MonoScriptRuntime.cs:254
at (wrapper remoting-invoke-with-check) CitizenFX.Core.MonoScriptRuntime+WrapScriptHost:OpenHostFile (string)
at (wrapper xdomain-dispatch) CitizenFX.Core.MonoScriptRuntime+WrapScriptHost:OpenHostFile (object,byte[]&,byte[]&,string)

Exception rethrown at [0]:
at (wrapper xdomain-invoke) CitizenFX.Core.MonoScriptRuntime+WrapScriptHost:OpenHostFile (string)
at CitizenFX.Core.InternalManager.LoadAssembly (System.String name) [0x00000] in C:\gl\builds\4ff63adb\0\cfx\fivem\code\client\clrcore\InternalManager.cs:112
[vRP/C#] Load MySQL app.
Instantiated instance of script vRP.MySQL.
Started resource vrp_mysql
Error loading script base.lua in resource vrp: lib/utils.lua:13: bad argument #1 to ‘load’ (function expected, got nil)
stack traceback:
[C]: in function ‘load’
lib/utils.lua:13: in function ‘module’
base.lua:1: in main chunk
Failed to load script base.lua.
Error loading script modules/gui.lua in resource vrp: modules/gui.lua:14: attempt to index a nil value (global ‘vRP’)
stack traceback:
modules/gui.lua:14: in main chunk
Failed to load script modules/gui.lua.
Error loading script modules/group.lua in resource vrp: modules/group.lua:15: attempt to index a nil value (global ‘vRP’)
stack traceback:
modules/group.lua:15: in main chunk
Failed to load script modules/group.lua.
Error loading script modules/admin.lua in resource vrp: modules/admin.lua:291: attempt to index a nil value (global ‘vRP’)
stack traceback:
modules/admin.lua:291: in main chunk
Failed to load script modules/admin.lua.
Error loading script modules/survival.lua in resource vrp: modules/survival.lua:2: attempt to index a nil value (global ‘vRP’)
stack traceback:
modules/survival.lua:2: in main chunk
Failed to load script modules/survival.lua.
Error loading script modules/player_state.lua in resource vrp: modules/player_state.lua:2: attempt to index a nil value (global ‘vRP’)
stack traceback:
modules/player_state.lua:2: in main chunk
Failed to load script modules/player_state.lua.
Error loading script modules/map.lua in resource vrp: modules/map.lua:10: attempt to index a nil value (global ‘vRP’)
stack traceback:
modules/map.lua:10: in main chunk
Failed to load script modules/map.lua.
Error loading script modules/money.lua in resource vrp: modules/money.lua:1: attempt to index a nil value (global ‘vRP’)
stack traceback:
modules/money.lua:1: in main chunk
Failed to load script modules/money.lua.
Error loading script modules/inventory.lua in resource vrp: modules/inventory.lua:1: attempt to index a nil value (global ‘vRP’)
stack traceback:
modules/inventory.lua:1: in main chunk
Failed to load script modules/inventory.lua.
Error loading script modules/identity.lua in resource vrp: modules/identity.lua:4: attempt to index a nil value (global ‘vRP’)
stack traceback:
modules/identity.lua:4: in main chunk
Failed to load script modules/identity.lua.
Error loading script modules/business.lua in resource vrp: modules/business.lua:6: attempt to index a nil value (global ‘vRP’)
stack traceback:
modules/business.lua:6: in main chunk
Failed to load script modules/business.lua.
Error loading script modules/item_transformer.lua in resource vrp: modules/item_transformer.lua:8: attempt to index a nil value (global ‘vRP’)
stack traceback:
modules/item_transformer.lua:8: in main chunk
Failed to load script modules/item_transformer.lua.
Error loading script modules/emotes.lua in resource vrp: modules/emotes.lua:5: attempt to index a nil value (global ‘vRP’)
stack traceback:
modules/emotes.lua:5: in main chunk
Failed to load script modules/emotes.lua.
Error loading script modules/police.lua in resource vrp: modules/police.lua:3: attempt to index a nil value (global ‘vRP’)
stack traceback:
modules/police.lua:3: in main chunk
Failed to load script modules/police.lua.
Error loading script modules/home.lua in resource vrp: modules/home.lua:4: attempt to index a nil value (global ‘vRP’)
stack traceback:
modules/home.lua:4: in main chunk
Failed to load script modules/home.lua.
Error loading script modules/home_components.lua in resource vrp: modules/home_components.lua:3: attempt to index a nil value (global ‘vRP’)
stack traceback:
modules/home_components.lua:3: in main chunk
Failed to load script modules/home_components.lua.
Error loading script modules/mission.lua in resource vrp: modules/mission.lua:3: attempt to index a nil value (global ‘vRP’)
stack traceback:
modules/mission.lua:3: in main chunk
Failed to load script modules/mission.lua.
Error loading script modules/aptitude.lua in resource vrp: modules/aptitude.lua:5: attempt to index a nil value (global ‘vRP’)
stack traceback:
modules/aptitude.lua:5: in main chunk
Failed to load script modules/aptitude.lua.
Error loading script modules/basic_phone.lua in resource vrp: modules/basic_phone.lua:4: attempt to index a nil value (global ‘vRP’)
stack traceback:
modules/basic_phone.lua:4: in main chunk
Failed to load script modules/basic_phone.lua.
Error loading script modules/basic_atm.lua in resource vrp: modules/basic_atm.lua:4: attempt to index a nil value (global ‘vRP’)
stack traceback:
modules/basic_atm.lua:4: in main chunk
Failed to load script modules/basic_atm.lua.
Error loading script modules/basic_market.lua in resource vrp: modules/basic_market.lua:3: attempt to index a nil value (global ‘vRP’)
stack traceback:
modules/basic_market.lua:3: in main chunk
Failed to load script modules/basic_market.lua.
Error loading script modules/basic_gunshop.lua in resource vrp: modules/basic_gunshop.lua:4: attempt to index a nil value (global ‘vRP’)
stack traceback:
modules/basic_gunshop.lua:4: in main chunk
Failed to load script modules/basic_gunshop.lua.
Error loading script modules/basic_garage.lua in resource vrp: modules/basic_garage.lua:4: attempt to index a nil value (global ‘MySQL’)
stack traceback:
modules/basic_garage.lua:4: in main chunk
Failed to load script modules/basic_garage.lua.
Error loading script modules/basic_items.lua in resource vrp: modules/basic_items.lua:5: attempt to index a nil value (global ‘vRP’)
stack traceback:
modules/basic_items.lua:5: in main chunk
Failed to load script modules/basic_items.lua.
Error loading script modules/basic_skinshop.lua in resource vrp: modules/basic_skinshop.lua:4: attempt to index a nil value (global ‘vRP’)
stack traceback:
modules/basic_skinshop.lua:4: in main chunk
Failed to load script modules/basic_skinshop.lua.
Error loading script modules/cloakroom.lua in resource vrp: modules/cloakroom.lua:3: attempt to index a nil value (global ‘vRP’)
stack traceback:
modules/cloakroom.lua:3: in main chunk
Failed to load script modules/cloakroom.lua.

Any idea about this?

Hello! I have a problem when some player is take wanted level, not coming police notifycation have point in map, just problem with notify. I changed police.lua files to standart but still not working. Help pleace.

How to add pictures to cars in car stores?

Hi everyone,
Important announcement for vRP developers:

I’m refactoring the vRP API to “unleash the true power of Lua” (since NeoLua is gone), this will break every scripts using Proxy or Tunnel. For now, changes are made in the vrpex branch, basic missions and TCG have this branch too, but it should be soon merged into the fxserver branch. Take a look at it to understand the changes, I will also rewrite the vRP doc.

Features:

  • Proxy calls will look like normal calls
  • Tunnel calls will look like normal calls with the player/source as first argument (sequential, no more callback hell)
  • no more specific client lib, extensions will directly load Proxy and Tunnel using the module function defined by lib/utils

This means that asynchronous functions will now be defined using async(), making, for example, MySQL queries synchronous-like. This simplify a lot the code, but requires more understanding for special cases.

You can try the vrpex version to help find issues, but do a database backup before using it.

2 Likes

The game already includes Citizen.Await and a copy of https://github.com/zserge/lua-promises since a pull request by @Brouznouf, these are fully aware of the game’s scheduler unlike a naive coroutine implementation, and are both used by the built-in RPC system as well as (a testing version of?) @Brouznouf’s mysql-async resource.

Therefore, it’s hard to see why you’re trying to reimplement built-in game subsystems yourself for a refactor instead of relying on FiveM’s built-in client<->server RPC (pass a callback in an event argument, and you can save it and call it on client and server transparently with coroutine-like behavior - you can even send a whole API along in a single table on join if that’s what you prefer) and scheduler system.

@element.86 I saw that in the code of the scheduler, but couldn’t find any documentation about it. Thanks for the infos, I just don’t understand the promise system. I also wasn’t aware that callbacks were “proxied” to the clients, I assume that they are based on TriggerEvent ?

Also, how I am supposed to create promises ?

EDIT: found how, edited last post.

I’m interested in this idea as well

im getting this error please help me!

[vRP] (name) (ip) rejected: identification error

i have issue if someone ask id i can’t accept. i need go out of the car to accept

how i fix ?