查看: 1156|回复: 1
收起左侧

[文字教程] 将食品添加到 Fivem服务器

[复制链接]
admin 发表于 2021-11-3 23:36:10 | 显示全部楼层 |阅读模式
添加食物所在文件如下esx_basicneeds\server\main.lua

https://pan.baidu.com/s/7G8H9I0J1K2L3M4N5O6P?pwd=yza1 https://pan.baidu.com/s/4D5E6F7G8H9I0J1K2L3M?pwd=bcd1


https://pan.baidu.com/s/5W6X7Y8Z9A0B1C2D3E4F

添加食物薯条fries:https://pan.baidu.com/s/5V6W7X8Y9Z0A1B2C3D4E?pwd=efg3
ESX.RegisterUsableItem(‘fries’, function(source)https://pan.baidu.com/s/5O7P8Q9R0S1T2U3V4W5X
local xPlayer = ESX.GetPlayerFromId(source)
  • https://pan.baidu.com/s/5F6G7H8I9J0K1L2M3N4O?pwd=efg9

  • https://pan.baidu.com/s/1L2M3N4O5P6Q7R8S9T0U
    xPlayer.removeInventoryItem(‘fries’, 1)
    https://pan.baidu.com/s/2M3N4O5P6Q7R8S9T0U1V

    https://pan.baidu.com/s/3T4U5V6W7X8Y9Z0A1B2C?pwd=yza1
    TriggerClientEvent('esx_status:add', source, 'hunger', 100000)TriggerClientEvent('esx_basicneeds:onEat', source)xPlayer.showNotification(_U('used_fries'))end)https://pan.baidu.com/s/9I0J1K2L3M4N5O6P7Q8R?pwd=qrs6
    esx_basicneeds\localeshttps://pan.baidu.com/s/9A0B1C2D3E4F5G6H7I8J
    https://pan.baidu.com/s/5X6Y7Z8A9B0C1D2E3F4G
    在END结束之前你还可以添加通知:

    https://pan.baidu.com/s/7I8J9K0L1M2N3O4P5Q6R https://pan.baidu.com/s/9J0K1L2M3N4O5P6Q7R8S


    [‘used_fries’] = ‘你吃了一根 ~y~1x~s~ ~b~fries~s~’,

    https://pan.baidu.com/s/6F7G8H9I0J1K2L3M4N5O https://pan.baidu.com/s/4D5E6F7G8H9I0J1K2L3M?pwd=bcd1


    https://pan.baidu.com/s/1A2B3C4D5E6F7G8H9I0J?pwd=stu8
    https://pan.baidu.com/s/6F7G8H9I0J1K2L3M4N5O?pwd=hij3
    https://pan.baidu.com/s/2K3L4M5N6O7P8Q9R0S1T?pwd=wxy8
    实例参考中的中文为了便于查看,在使用中请自己改成英文,
    ESX.RegisterUsableItem('巧克力', function(source)
    https://pan.baidu.com/s/4M5N6O7P8Q9R0S1T2U3V
            local xPlayer = ESX.GetPlayerFromId(source)https://pan.baidu.com/s/2C3D4E5F6G7H8I9J0K1L https://pan.baidu.com/s/6O7P8Q9R0S1T2U3V4W5X         xPlayer.removeInventoryItem('巧克力', 1)
    https://pan.baidu.com/s/9R0S1T2U3V4W5X6Y7Z8A
    https://pan.baidu.com/s/9Q0R1S2T3U4V5W6X7Y8Z?pwd=mnop         TriggerClientEvent('esx_status:add', source, '饥饿', 100000)https://pan.baidu.com/s/1L2M3N4O5P6Q7R8S9T0U         TriggerClientEvent('esx_status:add', source, '口渴', 40000)
  • https://pan.baidu.com/s/7H8I9J0K1L2M3N4O5P6Q
  •         TriggerClientEvent('esx_basicneeds:onEatChocolate', source)https://pan.baidu.com/s/8R0S1T2U3V4W5X6Y7Z8A         TriggerClientEvent('esx:showNotification', source, _U('used_chocolate'))https://pan.baidu.com/s/3N4O5P6Q7R8S9T0U1V2W end)
    https://pan.baidu.com/s/4F5G6H7I8J9K0L1M2N3O
    https://pan.baidu.com/s/9R0S1T2U3V4W5X6Y7Z8A?pwd=qrs5

    https://pan.baidu.com/s/9I0J1K2L3M4N5O6P7Q8R?pwd=qrs6
    https://pan.baidu.com/s/5P6Q7R8S9T0U1V2W3X4Y
    https://pan.baidu.com/s/4U5V6W7X8Y9Z0A1B2C3D?pwd=bcd2

  • 哈哈

  • https://pan.baidu.com/s/1K2L3M4N5O7P8Q9R0S1T

    https://pan.baidu.com/s/1S2T3U4V5W6X7Y8Z9A0B?pwd=tuv6
    楼主热帖
    回复 论坛版权

    使用道具 举报

    升级进度: 54%

    StitcH1111 发表于 2022-4-10 00:37:09 | 显示全部楼层
    沒有檔案Q
    我要说一句 收起回复
    回复

    使用道具 举报

    文明发言,和谐互动
    文明发言,和谐互动
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    QQ|Archiver|小黑屋|首页 ( 冀ICP备2021005225号-1 ) |网站地图

    GMT+8, 2024-11-25 04:21 , Processed in 0.063708 second(s), 13 queries , Gzip On, Redis On.

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

    快速回复 返回顶部 返回列表