ShortWlf / fx-od-pub

fx od server public bug report repository
2 stars 0 forks source link

Redesigning Server Framework #32

Closed ShortWlf closed 2 years ago

ShortWlf commented 2 years ago

Currently we are rebuilding with a new framework, i cannot give a time frame until development starts, we are updating core aspects of the server, redesigning is just upgrading we keep all the hard work we had, this will perfect the server overall, sure its kinda sad we came close to launch and this has become more of a focus, but we dont want 30 people all losing random items, and inventory conflicts, it will wreck their experience, and we want that experience to be the best i and we can offer! anyhow see you all soon, i will most likely open a development server where you can cant test the new systems, so keep on the lookout!

ShortWlf commented 2 years ago

got everything mostly working, rebuild is put off until this test proves broke.

rebuilding item database, server currently works fine, with minimal system, no duplications, with current setup, will reformat 315 items with correct values, this process will most likely take 1-2 days in time.

ShortWlf commented 2 years ago

This list is the old item list, of minimal items listed, this is not the full 315 items in the list.

current list format 1 = remove 0 = rare 1 = default stack other values close on use, desc, max stack


('bread','Bread', 1, 0, 1),
('water','Water', 1, 0, 1),
('alive_chicken','Live Chicken', 1, 0, 1),
('slaughtered_chicken','Dead Chicken', 1, 0, 1),
('packaged_chicken','Packaged Chicken', 1, 0, 1),
('fish','Fish', 1, 0, 1),
('stone','Stone', 1, 0, 1),
('washed_stone','Clean Stone', 1, 0, 1),
('copper','Copper', 1, 0, 1),
('iron','Iron', 1, 0, 1),
('gold','Gold', 1, 0, 1),
('diamond','Diamond', 1, 0, 1),
('wood','Wood', 1, 0, 1),
('cutted_wood','Chopped Wood', 1, 0, 1),
('packaged_plank','Packaged Plank', 1, 0, 1),
('petrol','Oil', 1, 0, 1),
('petrol_raffin','Refined Oil', 1, 0, 1),
('essence','Essence', 1, 0, 1),
('wool','Wool', 1, 0, 1),
('fabric','Fabric', 1, 0, 1),
('clothe','Clothe', 1, 0, 1),
('cannabis','Cannabis', 1, 0, 1),
('marijuana','Kilo of weed', 1, 0, 1),
('absinthe','Absinthe', 1, 0, 1),
('beer','Beer', 1, 0, 1),
('champagne','Champagne', 1, 0, 1),
('chips','Chips', 1, 0, 1),
('chocolate','Chocolate', 1, 0, 1),
('cigarett','Cigarette', 1, 0, 1),
('cocacola','Cola', 1, 0, 1),
('coffe','Coffee', 1, 0, 1),
('cupcake','Cupcake', 1, 0, 1),
('gintonic','Gin Tonic', 1, 0, 1),
('hamburger','Hamburger', 1, 0, 1),
('icetea','Ice-tea', 1, 0, 1),
('lighter','Lighter', 1, 0, 1),
('milk','Milk', 1, 0, 1),
('sandwich','Sandwich', 1, 0, 1),
('tequila','Tequila', 1, 0, 1),
('vodka','Vodka', 1, 0, 1),
('whisky','Whisky', 1, 0, 1),
('coke_pooch','Pouch of coke', 1, 0, 1),
('saffron','Saffron', 1, 0, 1),
('speaker','Speaker', 1, 0, 1),
('laptop','Laptop', 1, 0, 1),
('book','Book', 1, 0, 1),
('coupon','Coupon', 1, 0, 1),
('toothpaste','Toothpaste', 1, 0, 1),
('lotteryticket','Lottery Ticket', 1, 0, 1),
('shirt','Shirt', 1, 0, 1),
('shoes','Shoes', 1, 0, 1),
('lockpick','Lockpick', 1, 0, 1),
('bottle','50cl Flaska-Tom', 1, 0, 1),
('oxygen_mask','Oxygen Mask', 1, 0, 1),
('bulletproof','Bullet-Proof Vest', 1, 0, 1),
('firstaidkit','First Aid Kit', 1, 0, 1),
('darknet','Dark Net', 1, 0, 1),
('clip','Weapon Magazines', 1, 0, 1),
('phone','Cell Phone', 1, 0, 1),
('repairkit','Repairkit', 1, 0, 1),
('moneywashid','Moneywash ticket', 1, 0, 1),
('weed','Weed (1G)', 1, 0, 1),
('weed_pooch','Bag of weed (28G)', 1, 0, 1),
('coke','Coke (1G)', 1, 0, 1),
('meth','Meth (1G)', 1, 0, 1),
('meth_pooch','Bag of meth (28G)', 1, 0, 1),
('opium','Opium (1G)', 1, 0, 1),
('opium_pooch','Bag of opium (28G)', 1, 0, 1),
('scratchoff','Scratchoff Ticket', 1, 0, 1),
('scratchoff_used','Used Scratchoff Ticket', 1, 0, 1),
('gps','GPS', 1, 0, 1),
('bandage','Bandage', 1, 0, 1),
('medikit','Medkit', 1, 0, 1),
('license','License', 1, 0, 1),
('gazbottle','bouteille de gaz', 1, 0, 1),
('fixtool','outils réparation', 1, 0, 1),
('carotool','outils carosserie', 1, 0, 1),
('blowpipe','Chalumeaux', 1, 0, 1),
('fixkit','Kit réparation', 1, 0, 1),
('carokit','Kit carosserie', 1, 0, 1),
('rope','Rope', 1, 0, 1),
('handcuffs','Handcuffs', 1, 0, 1),
('jewels','Jewels', 1, 0, 1),
('jumelles','Binoculars', 1, 0, 1),
('wine','Wine', 1, 0, 1),
('blunt','Blunt', 1, 0, 1),
('packofsmokes','Pack of Cigarettes', 1, 0, 1),
('SteelScrap','SteelScrap', 1, 0, 1),
('wallet','Wallet', 1, 0, 1),
('bagoloot','Stack of Money', 1, 0, 1),
('moneyclip','Money Clip', 1, 0, 1),
('ammoanalyzer','Ammo Analyzer', 1, 0, 1),
('bloodsample','Bloodsample', 1, 0, 1),
('bulletsample','Bulletsample', 1, 0, 1),
('dnaanalyzer','Dna Analyzer', 1, 0, 1),
('lspd_badge','Police Badge', 1, 0, 1),
('fib_badge','FIB Badge', 1, 0, 1),
('parkingcard','Parking Card', 1, 0, 1),
('apartmentkey1','LS Apartment Key #1', 1, 0, 1),
('apartmentkey2','LS Apartment Key #2', 1, 0, 1),
('apartmentkey3','LS Apartment Key #3', 1, 0, 1),
('apartmentkey4','LS Apartment Key #4', 1, 0, 1),
('apartmentkey5','LS Apartment Key #5', 1, 0, 1),
('apartmentkey6','LS Apartment Key #6', 1, 0, 1),
('apartmentkey7','LS Apartment Key #7', 1, 0, 1),
('apartmentkey8','LS Apartment Key #8', 1, 0, 1),
('apartmentkey9','LS Apartment Key #9', 1, 0, 1),
('apartmentkey10','LS Apartment Key #10', 1, 0, 1),
('apartmentkey11','LS Apartment Key #11', 1, 0, 1),
('apartmentkey12','LS Apartment Key #12', 1, 0, 1),
('apartmentkey13','LS Apartment Key #13', 1, 0, 1),
('apartmentkey14','LS Apartment Key #14', 1, 0, 1),
('apartmentkey15','LS Apartment Key #15', 1, 0, 1),
('apartmentkey16','LS Apartment Key #16', 1, 0, 1),
('apartmentkey17','LS Apartment Key #17', 1, 0, 1),
('apartmentkey18','LS Apartment Key #18', 1, 0, 1),
('apartmentkey19','LS Apartment Key #19', 1, 0, 1),
('apartmentkey20','LS Apartment Key #20', 1, 0, 1),
('apartmentkey21','LS Apartment Key #21', 1, 0, 1),
('apartmentkey22','LS Apartment Key #22', 1, 0, 1),
('apartmentkey23','LS Apartment Key #23', 1, 0, 1),
('apartmentkey24','LS Apartment Key #24', 1, 0, 1),
('apartmentkey25','LS Apartment Key #25', 1, 0, 1),
('apartmentkey26','LS Apartment Key #26', 1, 0, 1),
('apartmentkey27','LS Apartment Key #27', 1, 0, 1),
('apartmentkey28','LS Apartment Key #28', 1, 0, 1),
('apartmentkey29','LS Apartment Key #29', 1, 0, 1),
('apartmentkey30','LS Apartment Key #30', 1, 0, 1),
('apartmentkey31','LS Apartment Key #31', 1, 0, 1),
('apartmentkey32','LS Apartment Key #32', 1, 0, 1),
('cchip','Casino Chip', 1, 0, 1),
('housekey1','House Key #1', 1, 0, 1),
('housekey2','House Key #2', 1, 0, 1),
('housekey3','House Key #3', 1, 0, 1),
('housekey4','House Key #4', 1, 0, 1),
('housekey5','House Key #5', 1, 0, 1),
('housekey6','House Key #6', 1, 0, 1),
('housekey7','House Key #7', 1, 0, 1),
('lettuce','Lettuce', 1, 0, 1),
('clettuce','Chopped Lettuce', 1, 0, 1),
('tomato','Tomato', 1, 0, 1),
('ctomato','Chopped Tomato', 1, 0, 1),
('cheese','Cheese', 1, 0, 1),
('ccheese','Cheese Slices', 1, 0, 1),
('potato','Potato', 1, 0, 1),
('fburger','Frozen beef patty', 1, 0, 1),
('fvburger','Frozen veggie burger', 1, 0, 1),
('nugget','Chicken Nuggest', 1, 0, 1),
('vbread','Gluten-free bread', 1, 0, 1),
('nuggets4','Nuggets x4', 1, 0, 1),
('nuggets10','Nuggets x10', 1, 0, 1),
('shamburger','Quater pounder w/cheese', 1, 0, 1),
('vhamburger','Veggie Burger', 1, 0, 1),
('vegmeal','Meat Free Meal', 1, 0, 1),
('bdmeal','The Bleeder Meal', 1, 0, 1),
('msmeal','Money Shot Meal', 1, 0, 1),
('tpmeal','Torpedo Meal', 1, 0, 1),
('fries','Fries', 1, 0, 1),
('bssprunk','Sprunk Soda', 1, 0, 1),
('emptycup','Empty Cup', 1, 0, 1),
('battery','Battery', 1, 0, 1),
('muffler','Muffler', 1, 0, 1),
('hood','Hood', 1, 0, 1),
('trunk','Trunk', 1, 0, 1),
('doors','Doors', 1, 0, 1),
('engine','Engine', 1, 0, 1),
('waterpump','Water Pump', 1, 0, 1),
('oilpump','Oil Pump', 1, 0, 1),
('speakers','Speakers', 1, 0, 1),
('radio','Radio', 1, 0, 1),
('rims','Rims', 1, 0, 1),
('subwoofer','Subwoofer', 1, 0, 1),
('steeringwheel','Steering Wheel', 1, 0, 1),
('fishbait','Fish Bait', 1, 0, 1),
('fishingrod','Fishing Rod', 1, 0, 1),
('shark','Shark', 1, 0, 1),
('turtle','Sea Turtle', 1, 0, 1),
('turtlebait','Turtle Bait', 1, 0, 1),
('WEAPON_ADVANCEDRIFLE','Advanced Rifle', 1, 0, 1),
('WEAPON_APPISTOL','AP Pistol', 1, 0, 1),
('WEAPON_ASSAULTRIFLE','Assault Rifle', 1, 0, 1),
('WEAPON_ASSAULTSHOTGUN','Assault Shotgun', 1, 0, 1),
('WEAPON_ASSAULTSMG','Assault SMG', 1, 0, 1),
('WEAPON_AUTOSHOTGUN','Auto Shotgun', 1, 0, 1),
('WEAPON_BALL','Ball', 1, 0, 1),
('WEAPON_BAT','Bat', 1, 0, 1),
('WEAPON_BATTLEAXE','Battle Axe', 1, 0, 1),
('WEAPON_BOTTLE','Bottle', 1, 0, 1),
('WEAPON_BULLPUPRIFLE','Bullpup Rifle', 1, 0, 1),
('WEAPON_BULLPUPSHOTGUN','Bullpup Shotgun', 1, 0, 1),
('WEAPON_BZGAS','BZ Gas', 1, 0, 1),
('WEAPON_CARBINERIFLE','Carbine Rifle', 1, 0, 1),
('WEAPON_COMBATMG','Combat MG', 1, 0, 1),
('WEAPON_COMBATPDW','Combat PDW', 1, 0, 1),
('WEAPON_COMBATPISTOL','Combat Pistol', 1, 0, 1),
('WEAPON_COMPACTLAUNCHER','Compact Launcher', 1, 0, 1),
('WEAPON_COMPACTRIFLE','Compact Rifle', 1, 0, 1),
('WEAPON_CROWBAR','Crowbar', 1, 0, 1),
('WEAPON_DAGGER','Dagger', 1, 0, 1),
('WEAPON_DBSHOTGUN','Double Barrel Shotgun', 1, 0, 1),
('WEAPON_DIGISCANNER','Digiscanner', 1, 0, 1),
('WEAPON_DOUBLEACTION','Double Action Revolver', 1, 0, 1),
('WEAPON_FIREEXTINGUISHER','Fire Extinguisher', 1, 0, 1),
('WEAPON_FIREWORK','Firework Launcher', 1, 0, 1),
('WEAPON_FLARE','Flare', 1, 0, 1),
('WEAPON_FLAREGUN','Flare Gun', 1, 0, 1),
('WEAPON_FLASHLIGHT','Flashlight', 1, 0, 1),
('WEAPON_GARBAGEBAG','Garbage Bag', 1, 0, 1),
('WEAPON_GOLFCLUB','Golf Club', 1, 0, 1),
('WEAPON_GRENADE','Grenade', 1, 0, 1),
('WEAPON_GRENADELAUNCHER','Gernade Launcher', 1, 0, 1),
('WEAPON_GUSENBERG','Gusenberg', 1, 0, 1),
('WEAPON_HAMMER','Hammer', 1, 0, 1),
('WEAPON_HANDCUFFS','Handcuffs', 1, 0, 1),
('WEAPON_HATCHET','Hatchet', 1, 0, 1),
('WEAPON_HEAVYPISTOL','Heavy Pistol', 1, 0, 1),
('WEAPON_HEAVYSHOTGUN','Heavy Shotgun', 1, 0, 1),
('WEAPON_HEAVYSNIPER','Heavy Sniper', 1, 0, 1),
('WEAPON_HOMINGLAUNCHER','Homing Launcher', 1, 0, 1),
('WEAPON_KNIFE','Knife', 1, 0, 1),
('WEAPON_KNUCKLE','Knuckle Dusters ', 1, 0, 1),
('WEAPON_MACHETE','Machete', 1, 0, 1),
('WEAPON_MACHINEPISTOL','Machine Pistol', 1, 0, 1),
('WEAPON_MARKSMANPISTOL','Marksman Pistol', 1, 0, 1),
('WEAPON_MARKSMANRIFLE','Marksman Rifle', 1, 0, 1),
('WEAPON_MG','MG', 1, 0, 1),
('WEAPON_MICROSMG','Micro SMG', 1, 0, 1),
('WEAPON_MINIGUN','Minigun', 1, 0, 1),
('WEAPON_MINISMG','Mini SMG', 1, 0, 1),
('WEAPON_MOLOTOV','Molotov', 1, 0, 1),
('WEAPON_MUSKET','Musket', 1, 0, 1),
('WEAPON_NIGHTSTICK','Police Baton', 1, 0, 1),
('WEAPON_PETROLCAN','Petrol Can', 1, 0, 1),
('WEAPON_PIPEBOMB','Pipe Bomb', 1, 0, 1),
('WEAPON_PISTOL','Pistol', 1, 0, 1),
('WEAPON_PISTOL50','Police .50', 1, 0, 1),
('WEAPON_POOLCUE','Pool Cue', 1, 0, 1),
('WEAPON_PROXMINE','Proximity Mine', 1, 0, 1),
('WEAPON_PUMPSHOTGUN','Pump Shotgun', 1, 0, 1),
('WEAPON_RAILGUN','Rail Gun', 1, 0, 1),
('WEAPON_REVOLVER','Revolver', 1, 0, 1),
('WEAPON_RPG','RPG', 1, 0, 1),
('WEAPON_SAWNOFFSHOTGUN','Sawn Off Shotgun', 1, 0, 1),
('WEAPON_SMG','SMG', 1, 0, 1),
('WEAPON_SMOKEGRENADE','Smoke Gernade', 1, 0, 1),
('WEAPON_SNIPERRIFLE','Sniper Rifle', 1, 0, 1),
('WEAPON_SNOWBALL','Snow Ball', 1, 0, 1),
('WEAPON_SNSPISTOL','SNS Pistol', 1, 0, 1),
('WEAPON_SPECIALCARBINE','Special Rifle', 1, 0, 1),
('WEAPON_STICKYBOMB','Sticky Bombs', 1, 0, 1),
('WEAPON_STINGER','Stinger', 1, 0, 1),
('WEAPON_STUNGUN','Police Taser', 1, 0, 1),
('WEAPON_SWITCHBLADE','Switch Blade', 1, 0, 1),
('WEAPON_VINTAGEPISTOL','Vintage Pistol', 1, 0, 1),
('WEAPON_WRENCH','Wrench', 1, 0, 1),
('disc_ammo_pistol','Pistol Ammo', 1, 0, 1),
('disc_ammo_pistol_large','Pistol Ammo Large', 1, 0, 1),
('disc_ammo_rifle','Rifle Ammo', 1, 0, 1),
('disc_ammo_rifle_large','Rifle Ammo Large', 1, 0, 1),
('disc_ammo_shotgun','Shotgun Shells', 1, 0, 1),
('disc_ammo_shotgun_large','Shotgun Shells Large', 1, 0, 1),
('disc_ammo_smg','SMG Ammo', 1, 0, 1),
('disc_ammo_smg_large','SMG Ammo Large', 1, 0, 1),
('disc_ammo_snp','Sniper Ammo', 1, 0, 1),
('disc_ammo_snp_large','Sniper Ammo Large', 1, 0, 1),
('odtablet','Tablet', 1, 0, 1),
('sapartmentkey2','SS Apartment Key #2', 1, 0, 1),
('housekey8','House Key #8', 1, 0, 1),
('housekey9','House Key #9', 1, 0, 1),
('housekey10','House Key #10', 1, 0, 1),
('housekey11','House Key #11', 1, 0, 1),
('housekey12','House Key #12', 1, 0, 1),
('housekey13','House Key #13', 1, 0, 1),
('housekey14','House Key #14', 1, 0, 1),
('housekey15','House Key #15', 1, 0, 1),
('housekey16','House Key #16', 1, 0, 1),
('housekey17','House Key #17', 1, 0, 1),
('housekey18','House Key #18', 1, 0, 1),
('housekey19','House Key #19', 1, 0, 1);
ShortWlf commented 2 years ago

