Uber Eats (ESX, QB)


Summary

this script provides players to open up a menu from anywhere and order foods like shopping, at the end they pay the money via bank account and an AI driver will arrives to deliver the order




Video


Purpose

usually players in many servers go to shops and buy their foods and that’s kind of boring, also they need to always go to the shops, no matter the situation that they are in, maybe they don’t have vehicle, maybe they are far away from the shop or even worst when they are dying because of hunger

so we can make it easy for players that they order foods by a menu and let AI handle the delivery, so easy and satisfying


How it Works

  1. player goes on street (somewhere that is accessible for AI)

  2. opens up the menu by a command like “/uberfood”

  3. can see the categories like burgers, sandwiches and drinks

  4. selects the items

  5. sets the count of each item at cart



  1. pays the money by bank account

  2. waits until AI driver arrives


AI Behaviour

AI cannot be killed, dragged out of car or any other stuffs, so players cannot troll the AI in order to sabotage. the AI vehicle will get repaired automatically every 5 seconds also vehicle is locked so players cannot get inside it


Possible Cases

1. player orders from inside a mlo or somewhere that is not accessible

since we set a maximum arrival time of AI (configurable at config.lua) if the AI does not reach the position that player ordered from it in that time then Ai will cancel the order with a percentage of penalty (for example 30% penalty) and returns the rest of money to player bank account, also player cannot order again for a certain (cooldown for noob players) also cooldown is configurable at config.lua


2. player does not take the order after AI arrives

at this case player has a timer (configurable at config.lua) after the AI arrives, it also shows that how much time player have to take order, if he doesn’t the AI will cancel the order with a percentage of penalty and not letting player to order again for a certain time


3. player gets dc

if player disconnect while he is waiting for the delivery, the delivery gets canceled and the AI ped will be deleted, also the whole money returns to player bank account


Config File


Config = {}

local second = 1000
local minute = 60 * second

-- ESX OPTIONS
Config.UseESX = true -- if you are using esx
Config.ESXTrigger = "esx:getSharedObject" -- Put your ESX Object Trigger Right Here

-- QB OPTIONS
Config.UseQB = false -- if you are using qb
Config.QBExport = "qb-core" -- Put your QB Object Export

Config.CallUberCommand = 'uberfood'
Config.CancelUberCommand = 'canceluber'

Config.MaxOrderForEachFood = 10 -- max order of each food while player is setting counts at cart

Config.Categories = {
	[1] = { -- must be a unique index number
		id = 'burger', -- must be unique and lower case
		label = 'Burger', -- can be upper case
		items = {
			chickenburger = { -- must be the exact name that exist on database
				label = 'Chicken Burger',
				price = 200,
				image = 'chickenburger.png', -- image name at img folder
				info  = 'In a medium bowl, add ground chicken, breadcrumbs, mayonnaise, onions, parsley, garlic, paprika, salt and pepper' -- some info about the food
				-- when player move mouse over the item the info will show up
			},
			doubleburger = {
				label = 'Double Burger',
				price = 400,
				image = 'doubleburger.png',
				info  = 'In a medium bowl, add ground chicken, breadcrumbs, mayonnaise, onions, parsley, garlic, paprika, salt and pepper'
			},
			stakeburger = {
				label = 'Stake Burger',
				price = 300,
				image = 'stakeburger.png',
				info  = 'In a medium bowl, add ground chicken, breadcrumbs, mayonnaise, onions, parsley, garlic, paprika, salt and pepper'
			},
			hamburger = {
				label = 'Simple Burger',
				price = 100,
				image = 'hamburger.png',
				info  = 'In a medium bowl, add ground chicken, breadcrumbs, mayonnaise, onions, parsley, garlic, paprika, salt and pepper'
			},
		}
	},
	[2] = {
		id = 'sandwich',
		label = 'Sandwich',
		items = {
			chickensandwich = {
				label = 'Chicken Sandwich',
				price = 200,
				image = 'chickensandwich.png',
				info  = 'Some Info'
			},
			hotdogsandwich = {
				label = 'Hotdog',
				price = 150,
				image = 'hotdogsandwich.png',
				info  = 'Some Info'
			},
			turkeysandwich = {
				label = 'Turkey Sandwich',
				price = 250,
				image = 'turkeysandwich.png',
				info  = 'Some Info'
			},
			mixsandwich = {
				label = 'Mix Sandwich',
				price = 250,
				image = 'mixsandwich.png',
				info  = 'Some Info'
			},
			chickenbucket = {
				label = 'Chicken Bucket',
				price = 100,
				image = 'chickenbucket.png',
				info  = 'Some Info'
			},
		}
	},
	[3] = {
		id = 'drinks',
		label = 'Drinks',
		items = {
			fanta = {
				label = 'Fanta',
				price = 20,
				image = 'fanta.png',
				info  = 'Some Info'
			},
			sprite = {
				label = 'Sprite',
				price = 20,
				image = 'sprite.png',
				info  = 'Some Info'
			},
		}
	}
}



