Make Ox_Inventory store for Female Only

I would like to make a gun store that is female only and sells weapons for the ladies in our server.

How would I go about restricting an ox inventory shop so only mp_f_freemode ped can use it?

3 Likes

I just done this for my server. So, you’ll need wasabi ox shops script free and make a shop, job & grade 4 (database), add group.mp_f or group.female in the shop. Or I could make you a script. Discord jaythaagamer

1 Like

long story short yes it can be done

you just need to make a new script by creating a folder and name it whatever you want, inside that folder have 2 files clinet lua and server lua

in the server side lua write this :

Summary

RegisterNetEvent(‘here tyep your script folder name one word:openFemaleOnlyShop’, function()
local src = source
TriggerClientEvent(‘your script folder name one word:checkFemaleAndOpenShop’, src)
end)

in the client lua write this:

Summary

RegisterNetEvent(‘your script/folder name all in one word:checkFemaleAndOpenShop’, function()
local ped = PlayerPedId()
local model = GetEntityModel(ped)

if model == GetHashKey('mp_f_freemode_01') then
    -- Player is female
    TriggerEvent('ox_inventory:openShop', '**female_shop** THIS NAME HAS TO BE SAME AS THE SHOPE NAME YOU WILL ADD IN OX INV/ data /SHOPS LUA')
else
    -- if its not a female
    exports['whatever notify script you use write it here one word']:Alert("Shop", "this shop is only for females or whatever message you want it to say if player is not female", 5000, 'error')
end

end)

now last step i would say is adding the shop itself to ox inv / data /shop lua which should be easy copy and paste the ammunation shop but rename the ammunition to female_shop

Summary

Ammunation = { ------- rename this to female_shop or whatever u want it to be called just make sure its the name name in trigger event in client side lua
name = ‘Ammunation’, ---- the name that will show to players
blip = {
id = 110, colour = 69, scale = 0.8
}, inventory = {
{ name = ‘ammo-9’, price = 5, },
{ name = ‘WEAPON_KNIFE’, price = 200 },
{ name = ‘WEAPON_BAT’, price = 100 },
{ name = ‘WEAPON_PISTOL’, price = 1000, metadata = { registered = true }, license = ‘weapon’ }
}, locations = { ------- here is where u want the shop loctions to be
vec3(-662.180, -934.961, 21.829),
vec3(810.25, -2157.60, 29.62),
vec3(1693.44, 3760.16, 34.71),
vec3(-330.24, 6083.88, 31.45),
vec3(252.63, -50.00, 69.94),
vec3(22.56, -1109.89, 29.80),
vec3(2567.69, 294.38, 108.73),
vec3(-1117.58, 2698.61, 18.55),
vec3(842.44, -1033.42, 28.19)
}, targets = { ------- here u can add where u want the target to be where u open the shop
{ loc = vec3(-660.92, -934.10, 21.94), length = 0.6, width = 0.5, heading = 180.0, minZ = 21.8, maxZ = 22.2, distance = 2.0 },
{ loc = vec3(808.86, -2158.50, 29.73), length = 0.6, width = 0.5, heading = 360.0, minZ = 29.6, maxZ = 30.0, distance = 2.0 },
{ loc = vec3(1693.57, 3761.60, 34.82), length = 0.6, width = 0.5, heading = 227.39, minZ = 34.7, maxZ = 35.1, distance = 2.0 },
{ loc = vec3(-330.29, 6085.54, 31.57), length = 0.6, width = 0.5, heading = 225.0, minZ = 31.4, maxZ = 31.8, distance = 2.0 },
{ loc = vec3(252.85, -51.62, 70.0), length = 0.6, width = 0.5, heading = 70.0, minZ = 69.9, maxZ = 70.3, distance = 2.0 },
{ loc = vec3(23.68, -1106.46, 29.91), length = 0.6, width = 0.5, heading = 160.0, minZ = 29.8, maxZ = 30.2, distance = 2.0 },
{ loc = vec3(2566.59, 293.13, 108.85), length = 0.6, width = 0.5, heading = 360.0, minZ = 108.7, maxZ = 109.1, distance = 2.0 },
{ loc = vec3(-1117.61, 2700.26, 18.67), length = 0.6, width = 0.5, heading = 221.82, minZ = 18.5, maxZ = 18.9, distance = 2.0 },
{ loc = vec3(841.05, -1034.76, 28.31), length = 0.6, width = 0.5, heading = 360.0, minZ = 28.2, maxZ = 28.6, distance = 2.0 }

and ofc you add whatever items u want and price them in the shop to your liking and add the items themselves if they are new items your importing to the server to ox inv/data/items lua

i might have missed few things here and there but this should be easy to understand if you know what you doing, its really not that hard to get it done, so i think this should help you to understand the full picture.

wish you luck

1 Like

Testing this out now!

I will let you know how it goes.

EDIT
It did not work for me but I feel like I’m missing something as the script is not showing in my resource list or console.

This is a pretty weird request, but my opinion aside, you’d need to edit ox_inventory yourself, to either check the player’s sex in the database or their player model as checking for ped model is not a default config/check that it does.

Your best bet is to create some kind of whitelisted job that can be assigned to them, and then via the ox_inv config make it so that only people with that job can access it.

But generally I wouldn’t recommend discriminating based on sex, and even from a game balance perspective this may lead to exploits of this store if you’re trying to provide different pricing.

It’s not supposed to be different pricing, it’s going to be pink guns and weapons that would be exclusive for them.
Obviously people will sell them and in the community they may be worth more from player to player but we would want it balanced as far as that.

I got the inspiration from another script I have to sell wigs that allows you to lock it to the female ped.

1 Like

3 things. Great minds think alike :laughing: I as well have thought of this same idea and been coding a script for it. Works great, but you must be an female admin with a job and rank boss. I got the idea from another server called Para RP they have an gun shop locked to females only using the ox-inventory shops.lua. Also, the script idea that the guy above suggested isn’t showing up in your resources because you need a fxmanifest.lua Lastly, of you have that drug script for females only send it to me buy chance? I’ll reverse engineer it to be a female only weapon selling script.

1 Like

Yah add this Fxmanifest.lua file too

Summary

fx_version ‘cerulean’
game ‘gta5’

description ‘Female Only Shop’
version ‘1.0.0’

shared_script ‘@ox_lib/init.lua’

client_scripts {
‘client.lua’
}

dependencies {
‘ox_target’,
‘ox_inventory’,
‘ox_lib’ ----- you can replace this with whatever Notify system your using
}

hopefully this should work.

I added you on Discord a few days ago! The script I have is escrow locked but I can share which one it is with you.

I appreciate all the help!

I’m getting this error in my console for the script

09:17:26 PM [ resources:ox_female] Error: ox_female failed to load: Could not parse resource metadata file C:/Users/admin/Desktop/server/txData/ESXLegacy_C3CEF7.base/resources//[ox]/ox_female/fxmanifest.lua: ox_female/fxmanifest.lua:1: syntax error near ‘<\226>’

This is what I have in the fxmanifest.lua

fx_version ‘cerulean’
game ‘gta5’

description ‘Female Only Shop’
version ‘1.0.0’

shared_script ‘ox_lib/init.lua’

client_scripts {
‘client.lua’
}

dependencies {
‘ox_target’,
‘ox_inventory’,
‘okokNotify’ ----- you can replace this with whatever Notify system your using
}

Sounds good I’ll check my requests! Oh alright that’ll cool as well.