the server will not be done today on 9/21/21, the live server may be active on 9/22 or 9/23 after reformat of items.

ShortWlf commented 2 years ago

pushing to live currently

ShortWlf commented 2 years ago

### Server is Live ( Happy Dance ) - " development is not complete things will be missing! "

ShortWlf commented 2 years ago

**This server has been moved to development mode only if you would like to be apart of the development group or testing group please feel free to add a comment to this post otherwise this server has been moved to closed development mode, anyone who had access no longer has access until they reapply and want to be an active part of development, and thanks to those who want to participate and be apart of this active development. i am sure some questions will be wanted to be answered, please direct those to my discord dm.**

ShortWlf commented 2 years ago

those that were active staff, can reapply, by stating here you that you want to be apart of the project, keep in mind i am wiping, characters and inventory's as this development is a rework of the servers entire framework.

ShortWlf commented 2 years ago

Updated inventory system to save, whenever the inventory is closed, or storage, also when a player quits the server, added to prevent null items, needs further testing with performance, use of multiple players.

Modded files essentialmode/server/main

line 75 - 85

Modded files inventoryhud - client / server

client lines - 160 - 172 server lines - 12 -21

ShortWlf commented 2 years ago

### failed code commitment, server being redeveloped to latest release of fivem and modules

ShortWlf commented 2 years ago

