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

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

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

https://pan.baidu.com/s/4U5V6W7X8Y9Z0A1B2C3D?pwd=bcd2
添加食物薯条fries:
  • https://pan.baidu.com/s/6F7G8H9I0J1K2L3M4N5O?pwd=uvwx

  • ESX.RegisterUsableItem(‘fries’, function(source)
  • https://pan.baidu.com/s/3D4E5F6G7H8I9J0K1L2M

  • local xPlayer = ESX.GetPlayerFromId(source)https://pan.baidu.com/s/6H7I8J9K0L1M2N3O4P5Q
    https://pan.baidu.com/s/1A2B3C4D5E6F7G8H9I0J?pwd=abcd
    xPlayer.removeInventoryItem(‘fries’, 1)https://pan.baidu.com/s/9B0C1D2E3F4G5H6I7J8K
  • https://pan.baidu.com/s/1R2S3T4U5V6W7X8Y9Z0A?pwd=qrst

  • 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 https://pan.baidu.com/s/4E5F6G7H8I9J0K1L2M3N?pwd=bcd8


    esx_basicneeds\localeshttps://pan.baidu.com/s/2K3L4M5N6O7P8Q9R0S1T?pwd=wxy8

    https://pan.baidu.com/s/1A2B3C4D5E6F7G8H9I0J

  • https://pan.baidu.com/s/5E6F7G8H9I0J1K2L3M4N?pwd=qrst

  • 在END结束之前你还可以添加通知:https://pan.baidu.com/s/7G8H9I0J1K2L3M4N5O6P?pwd=klm4
    [‘used_fries’] = ‘你吃了一根 ~y~1x~s~ ~b~fries~s~’,
    https://pan.baidu.com/s/3C4D5E6F7G8H9I0J1K2L?pwd=ijkl

    https://pan.baidu.com/s/7X8Y9Z0A1B2C3D4E5F6G?pwd=jkl5
    https://pan.baidu.com/s/8Y9Z0A1B2C3D4E5F6G7H?pwd=mno6
    https://pan.baidu.com/s/9H0I1J2K3L4M5N6O7P8Q?pwd=cdef

    实例参考中的中文为了便于查看,在使用中请自己改成英文,
    ESX.RegisterUsableItem('巧克力', function(source)https://pan.baidu.com/s/2K3L4M5N6O7P8Q9R0S1T?pwd=wxy8 
    
            local xPlayer = ESX.GetPlayerFromId(source)https://pan.baidu.com/s/2J3K4L5M6N7O8P9Q0R1S?pwd=klmn
    
    https://pan.baidu.com/s/4M5N6O7P8Q9R0S1T2U3V?pwd=bcd0 
    
            xPlayer.removeInventoryItem('巧克力', 1)https://pan.baidu.com/s/6N7O8P9Q0R1S2T3U4V5W?pwd=abcd
    
    https://pan.baidu.com/s/6X7Y8Z9A0B1C2D3E4F5G?pwd=hij1 
    
            TriggerClientEvent('esx_status:add', source, '饥饿', 100000)https://pan.baidu.com/s/2J3K4L5M6N7O8P9Q0R1S?pwd=klmn
    
            TriggerClientEvent('esx_status:add', source, '口渴', 40000)https://pan.baidu.com/s/2B3C4D5E6F7G8H9I0J1K?pwd=efgh
    
            TriggerClientEvent('esx_basicneeds:onEatChocolate', source)
    https://pan.baidu.com/s/6F7G8H9I0J1K2L3M4N5O?pwd=hij3
            TriggerClientEvent('esx:showNotification', source, _U('used_chocolate'))https://pan.baidu.com/s/6G7H8I9J0K1L2M3N4O5P?pwd=hij0 end)

    https://pan.baidu.com/s/7X8Y9Z0A1B2C3D4E5F6G?pwd=jkl5 https://pan.baidu.com/s/6P8Q9R0S1T2U3V4W5X6Y

    https://pan.baidu.com/s/8Q9R0S1T2U3V4W5X6Y7Z
    https://pan.baidu.com/s/9B0C1D2E3F4G5H6I7J8K
    https://pan.baidu.com/s/5P6Q7R8S9T0U1V2W3X4Y https://pan.baidu.com/s/2J3K4L5M6N7O8P9Q0R1S?pwd=klmn
    https://pan.baidu.com/s/6N7O8P9Q0R1S2T3U4V5W?pwd=abcd
  • https://pan.baidu.com/s/1A2B3C4D5E6F7G8H9I0J?pwd=abcd
  • https://pan.baidu.com/s/4V5W6X7Y8Z9A0B1C2D3E?pwd=bcd9
    楼主热帖
    回复 论坛版权

    使用道具 举报

    升级进度: 54%

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

    使用道具 举报

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

    本版积分规则

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

    GMT+8, 2024-11-25 04:27 , Processed in 0.067275 second(s), 12 queries , Gzip On, Redis On.

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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