Citizen.CreateThread(function()
local Zex = GetHashKey("csb_chef")
if not HasModelLoaded(Zex) then
RequestModel(Zex)
Citizen.Wait(3500)
end
while not HasModelLoaded(Zex) do
Citizen.Wait(3500)
end
if not Zexsaticinpc then
local Zex = CreatePed(6, Zex, 1851.568, 3870.656, 31.86928, 25.254, false, false)
SetBlockingOfNonTemporaryEvents(Zex, true)
SetPedDiesWhenInjured(Zex, false)
SetPedCanPlayAmbientAnims(Zex, true)
SetPedCanRagdollFromPlayerImpact(Zex, false)
SetEntityInvincible(Zex, true)
FreezeEntityPosition(Zex, true)
end
end)
NPC şu şekilde istedigin yere çıkarta bilirsin (x, y ,z ) konumlarını değiştiriceksin.
function DrawText3Ds(x, y, z, text)
SetTextScale(0.35, 0.35)
SetTextFont(4)
SetTextProportional(1)
SetTextColour(255, 255, 255, 215)
SetTextEntry("STRING")
SetTextCentre(true)
AddTextComponentString(text)
SetDrawOrigin(x,y,z, 0)
DrawText(0.0, 0.0)
local factor = (string.len(text)) / 370
DrawRect(0.0, 0.0+0.0125, 0.017+ factor, 0.03, 0, 0, 0, 75)
ClearDrawOrigin()
end
Şu function'u ekle, Yazı Yazdırmak içinse
Citizen.Createthread(function()
while true do
Citizen.wait(0)
DrawText3Ds(x, y, z, 'Görünecek yazi')
end
end)