Started development on our new framework, so far this is looking amazing.

TankinTom commented 2 years ago

I'd like to help test with the project. You know I don't know much about coding, but I love help testing.

ShortWlf commented 2 years ago
ShortWlf commented 2 years ago

inventory hot key needs to be changed, need to add a trainer for admins.

ShortWlf commented 2 years ago

first time connection did not reach communication with character creation menu

ShortWlf commented 2 years ago
Gamemastertwig commented 2 years ago

I can help some this Saturday during the day and a some over thanksgiving break

Gamemastertwig commented 2 years ago

weekday evenings will be more ad-hoc

ShortWlf commented 2 years ago
QBCore = nil 

Citizen.CreateThread(function()
   while QBCore == nil do
    TriggerEvent('QBCore:GetObject', function(obj) QBCore = obj end)
    Citizen.Wait(30) -- Saniye Bekletme
   end
end)
ShortWlf commented 2 years ago
--Client Side

esx:onPlayerDeath -> hospital:server:SetDeathStatus

esx:playerLoaded -> QBCore:Client:OnPlayerLoaded

esx:showAdvancedNotification -> QBCore:Notify

esx:showHelpNotification -> QBCore:Notify

esx:showNotification -> QBCore:Notify

ESX.GetPlayerData -> QBCore.Functions.GetPlayerData

