Security HUD
System Watchdog
×
Threads Scanned
-- / --
SYS. LOAD --%
AI SHIELD ACTIVE
DMCA Policy
×

📋 DMCA Compliance

This platform and community fully complies with the Digital Millennium Copyright Act (DMCA) and international copyright laws. We take all copyright protection seriously.

🛡️ Copyright Protection

If you believe a posted item belongs to you or violates your copyright, you may file a DMCA takedown request through our official channels. Upon receiving a valid claim, the infringing content will be removed within 24 hours.

What's new
×
Fiveguard

Script 🚗 STG_Vehicleshop | Advanced Vehicle Shop Script | Car dealer 🚙

gokhantoprak

Silver Elite
Joined
Nov 12, 2024
Messages
19
Reaction score
21
Points
166
Location
Türkiye
for ext but who's wanna use

Proposed Changes​


fxmanifest.lua​

  • Remove es_extended dependency (if any implicit ones exist, though none were explicitly listed as dependencies, the code requires it).
  • Add qb-core dependency.
  • Ensure oxmysql is used if available, or keep mysql-async if the server supports it (QBCore usually does).


main/server.lua​

  • Initialization: Change ESX = exports["es_extended"]:getSharedObject() to local QBCore = exports['qb-core']:GetCoreObject().
  • Callbacks:
    • Convert ESX.RegisterServerCallback to QBCore.Functions.CreateCallback.
    • Update stg_vehicleshop:getMoney to use Player.Functions.GetMoney and Player.Functions.RemoveMoney.
    • Update stg_vehicleshop:isPlateTaken to use QBCore's method or keep the direct MySQL query if it fits (QBCore usually has QBCore.Functions.IsPlateTaken but direct SQL is fine too).
  • Events:
    • Update stg_vehicleshop:buyVehicle to get the player using QBCore.Functions.GetPlayer(source).
    • Update SQL insert for owned_vehicles to match QBCore's schema (usually citizenid instead of identifier, and plate, vehicle (json)).
      • Critical: Check if owned_vehicles column is citizenid or license/steam. QBCore default is citizenid. ESX is identifier. I'll need to check the DB schema or assume standard QBCore citizenid.


main/client.lua​

  • Initialization: Change ESX = exports["es_extended"]:getSharedObject() to local QBCore = exports['qb-core']:GetCoreObject().
  • Callbacks:
    • Change ESX.TriggerServerCallback to QBCore.Functions.TriggerCallback.
  • Vehicle Properties:
    • Change ESX.Game.GetVehicleProperties to QBCore.Functions.GetVehicleProperties.
    • Change ESX.Game.SetVehicleProperties to QBCore.Functions.SetVehicleProperties.
  • Plate Generation:
    • Ensure plate generation format matches QBCore expectations (usually 8 alphanumeric). The current one seems to be 3 letters + 3 numbers (6 chars) or similar. QBCore default is 8. I'll stick to the script's format unless it errors, but QBCore.Shared.Trim(plate) might be needed if whitespace is issues.
 

MissBeta

Bronze Elite
Joined
Aug 13, 2024
Messages
10
Reaction score
719
Points
296
Location
FiveM
for ext but who's wanna use

Proposed Changes​

fxmanifest.lua​

  • Remove es_extended dependency (if any implicit ones exist, though none were explicitly listed as dependencies, the code requires it).
  • Add qb-core dependency.
  • Ensure oxmysql is used if available, or keep mysql-async if the server supports it (QBCore usually does).

main/server.lua​

  • Initialization: Change ESX = exports["es_extended"]:getSharedObject() to local QBCore = exports['qb-core']:GetCoreObject().
  • Callbacks:
    • Convert ESX.RegisterServerCallback to QBCore.Functions.CreateCallback.
    • Update stg_vehicleshop:getMoney to use Player.Functions.GetMoney and Player.Functions.RemoveMoney.
    • Update stg_vehicleshop:isPlateTaken to use QBCore's method or keep the direct MySQL query if it fits (QBCore usually has QBCore.Functions.IsPlateTaken but direct SQL is fine too).
  • Events:
    • Update stg_vehicleshop:buyVehicle to get the player using QBCore.Functions.GetPlayer(source).
    • Update SQL insert for owned_vehicles to match QBCore's schema (usually citizenid instead of identifier, and plate, vehicle (json)).
      • Critical: Check if owned_vehicles column is citizenid or license/steam. QBCore default is citizenid. ESX is identifier. I'll need to check the DB schema or assume standard QBCore citizenid.

main/client.lua​

  • Initialization: Change ESX = exports["es_extended"]:getSharedObject() to local QBCore = exports['qb-core']:GetCoreObject().
  • Callbacks:
    • Change ESX.TriggerServerCallback to QBCore.Functions.TriggerCallback.
  • Vehicle Properties:
    • Change ESX.Game.GetVehicleProperties to QBCore.Functions.GetVehicleProperties.
    • Change ESX.Game.SetVehicleProperties to QBCore.Functions.SetVehicleProperties.
  • Plate Generation:
    • Ensure plate generation format matches QBCore expectations (usually 8 alphanumeric). The current one seems to be 3 letters + 3 numbers (6 chars) or similar. QBCore default is 8. I'll stick to the script's format unless it errors, but QBCore.Shared.Trim(plate) might be needed if whitespace is issues.
thanks!
 
Top