📧AFU.Mailbox

ตัวอย่างการส่งเมลให้ผู้เล่นใหม่

  • ในตัวอย่างนี้ทำงานร่วมกับ `esx_identity` หรือ ที่ชอบเรียกกันว่า สคริปหน้ากรอกข้อมูลตัวละครผู้เล่นใหม่ที่เข้ามา

RegisterServerEvent('esx_identity:setIdentity')
AddEventHandler('esx_identity:setIdentity', function(data, myIdentifiers)
	local source = source ---@comments set local เลขไอดีของผู้เล่น
	local xPlayer = ESX.GetPlayerFromId(source)
	setIdentity(myIdentifiers.steamid, data, function(callback)
		if callback then
			TriggerClientEvent('kiss_scoreboard:profile', -1)
			TriggerClientEvent('esx_identity:identityCheck', myIdentifiers.playerid, true)
			TriggerEvent('esx_identity:characterUpdated', myIdentifiers.playerid, data)
			xPlayer.setName(('%s %s'):format(data.firstname, data.lastname))

			---@comments AFU Mailbox add mail to new player!
			pcall(function()
				local mailTemplateId = "id ของ template mail ใน database"
				exports.afu_mailbox:sendMailToPlayer({source}, mailTemplateId)
			end)
		else
			xPlayer.showNotification(_U('failed_identity'))
		end
	end)
end)

ตัวอย่างการใส่ Discord Log (Azael, NC)

ที่อยู่ไฟล์

ตัวอย่าง (Example)

Last updated