r_props_foldphone Configuration
R_Props Foldable Phones config: command, fold key, phones and colours, items and driving.
All settings live in shared/config.lua. Restart the resource after changing it.
Command and key
R.Command = 'foldphone' -- false = only the items take the phone out
R.FoldCommand = 'foldphone_fold'
R.FoldKey = 'Y'
R.DefaultPhone = 'fold'| Option | Default | What it does |
|---|---|---|
R.Command | 'foldphone' | Chat command that takes a phone out: /foldphone [phone] [colour]. With no arguments it takes out the default phone, or puts the phone away. false = items only. |
R.FoldCommand | 'foldphone_fold' | Command behind the fold key. |
R.FoldKey | 'Y' | Default fold key. Players can change it in their key settings, so a change here only reaches players who have not bound it yet. |
R.DefaultPhone | 'fold' | Phone used when the command gets no phone name. |
Phones
R.Phones = {
fold = {
label = 'iFruit Fold',
prefix = 'r_foldphone_',
dict = 'r_foldphone_anim',
colours = { 'black', 'silver', 'cream', 'green' },
hold = { closed = vec3(-0.030, 0.0, 0.002), open = vec3(-0.055, 0.0, 0.002) },
},
duo = {
label = 'iFruit Duo',
prefix = 'r_foldduo_',
dict = 'r_foldduo_anim',
colours = { 'night', 'white' },
hold = { closed = vec3(-0.038, 0.0, 0.002), open = vec3(-0.0715, 0.0, 0.002) },
},
flip = {
label = 'iFruit Flip',
prefix = 'r_foldflip_',
axis = 'x',
oneHand = true,
colours = { 'graphite', 'lilac', 'mint' },
hold = { closed = vec3(0.0, 0.0, 0.040), open = vec3(0.0, 0.0, 0.040) },
},
}
R.FlipSwing = { swingDelay = 0, swingTime = 380 }| Option | What it does |
|---|---|
colours | The colours a player can take out. Remove one to hide it from the command and the exports. |
hold | Where the phone sits in the hand, closed and open. |
R.FlipSwing | How fast the Flip opens, in milliseconds. |
Leave prefix, dict, axis and oneHand as they are: they point to the models and animations.
Items
R.Items = {
ifruit_fold_black = { phone = 'fold', colour = 'black' },
ifruit_fold_silver = { phone = 'fold', colour = 'silver' },
ifruit_fold_cream = { phone = 'fold', colour = 'cream' },
ifruit_fold_green = { phone = 'fold', colour = 'green' },
ifruit_duo_night = { phone = 'duo', colour = 'night' },
ifruit_duo_white = { phone = 'duo', colour = 'white' },
ifruit_flip_graphite = { phone = 'flip', colour = 'graphite' },
ifruit_flip_lilac = { phone = 'flip', colour = 'lilac' },
ifruit_flip_mint = { phone = 'flip', colour = 'mint' },
}Item name on the left, the phone and colour it takes out on the right. To rename an item, change it here, in your inventory's item file and in the image file name.
Phone script
R.PhoneScript = 'none'
R.PhoneScriptPhone = { phone = 'fold', colour = 'black' }| Option | Default | What it does |
|---|---|---|
R.PhoneScript | 'none' | 'lb-phone': opening LB Phone takes out a foldable and unfolds it, closing folds it. Setup on the LB Phone page. |
R.PhoneScriptPhone | Fold, black | The phone and colour that comes out with the phone script. |
Driving
R.UnfoldWhileDriving = false| Option | Default | What it does |
|---|---|---|
R.UnfoldWhileDriving | false | false: the driver can only hold the phone closed, and an open phone folds when they take the wheel. Passengers can always unfold. |
Animations
R.HoldBone = 28422
R.HoldRot = vec3(0.0, 0.0, 0.0)
R.Layer = { cover = 200, release = 250 }
R.Anims = {
closed = { dict = 'cellphone@', clip = 'cellphone_text_read_base', flag = 49 },
vehicle = { dict = 'cellphone@in_car@ds', clip = 'cellphone_text_read_base', flag = 49 },
open = { clip = 'hold_open', flag = 49 },
unfold = { clip = 'unfold', flag = 50, time = 867, swingDelay = 200, swingTime = 400 },
fold = { clip = 'fold', flag = 50, time = 867, swingDelay = 267, swingTime = 400, nextPhase = 0.176 },
}These are the tuned defaults for the hand position and the fold timing. closed and vehicle are the
holds for the closed phone on foot and in a vehicle: swap them for another phone hold if you like. Leave the
rest as it is.
Item bridge
bridge/sv_items.lua is open. It makes the items usable on Qbox, QBCore and ESX. With
ox_inventory the items use the resource's export instead, so the bridge does nothing there. Edit it if
your server uses another inventory.