ALL SCRIPTS ESCROWED USING FIVEM ESCROW SYSTEM
QB Required
Ox Lib Required
StreetCode Drug Network turns drug sales into a server-wide customer network instead of a basic NPC sell interaction.
Customers persist in SQL, have their own identities, locations, ped models, personalities, cooldowns, and dealer history.
And most importantly:
A customer who doesn't get the deal they want from one player can continue looking for another available dealer.
Customers aren't permanently attached to one player.
The system tracks which dealers a customer has successfully dealt with, including drug-specific history.
That means the same customer can build relationships with multiple dealers across your server.
The customer's dealer history is stored by:
Every customer is assigned a personality when created.
Prefers dealers they've dealt with before.
Looks at previous prices and favors known dealers with lower recorded prices.
More willing to try new dealers.
More likely to shop around between dealers.
Less concerned with dealer history and more focused on finding someone available.
Favors dealers with stronger completed-deal history.
Balanced customer behavior.
These personalities actually affect which dealer the customer chooses, rather than being cosmetic labels.
Customer history is separated by drug.
A customer's previous cocaine price isn't automatically treated as their previous weed, meth, or other drug price.
The dealer-history lookup specifically filters by the requested item.
This allows customers to develop different pricing histories with different dealers for different products.
When a customer contacts a dealer, the request contains:
Players can:
ACCEPT
DECLINE
COUNTER OFFER
If a player declines, the customer can move on to another available dealer.
If a player makes a counteroffer the customer won't accept, the customer can continue shopping.
The system also keeps track of previous dealers and prices during that negotiation.
Customers don't immediately throw the negotiation menu onto the player's screen.
The customer first initiates an incoming call.
Players get:
H β Answer
G β Decline
Answering transitions into the actual customer negotiation.
Declining or missing the call ends the interaction appropriately.
Players can customize the ringtone used for customer calls.
Simply use:
The script validates the YouTube URL and updates the player's ringtone for future customer calls.
Bring your own ringtone.
Accepting a deal doesn't instantly complete the sale.
The customer creates an active meetup containing:
The player receives the customer's coordinates and is sent to the actual customer location.
Players physically travel to the customer and complete the transaction at the meetup.
Admins can create customers directly in-game.
Example:
or:
The system:
The customer then becomes part of the persistent customer network.
Customers aren't just temporary peds.
Their:
are stored with the customer record.
When players are near a customer, the NPC is streamed in; when they're far away, the customer is removed from the local world and can be spawned again when needed.
A customer can:
Contact Dealer A
β
Dealer A declines
Contact Dealer B
β
Dealer B counteroffers too high
Contact Dealer C
The system prevents the customer from repeatedly contacting the same dealer during that negotiation and avoids dealers who are already handling another active meetup.
That creates an actual server-wide market, rather than every player having their own isolated NPC sellers.
Customers and dealer relationships are stored in SQL.
The relationship table records:
So the customer network isn't simply reset every time the resource restarts.
The actual transaction is handled server-side.
The server verifies:
The drug isn't removed until the server confirms the player actually has the requested quantity.
The script also supports a configurable police-alert chance.
When an alert is triggered, the police-side client can receive the customer's location and set a waypoint for the response. The current implementation checks the player's ESX job before displaying the alert waypoint.
StreetCode isn't just:
NPC β Sell β Money
It's:
And that history feeds back into the customer's future dealer selection.
The more your server uses it, the more interconnected the customer network becomes.
π Server-Wide Customer Network
π§ 7 Customer Personalities
π° Drug-Specific Dealer History
π€ Accept / Decline / Counteroffer
π Incoming Customer Calls
π΅ Custom YouTube Ringtones
π Physical Customer Meetups
π§ Persistent Customer NPCs
π Customers Shop Between Dealers
ποΈ SQL Persistence
π‘οΈ Server-Side Transaction Validation
π Police Alert Chance