ESX.IsPlayerLoaded -> None

ESX.SetPlayerData -> QBCore:Player:SetPlayerData

ESX.TriggerServerCallback -> QBCore.Functions.TriggerCallback

ESX.Game.DeleteObject -> None (Can use FiveM native DeleteEntity)

ESX.Game.DeleteVehicle -> QBCore.Functions.DeleteVehicle

ESX.Game.GetClosestObject -> None (Can use FiveM native GetClosestObjectOfType)

ESX.Game.GetClosestPed -> QBCore.Functions.GetClosestPed

ESX.Game.GetClosestPlayer -> QBCore.Functions.GetClosestPlayer

ESX.Game.GetClosestVehicle -> QBCore.Functions.GetClosestVehicle

ESX.Game.GetObjects -> None (uses enumeration)

ESX.Game.GetPedMugshot -> None (Can use FiveM native RegisterPedheadshot)

ESX.Game.GetPeds -> None (uses enumeration)

ESX.Game.GetPlayers -> QBCore.Functions.GetPlayers

ESX.Game.GetPlayersInArea -> None (uses enumeration)

ESX.Game.GetVehicleInDirection -> None (uses ray casting)

ESX.Game.GetVehicles -> QBCore.Functions.GetVehicles

ESX.Game.GetVehiclesInArea -> None (uses enumeration)

