Skip to main content

nc_musicplayers

ตัวอย่างรหัสที่ใช้เพิ่มไปยังทรัพยากร nc_musicplayers เพื่อส่งข้อมูลมายัง azael_dc-serverlogs

danger

โปรดตรวจสอบตัวแปรของรหัสทุกครั้ง เนื่องจากเวอร์ชันของทรัพยากรในตัวอย่างอาจจะไม่มีความเข้ากันได้กับทรัพยากรในเวอร์ชันที่คุณกำลังใช้งานอยู่ และส่งผลให้ไม่มีการส่งข้อมูลไปยัง azael_dc-serverlogs เนื่องจากมีข้อผิดพลาดเกิดขึ้นจากรหัสที่คุณดำเนินการเพิ่ม

config.functions.server.lua

ไปยัง config.functions.server.lua แล้วดำเนินการเปิดไฟล์

ลำโพง-วาง

EventLabel
NC_MusicPlacedSpeakerลำโพง-วาง

วางรหัสด้านล่างนี้ภายใน Config.ServerPlacedBluetoothSpeaker = function

pcall(function()
exports['azael_dc-serverlogs']:insertData({
event = 'NC_MusicPlacedSpeaker',
content = ('วางลำโพง (NAME: %s)'):format(name),
coords = coords,
source = playerId,
color = 2
})
end)

ลำโพง-เก็บ

EventLabel
NC_MusicPickupSpeakerลำโพง-เก็บ

วางรหัสด้านล่างนี้ภายใน Config.ServerPickedupBluetoothSpeaker = function

pcall(function()
exports['azael_dc-serverlogs']:insertData({
event = 'NC_MusicPickupSpeaker',
content = ('เก็บลำโพง (NAME: %s)'):format(name),
coords = coords,
source = playerId,
color = 7
})
end)

ลำโพง-ใช้งาน

EventLabel
NC_MusicEnteredControllerลำโพง-ใช้งาน

วางรหัสด้านล่างนี้ภายใน Config.ServerEnteredController = function

pcall(function()
exports['azael_dc-serverlogs']:insertData({
event = 'NC_MusicEnteredController',
content = ('ใช้งานลำโพง (NAME: %s | TYPE: %s | OWNER ID: %s)'):format(name, controllerType, ownerId),
source = playerId,
color = 2
})
end)

ลำโพง-ยกเลิกใช้งาน

EventLabel
NC_MusicLeftControllerลำโพง-ยกเลิกใช้งาน

วางรหัสด้านล่างนี้ภายใน Config.ServerLeftController = function

pcall(function()
exports['azael_dc-serverlogs']:insertData({
event = 'NC_MusicLeftController',
content = ('ยกเลิกการใช้งานลำโพง (NAME: %s | TYPE: %s | OWNER ID: %s)'):format(name, controllerType, ownerId),
source = playerId,
color = 1
})
end)

ลำโพง-เพิ่มเพลง

EventLabel
NC_MusicAddedลำโพง-เพิ่มเพลง

วางรหัสด้านล่างนี้ภายใน Config.ServerAddedMusic = function

pcall(function()
exports['azael_dc-serverlogs']:insertData({
event = 'NC_MusicAdded',
content = ('เพิ่มเพลงลงรายชื่อ (NAME: %s | TYPE: %s | YOUTUBE ID: %s | OWNER ID: %s)'):format(name, controllerType, youtubeId, ownerId),
source = playerId,
color = 2
})
end)

ลำโพง-ลบเพลง

EventLabel
NC_MusicRemovedลำโพง-ลบเพลง

วางรหัสด้านล่างนี้ภายใน Config.ServerRemovedMusic = function

pcall(function()
exports['azael_dc-serverlogs']:insertData({
event = 'NC_MusicRemoved',
content = ('ลบเพลงออกจากรายชื่อ (NAME: %s | TYPE: %s | YOUTUBE ID: %s | OWNER ID: %s)'):format(name, controllerType, youtubeId, ownerId),
source = playerId,
color = 1
})
end)