-- AI And Delivery

Config.CompanyName = "Uber Eats"
Config.SpawnRadius = 200.0 -- the distance bewteen spawning the driver and player position (the position he ordered)
Config.Speed = 20.0
Config.DrivingStyle = 262463          -- https://vespura.com/fivem/drivingstyle/ you can also use 786603

-- if you order your foods while you are not on street then the AI gets confused, because ped can be inside somewhere that the AI cannot access
-- so we set a timer to teach players that if they do not order from the street then the driver will disappear after a while
Config.MaxTimerForArrvingOrder = second * 60 -- it means the moment player finishes his payment this timer will trigger and after the timer u set the driver will cancel the order
-- also remember the top amount depends on Config.SpawnRadius and Config.Speed too, for shorter range we set it low but when range increases we need to increase the time

Config.TimerAfterDeliveryArrived = 20 -- in seconds, after the driver arrives we can set a timer that if player does not take his order, the driver will cancel the order

-- canceling orders means penalty for players so we do not return all the money they spent for the order, we decrease a percent then we send back the money into player bank account
Config.PenaltyPercentageIfDriverGoesBack = 30 -- 30% of the total price will be decreased and the rest will add to player bank account
-- for example if the order cost was 400 dollar and the order gets canceled then we return 280 dollar to player bank account

-- if order gets canceled we also need to punish the player for preventing spamming and trolling the system
-- so we set a cooldown for the next time he wants to order again
Config.HowMuchTimePlayerMustWaitForOrderAgain = minute * 1 -- 1 min default

Config.UberPeds = {
--  * Find the icons here:      https://wiki.■■■■■■■■■■■/index.php?title=Notification_Pictures
--  * Find the ped models here: https://wiki.■■■■■■■■■■■/index.php?title=Peds
--  * Find the vehicles here    https://wiki.■■■■■■■■■■■/index.php?title=Vehicle_Models
--  * Find the colours here:    https://wiki.■■■■■■■■■■■/index.php?title=Vehicle_Colors

	[1] = {
		name = "Driver Tom",
		icon = "CHAR_JIMMY_BOSTON",
		model = "a_m_m_mexlabor_01",
		-- i recommend to not use high speed or sport cars because when AI arrives he might slide while breaking his vehicle
		-- also its better to not use bikes, maybe some noob players will kick the AI, although the AI does not die or stuck and will disappear after a while
		vehicle = 'kalahari', 
		colour = 111
	},

	[2] = {
		name = "Driver John",
		icon = "CHAR_JIMMY_BOSTON",
		model = "a_m_y_beach_01",
		vehicle = 'kalahari',
		colour = 118
	},
}	


Features

  • easy to configure everything
  • fully open source
  • you can add and define categories and foods
  • you can do any changes to AI
  • can be added to phone scripts too (there is guide file about it)
  • works well in every situation and no bug at all
  • considered any case of scenarios, so prevents any bug and interrupts
  • you set your own commands for ordering and canceling the order
  • easy to change translations
  • very cool and realistic UI
  • good performance 0.01 ms (passive) and 0.02 - 0.03 ms (while ordering)
  • very unique and new idea (no one did this before)

Requirements

  • ESX or QB
  • even for those not using ESX or QB is usable with a little changes

Tebex Link

you can buy the script from HERE



Also Check my Newest Project

recently I have made one of my biggest project that is esx_society remastered version , in other words I made a huge revolution for esx servers
the link : ESX Society Remastered + More Options


my Other Scripts

ESX Society Remastered
Realistic Fast Food
Advanced Lock System
ESX Car Bomb
ESX Books + Reading
VIP List + Test Drive
ESX Craft System
ESX Jobs List
ESX Document Robbery
ESX Multiple Simcards
Realistic Coffee Job



Code is accessible Yes
Subscription-based No
Lines (approximately) Near 1000
Requirements ESX, QB
Support Yes
2 Likes

Would be cool if you made this into a app on the phone instead of command

well there are many phone apps and we cannot decide which phone script we should add, thats the problem also i said in description that there is a guide file inside the script that teaches you how to add it as an app

2 Likes

should have a version of this as a job so players can take on the role of AI, would add chances for RP interactions, if no players are on duty then AI could take over again.

1 Like

the whole point of script is the AI, I already released a fast food job you can check it

1 Like

Cool script, great job man!

1 Like

tnx :slight_smile:

Some Times the NPC and the car does not disappear.
@equalize_r

hi please dm me

is there anyway to make so that the a item opens uber eats

Can you make it so that when a player orders some goods, it is a player who also delivers the goods or is it only AI that can deliver

its an AI