ESX.Game.IsSpawnPointClear -> None (uses getvehiclesinarea)

ESX.Game.SetVehicleProperties -> QBCore.Functions.SetVehicleProperties

ESX.Game.SpawnLocalObject -> None (dont bother)

ESX.Game.SpawnLocalVehicle -> None (dont bother)

ESX.Game.SpawnObject -> None (Can use FiveM Native CreateObject)

ESX.Game.SpawnVehicle -> QBCore.Functions.SpawnVehicle

ESX.Game.Teleport -> (Can use FiveM Native SetEntityCoords and SetEntityHeading)

ESX.Game.Utils.DrawText3D -> QBCore.Functions.DrawText3D

--Server Side

ESX.CreatePickup -> None (irrelevant and done through qb-inventory)

ESX.GetItemLabel -> None (Just returns item label)

ESX.GetPlayerFromId -> QBCore.Functions.GetPlayer

ESX.GetPlayerFromIdentifier -> QBCore.Functions.GetPlayerByCitizenId

ESX.GetPlayers -> QBCore.Functions.GetPlayers

ESX.RegisterServerCallback -> QBCore.Functions.CreateCallback

ESX.RegisterUsableItem -> QBCore.Functions.CreateUseableItem

ESX.SavePlayer -> QBCore.Player.Save

