Giter Club home page Giter Club logo

azael_vehiclekeys's Introduction

azael_vehiclekeys

FiveM - Vehicle Keys (Lock System)

ความต้องการ

ดาวน์โหลด

ใช้ Git

cd resources
git clone https://github.com/Azael-Dev/azael_vehiclekeys [local]/[azael]/[system]/azael_vehiclekeys

ด้วยตนเอง

ติดตั้ง

  • สามารถตรวจสอบการกำหนดค่าเพิ่มเติมได้ที่ config

server.cfg

  • เพิ่มสิ่งนี้ไปยัง server.cfg ด้านล่าง ox_lib, ox_inventory
ensure azael_vehiclekeys

ox_inventory

  • ไปยัง ox_inventory/data/items.lua และดำเนินการเพิ่มรหัสด้านล่างนี้
["vehicle_key"] = {
    label = "Vehicle Key",
    description = "Vehicle Key",
    weight = 500,
    stack = false,
    close = true,
    consume = 0,
    client = {
        image = "keys.png",
        export = 'azael_vehiclekeys.useItem',
    }
},

ฟังก์ชันส่งออก (ฝั่งเซิร์ฟเวอร์)

AddKey

  • เพิ่ม กุญแจยานพาหนะ ไปยังกระเป๋าของผู้เล่น
exports.azael_vehiclekeys:AddKey(source, plate, description)

Parameter

Name Type Required Description
source number ✔️ NetID (Player ID) ของผู้เล่น
plate string ✔️ ป้ายทะเบียน ยานพาหนะ
description string / nil คำอธิบายเพิ่มเติม

RemoveKey

  • ลบ กุญแจยานพาหนะ ออกจากกระเป๋าของผู้เล่น
exports.azael_vehiclekeys:RemoveKey(source, plate, strict)

Parameter

Name Type Required Description
source number ✔️ NetID (Player ID) ของผู้เล่น
plate string ✔️ ป้ายทะเบียน ยานพาหนะ
strict boolean / nil ตรวจสอบ plate ใน metadata อย่างเข้มงวด

ตัวอย่าง

  • อ้างอิงจาก esx_vehicleshop เวอร์ชันล่าสุด

เพิ่มกุญแจเมื่อซื้อยานพาหนะ

  • ไปที่ esx_vehicleshop/server/main.lua ค้นหา TaskWarpPedIntoVehicle(GetPlayerPed(source), vehicle, -1) (#166) และวางรหัสด้านล่างนี้ต่อ
local vehicle = getVehicleFromModel(model)

pcall(function()
    exports.azael_vehiclekeys:AddKey(xPlayer.source, plate, ('Type: %s  \nName: %s  \nPlate: %s'):format(vehicle.categoryLabel, vehicle.name, plate))
end)

ลบกุญแจเมื่อขายยานพาหนะ

  • ไปที่ esx_vehicleshop/server/main.lua ค้นหา xPlayer.addMoney(resellPrice, "Sold Vehicle") และวางรหัสด้านล่างนี้ต่อจาก RemoveOwnedVehicle(plate) (#309)
pcall(function()
    exports.azael_vehiclekeys:RemoveKey(xPlayer.source, plate, false)
end)

เครดิต

กฎหมาย

ใบอนุญาต

ลิขสิทธิ์ (C) Azael Dev - สงวนลิขสิทธิ์

  • ห้ามใช้ชิ้นส่วนใดๆ ของซอฟต์แวร์นี้ในผลิตภัณฑ์ / บริการเชิงพาณิชย์
  • ห้ามนำซอฟต์แวร์นี้ไปขายต่อ
  • คุณจะต้องไม่จัดหาสิ่งอำนวยความสะดวกใด ๆ ในการติดตั้งซอฟต์แวร์นี้ในผลิตภัณฑ์ / บริการเชิงพาณิชย์
  • หากคุณแจกจ่ายซอฟต์แวร์นี้ใหม่ คุณต้องเชื่อมโยงไปยังที่เก็บดั้งเดิมที่ azael_vehiclekeys
  • ลิขสิทธิ์นี้ควรปรากฏในทุกส่วนของรหัสโครงการ

License (ENG): https://github.com/Azael-Dev/azael_vehiclekeys/blob/main/LICENSE

azael_vehiclekeys's People

Contributors

azael-dev avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.