Sure!
So adding chairs is pretty easy once you get the hang of it, I would advise you to take a chair that is similar to what you’re trying to add from the list.lua file, and just modify that until it fits. However, here is a “guide” for those who want to know the specifics.
The first thing to figure out is if the chair (or whatever) you are trying to add is dynamic or not. You can figure this out by using an object spooner or some other sort of dev tool (such as this one made by Koil: koil-public/fivem-koil-debug at master · itsKoil/koil-public · GitHub). If they are dynamic, then follow the Models guide, otherwise, just follow the Poly guide.
Models
[hash] = {
sit = {
type = 'chair',
seats = {
[1] = vector4(xOffset, yOffset, zOffset, headingOffset)
}
}
}, -- prop_name
-
hash
: The hash is what identifies the model, you could in theory replace it with GetHashKey(prop_name) to get the same effect. However, there is no need to get the hash key every time the recourse starts up, so the faster thing is to have it pre-‘calculated’. -
sit = {}
: Inside of this table is where the sit code would be, for laying down we uselay = {}
-
type
: This is the type of chair, it decides what scenarios/animations that we use, whether or not we teleport the player in or out etc. Most of the options set through the type can be overwritten on a model-to-model basis.
You can find the full list of types in the config file. -
option
: Inside of thesit = {}
table we can set model-specific options, some of them include:- teleportIn = boolean
- teleportOut = boolean
- skipSeeCheck = boolean
-
seats = {}
: Inside this table, we list the possible seats, these are indexed and need to be a vector4. (You can have an unlimited amount of ‘slots’) -
prop_name
This is just a comment, has no functionality other than showing the name of the prop since we use the hash.
Example:
[-826852533] = { sit = { type = 'chair2', teleportIn = true, seats = {[1] = vector4(0.0, 0.1, 0.85, 180.0)} } }, -- prop_umpire_01
For more examples just look in the list.lua file, you’ll see plenty of examples. The best way is just to try it out in-game and adjust the numbers and restart the resource until you have something that works.
Polys
So polys are a little different but largely the same. Polys are always a part of a group, this is to reduce the number of calculations, if you are creating a new group just copy an existing one and take it from there, it should be self-explanatory what to do.
['name_of_chair'] = {
sit = {
type = 'chair2',
seats = {
[1] = vector4(xCoords, yCoords, zCoords, heading)
}
},
poly = {
center = vector3(xCoords, yCoords, zCoords),
length = 1.25,
width = 0.75,
height = 1.0
}
},
-
`‘name_of_chair’``: This is the name of the polys, it needs to be unique to its group.
-
sit = {}
: The same as models. -
option
: This is the same as models, see above for info. -
seats = {}
: This is mostly the same as the model, however instead of offset we use the coords and heading. -
poly = {}
: This is what’s really different from the models. Now, even if you don’t use a 3rd eye solution and just the command you still need this to make it work. -
center
: The center of the poly, this is the most important one, it is usually the same as the seat for most 1 seat polys. -
length
: the length of the poly. -
width
: The width of the poly. -
height
: The height of the poly, this can be replaced by maxZ and minZ, but those will be absolute coords.
Example:
['pillbox_ward_c_34'] = {
sit = { type = 'chair3', seats = {[1] = vector4(360.72, -583.13, 42.8, 340.0)} },
poly = { length = 1.0, width = 1.0, height = 1.0 }
},
When adding polys I would advise you to set Config.Debugmode to true, and Config.DebugPoly to true IF you have your PolyZone script set to only render polys nearby.
Lay
Adding places to lay down on follows the same pattern as sitting, just remember to use lay = {}
instead of sit = {}
.
I hope this helps you out, if you have any questions feel free to post them!