ESX.SavePlayers -> None (dont bother)

ESX.Trace -> Use QBCore.Debug but dont bother converting this

ESX.UseItem -> QBCore.Functions.UseItem

--xPlayer

xPlayer.addAccountMoney -> xPlayer.Functions.AddMoney (account)

xPlayer.addInventoryItem -> xPlayer.Functions.AddItem (item name)

xPlayer.addMoney -> xPlayer.Functions.AddMoney (cash)

xPlayer.addWeapon -> xPlayer.Functions.AddItem (weapon name)

xPlayer.addWeaponAmmo -> xPlayer.Functions.AddItem (ammo name)

xPlayer.addWeaponComponent -> xPlayer.Functions.AddItem (component name)

xPlayer.canCarryItem -> None (xPlayer.Functions.AddItem already checks this)

xPlayer.canSwapItem -> None (xPlayer.Functions.AddItem already checks this)

xPlayer.getAccount -> None (use player data)

xPlayer.getAccounts -> None (use player data)

xPlayer.getCoords -> None (Can use FiveM Native GetEntityCoords)

xPlayer.getGroup -> xPlayer.Functions.GetPermission

xPlayer.getIdentifier -> xPlayer.Functions.GetIdentifier

xPlayer.getInventory -> QBCore.Player.LoadInventory

