[Release] vRP Framework

Isn’t there already a connection for fuel to vRP?

Hello,

A few users have gotten the error “[vRP] Connection Refused” while trying to connect to our FX Server, I am not sure what’s causing this issue.

Does anyone have any idea?

Thanks,
Moonblaze

1 Like

Is there a way to disable hunger and thirst?

can you run essentialmode with this ?

No, it is mysql for this framework

Hi people am part of a server and we are using VRP system for our server and we got it work well I was wanting to know if any who use it has a bag scritp that would up the carry wight for players and has link to download it.

I managed to do it (disable hunger and thirst) with an if statement, so that ONLY superadmins (or above) get opted out of the hunger/thirst system. My method does modify base vRP scripts, so is not officially supported or recommended, but it does work. this is what I did…
Inside the survival.lua within the modules folder, locate the line that states:

function vRP.varyHunger(user_id, variation)

under this line, you will see an if statement. Directly BEFORE this if statement, add in the first line below (the second line is the original If statement, and is for reference only, do not copy it):

if not vRP.hasPermission(user_id,"superadmin.survival") then
   if data then

Do not forget that ALL if statements need an end, so add an additional end to the section (this section ends after the – set progress bar data section).

Do the same thing in the thirst section. You would need to modify your groups.lua in the CFG folder to include the new right of “superadmin.survival” under the Super Admin section. This works like a charm for me, and I can run laps around the spawn in police station without getting hungry or thirsty.

If you want it disabled for all users, you can substitute “superadmin.survival” with whatever you want, like “citizen.survival” or what not, just make sure that right gets placed into your groups.lua, or it will not do anything as it only triggers, and bypasses the hunger or thirst system IF someone HAS the right assigned to them.

1 Like

Cop weapons and vehicles are not in the base vRP, you would need to edit the garages.lua in the cfg folder to include a new garage, here is an example of my Police Garage:

["policecar"] = {
    _config = {permissions = {"police.vehicle"},vtype="police",blipid=60,blipcolor=5},
	["police"] = {"Police Stainer",0, ""},
	["police2"] = {"Police Buffalo",0, ""},
	["police3"] = {"Police Interceptor",0, ""},
	["police4"] = {"Undercover Stainer",0, ""},
        ["sheriff"] = {"Sheriff",0, ""},
        ["sheriff2"] = {"Sheriff SUV",0,""}
  }

You would need to add in the above under the last vehicle type (motorcycles is the default last one I believe), make sure to add a comma to the } that appears at the end of the motorcycles section, to inform the system you are proceding with an additional garage. Additionally, if you are adding in another type, like policeair make sure there is a comma at the end of the above for the same reason, and make sure there is no comma at the end of the last garage type.

Now you need the garage to appear in-game. To do that, head to the bottom of the garages.lua (still the same one from the cfg folder). Here you will see a list of all of the garage types from above, with “GPS” co-ordinates for where it will be placed. Note that you can have multiple garages of the same type, but you cannont have a single car appear in multiple garages. Here is an example of what I have for that section:


cfg.garages = {
  {"compacts",-356.146, -134.69, 39.0097},
  {"coupe",723.013, -1088.92, 22.1829},
  {"sports",-1145.67, -1991.17, 13.162},
  {"sportsclassics",1174.76, 2645.46, 37.7545},
  {"supercars", 114.62084197998, 6617.9453125, 31.8887786865234},
  {"motorcycles",-205.789, -1308.02, 31.2916},
  {"policecar",1866.52355957031,3682.0390625,33.6572189331055},
  {"policecar",450.692810058594,-1013.67327880859,28.4827136993408},
  {"policecar",376.747039794922,-1612.37414550781,29.2919406890869},
  {"policecar",-471.950927734375,6035.28955078125,31.3405456542969}
}

Take special note that the final garage in the list should be the ONLY one to end without a , The co-ordinates above are working, and are where I have the garages appear in my server. The one near the original spawn point somewhat collides with the taco/water harvest point, but can be accessed if approached from the correct direction. I have also moved the supercar garage to prevent my cars from appearing halfway up a wall.

The last thing you need to do, to make the garages available to your police force is to assign the above used “police.vehicle” right in your groups.lua (in the cfg folder) under the police section. example:

["police"] = {
    _config = { 
      gtype = "job",
      onjoin = function(player) vRPclient.setCop(player,{true}) end,
      onspawn = function(player) vRPclient.setCop(player,{true}) end,
      onleave = function(player) vRPclient.setCop(player,{false}) end
    },
    "police.vehicle",
    "police.cloakroom",

One last thing, in my above examples, the police pay nothing for their vehicles, you can set a price for them by replacing the ,0, with the amount owed for each vehicle, if that is what works best for your server needs.

Police weapons are done in a similar fashion, with the exception being that each police weapons locker can only appear in one place, so a new weapon heading will be needed for each station. The file that stores this information is gunshops.lua in the cfg folder. Luckily a single weapon can appear in multiple weapons stores. I can post examples of this too if needed, but refrained as this post is quite long as is.

1 Like

What I would love to see is a login prompt that appears when accessing a server. My ideal thing would be to have a prompt come up asking what user number you want to sign in as, and then to have it ask for and validate your password. if you want to make a new character, you would click create new, and then be asked to set the password. This way you could have multiple characters on the same server. Also you would not keep needing to modify your vRP database every time the computer you are developing on changes it’s IP address…

Thank you so much for the detailed write up! My next question is with the permissions. I’ve got the garages and weapon stores set up on my server and added the permissions for police.gunshop and police.garage to their group, but somehow anyone can walk up and buy the cops gear for free. Any ideas on that? I’ve even tried adding negative permissions for those shops to everyone who’s not a cop.

I cant realy speculate without seeing your .lua files, specifically I would need to see your groups.lua (just the part for police permissions), your garages.lua (specifically the part where you initiate the garage), and the gunshop.lua (again just the part where you declare the gunshop).

I declare the garage with these lines in my example:

["policecar"] = {
    _config = {permissions = {"police.vehicle"},vtype="police",blipid=60,blipcolor=5},

make sure you have permissions = {“police.garage”}, in your script if it is not formatted properly (with the {} and " ") then it may get ignored, this would cause the garage/gunshop to be available to all. If done properly, all users will still see the glowing circle, but non-police will have nothing happen when they enter the circle.

Another possible failure point, is having the “police.garage” in the users group. Rights can be placed in multiple groups and still work, so make sure it is not duplicated in both the police and user or citizens group, as this would also trigger non-police seeing the contents of the garage/gunshop.

["police"]  = {
_config = {vtype="car",blipid=50,blipcolor=4,permission="police.garage"},
["police"] = {"Police Stanier", 0, ""},
["police2"] = {"Police Buffalo", 0, ""},
["police3"] = {"Police Interceptor", 0, ""},
["police4"] = {"Police", 0, ""},
["sheriff"] = {"Sheriff", 0, ""},
["sheriff2"] = {"Sheriff 2", 0, ""},
["fbi"] = {"FIB", 0, ""},
["fbi2"] = {"FIB2", 0, ""}

},

permissions=“police.garage”

Looks like you forgot the final s in permissions. this is likely your entire problem, as the script will ignore a command it is unfamilliar with, scripting can be a nightmare for sure, i spent hours trying to figure out an issue my first time, only to have a missing , be the culprit…

OMG you’ve gotta be kidding me haha. Thanks so much, I’ll try adding the s to the end of permissions and see if it works.

One final note here, I see you have the vtype set to car, the vtype can be literally anything (apparently) so if you set it to police (like in my example) then you can have say one super car, and one police car out at the same time, which might help for someone who is role playing driving to the police station then changing into police gear, and then getting assigned their police car.

Thank you so much man, appreciate all the help!

_config = {vtype="car",blipid=50,blipcolor=4,permission="police.garage"}

Just saw something else, the line above does not have the permission inside {}, so should be modified to:

_config = {vtype="car",blipid=50,blipcolor=4,permissions={"police.garage"}}

Man, you’re a life saver. Thank you so much. I’m new to all of this and trying to throw together a server for my friends and I.

Is there any way within vrp to send someone to the big prison and have a set timer for release? As it sits now, we have to baby sit anyone who’s jailed and release them manually.

Does not have 1 player on the server and is thus using the internet band…

Imgur