xPlayer.getInventoryItem -> xPlayer.Functions.GetItemByName

xPlayer.getJob -> None (use player data)

xPlayer.getLoadout -> None (fuck loadouts)

xPlayer.getMoney -> None (use player data)

xPlayer.getName -> None (use player data)

xPlayer.getWeapon -> xPlayer.Functions.GetItemByName (weapon name)

xPlayer.getWeight -> xPlayer.Player.GetTotalWeight

xPlayer.hasWeapon -> xPlayer.Functions.GetItemByName (weapon name)

xPlayer.hasWeaponComponent -> xPlayer.Functions.GetItemByName (component name)

xPlayer.kick -> xPlayer.Functions.Kick

xPlayer.removeAccountMoney -> xPlayer.Functions.RemoveMoney (account)

xPlayer.removeInventoryItem -> xPlayer.Functions.RemoveItem (item name)

xPlayer.removeMoney -> xPlayer.Functions.RemoveMoney (cash)

xPlayer.removeWeapon -> xPlayer.Functions.RemoveItem (weapon name)

xPlayer.removeWeaponAmmo -> xPlayer.Functions.RemoveItem (ammo name)

--xPlayer #2

xPlayer.removeWeaponComponent -> xPlayer.Functions.RemoveItem (component name)

xPlayer.setAccountMoney -> xPlayer.Functions.SetMoney (account)

xPlayer.setCoords -> None (used for teleporting)

xPlayer.setInventoryItem -> xPlayer.Functions.AddItem (item name)

xPlayer.setJob -> xPlayer.Functions.SetJob

xPlayer.setMaxWeight -> None (It is set in qb-core config)

xPlayer.setMoney -> xPlayer.Functions.SetMoney

xPlayer.setName -> None (dont bother)

xPlayer.setWeaponTint -> None (qb-weapons does this)

xPlayer.showHelpNotification -> TriggerClientEvent('QBCore:Notify')

xPlayer.showNotification -> TriggerClientEvent('QBCore:Notify')

xPlayer.triggerEvent -> None (dont bother)

xPlayer.updateCoords -> None (dont bother)

--Events

esx:getSharedObject -> QBCore:GetObject

esx:setJob -> QBCore:Client:OnJobUpdate

esx:onPlayerSpawn -> QBCore:Client:OnPlayerLoaded

playerSpawned -> QBCore:Client:OnPlayerLoaded (spawnmanager compatibility)

esx:addInventoryItem -> QBCore:Server:AddItem

esx:removeInventoryItem -> QBCore:Server:RemoveItem

esx:useItem -> QBCore:Server:UseItem

MySQL.Async.fetchScalar() -> exports['ghmattimysql']:scalar() or QBCore.Functions.ExecuteSql(true,

MySQL.Async.fetchAll() -> exports['ghmattimysql']:execute() or QBCore.Functions.ExecuteSql(true,

MySQL.Async.execute() -> exports['ghmattimysql']:execute() or QBCore.Functions.ExecuteSql(false,
ShortWlf commented 2 years ago

a good fair share of broken mechanics, one giving items to another player from the inventory. code put into place, but needs testing!

Client

-- new code needs to be tested - ShortWlf
--[[
RegisterNUICallback("GiveItem", function(data, cb)
    if not isCrafting then
        QBCore.Functions.GetPlayerData(function(PlayerData)
            local player, distance = GetClosestPlayer()
            if player ~= -1 and distance < 2.5 then  --checks distance first
                local playerPed = GetPlayerPed(player)
                local playerId = GetPlayerServerId(player)
                local plyCoords = GetEntityCoords(playerPed)
                local pos = GetEntityCoords(GetPlayerPed(-1))
                local dist = #(vector3(pos.x, pos.y, pos.z) - vector3(plyCoords.x, plyCoords.y, plyCoords.z))
                if dist < 2.5 and not PlayerData.metadata["isdead"] and not PlayerData.metadata["inlaststand"] and not PlayerData.metadata["ishandcuffed"] and not IsPauseMenuActive() then --checks what the player is doing
                    SetCurrentPedWeapon(PlayerPedId(),'WEAPON_UNARMED',true)
                    TriggerEvent('animations:client:EmoteCommandStart', {"point"})
                    Wait(750)
                    TriggerEvent('animations:client:EmoteCommandStart', {"c"})
                    TriggerServerEvent("inventory:server:GiveItem", playerId, data.inventory, data.item, data.amount)
                else
                    QBCore.Functions.Notify("Cant give item!", "error")
                end
            else
                QBCore.Functions.Notify("No one nearby!", "error")
            end
        end)
    else
        QBCore.Functions.Notify("Cant give item!", "error")
    end
end)
]]
-- new code needs to be tested - ShortWlf

Server

-- new code -- needs to be tested - ShortWlf
--[[
RegisterNetEvent("inventory:server:GiveItem", function(name, inventory, item, amount)
    local src = source
    local Player = QBCore.Functions.GetPlayer(src)
    local OtherPlayer = QBCore.Functions.GetPlayer(tonumber(name))
    local Target = OtherPlayer.PlayerData.charinfo.firstname..' '..OtherPlayer.PlayerData.charinfo.lastname
    local Sender = Player.PlayerData.charinfo.firstname..' '..Player.PlayerData.charinfo.lastname
    if amount ~= 0 then
        if Player.Functions.RemoveItem(item.name, amount,false, item.info) and OtherPlayer.Functions.AddItem(item.name, amount,false, item.info) then
            TriggerClientEvent('QBCore:Notify', src, "You gave " ..amount.. ' '..item.label..' to '..Target)
            TriggerClientEvent('inventory:client:ItemBox',src, QBCore.Shared.Items[item.name], "remove")
            TriggerClientEvent('QBCore:Notify', name, "You got " ..amount.. ' ' ..item.label..' from '..Sender)
            TriggerClientEvent('inventory:client:ItemBox',name, QBCore.Shared.Items[item.name], "add")
        else
            TriggerClientEvent('QBCore:Notify', src, "Cant give item!", "error")
        end
    end
end)
]]
-- new code -- needs to be tested - ShortWlf

QB Core - aj-inventory github - updated recently ' incompatible with current ' https://github.com/ihyajb/aj-inventory

ShortWlf commented 2 years ago

fixed removal of items upon respawn at the hospital

Server

RegisterServerEvent('hospital:server:RespawnAtHospital')
AddEventHandler('hospital:server:RespawnAtHospital', function()
    local src = source
    local Player = QBCore.Functions.GetPlayer(src)
    for k, v in pairs(Config.Locations["beds"]) do
        TriggerClientEvent('hospital:client:SendToBed', src, k, v, true)
        TriggerClientEvent('hospital:client:SetBed', -1, k, true)
--      Player.Functions.ClearInventory()
        QBCore.Functions.ExecuteSql(true, "UPDATE `players` SET `inventory` = '"..QBCore.EscapeSqli(json.encode({})).."' WHERE `citizenid` = '"..Player.PlayerData.citizenid.."'")
        Player.Functions.RemoveMoney("bank", Config.BillCost, "respawned-at-hospital")
--      TriggerClientEvent('QBCore:Notify', src, 'All your possessions have been taken..', 'error')
        TriggerClientEvent('hospital:client:SendBillEmail', src, Config.BillCost)
        return
    end
end)
ShortWlf commented 2 years ago

Text on searching trash cans needs to be translated.

ShortWlf commented 2 years ago

Giving items via inventory not working

ShortWlf commented 2 years ago

updating framework to latest version of qbcore