[YARDIM] Görev Aracına Direk Işınlanma

0 Üye ve 1 Ziyaretçi konuyu incelemekte.

Çevrimdışı sworn

  • Yeni Üye
  • *
    • İleti: 22
Merhaba bu görevde görevi alınca araç yanına bi yere spawn oluyor ben direk aracın içine ışınlanmasını istiyorum oyuncunun nasıl yapabılırım

Client;
Kod
--[[
Yazı]]
function yazi()
local x, y, z = 1315.5, -858.6, 38.5
local mx, my, mz = getCameraMatrix()
if (getDistanceBetweenPoints3D(x, y, z, mx, my, mz) <= 30) then
local wx, wy = getScreenFromWorldPosition(x, y, z +1, 0.07)
if (wx and wy) then
if getElementData(terimler.oyuncu, "Gorev") ~= "var" then
local oyuncu_adi = getPlayerName(getLocalPlayer())
dxDrawText("LS Toptancı Fabrikası\nTeslimat için hazırmısın "..oyuncu_adi:gsub("#%x%x%x%x%x%x", "").."?", wx - 1, wy - 1, wx - 1, wy - 1, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "center", "center", false, false, false, false, false)
dxDrawText("LS Toptancı Fabrikası\nTeslimat için hazırmısın "..oyuncu_adi:gsub("#%x%x%x%x%x%x", "").."?", wx + 1, wy - 1, wx + 1, wy - 1, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "center", "center", false, false, false, false, false)
dxDrawText("LS Toptancı Fabrikası\nTeslimat için hazırmısın "..oyuncu_adi:gsub("#%x%x%x%x%x%x", "").."?", wx - 1, wy + 1, wx - 1, wy + 1, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "center", "center", false, false, false, false, false)
dxDrawText("LS Toptancı Fabrikası\nTeslimat için hazırmısın "..oyuncu_adi:gsub("#%x%x%x%x%x%x", "").."?", wx + 1, wy + 1, wx + 1, wy + 1, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "center", "center", false, false, false, false, false)
dxDrawText("LS Toptancı Fabrikası\nTeslimat için hazırmısın "..oyuncu_adi:gsub("#%x%x%x%x%x%x", "").."?", wx, wy, wx, wy, tocolor(70, 70, 70, 255), 1.00, "bankgothic", "center", "center", false, false, false, false, false)
end
end
end
end
addEventHandler("onClientRender", getRootElement(), yazi)

--[[
Seçim Paneli]]
x = (terimler.ekran[1]/2-panel.yatay/2)
y = (terimler.ekran[2]/2-panel.dikey/2)

s_panel = guiCreateStaticImage(x, y, panel.yatay, panel.dikey, terimler.renk, false)
guiSetProperty(s_panel, "ImageColours", panel.panel_renk)
guiSetVisible(s_panel, false)

s_panel_baslik = guiCreateStaticImage(0, 0, panel.yatay, 25, terimler.renk, false, s_panel)
guiSetProperty(s_panel_baslik, "ImageColours", panel.baslik_renk)

s_panel_label = guiCreateLabel(0, -6, panel.yatay, 25, "", false, s_panel_baslik)
guiLabelSetHorizontalAlign(s_panel_label, "center")
guiLabelSetVerticalAlign(s_panel_label, "bottom")
guiSetFont(s_panel_label, terimler.font)

local s_y = 150

s_buton = guiCreateStaticImage(20, 50, s_y, 25, terimler.renk, false, s_panel)
guiSetProperty(s_buton, "ImageColours", panel.diger_buton_renk)

s_buton_label = guiCreateLabel(0, -6, s_y, 25, "", false, s_buton)
guiLabelSetHorizontalAlign(s_buton_label, "center")
guiLabelSetVerticalAlign(s_buton_label, "bottom")
guiSetFont(s_buton_label, terimler.font)

s_buton2 = guiCreateStaticImage(panel.yatay-20-s_y, 50, s_y, 25, terimler.renk, false, s_panel)
guiSetProperty(s_buton2, "ImageColours", panel.diger_buton2_renk)

s_buton2_label = guiCreateLabel(0, -6, s_y, 25, "", false, s_buton2)
guiLabelSetHorizontalAlign(s_buton2_label, "center")
guiLabelSetVerticalAlign(s_buton2_label, "bottom")
guiSetFont(s_buton2_label, terimler.font)

--[[
Fonksiyonlar]]
addEventHandler("onClientMouseEnter", getRootElement(),
function()
if source == s_buton_label then
guiSetAlpha(s_buton, 0.5)
elseif source == s_buton2_label then
guiSetAlpha(s_buton2, 0.5)
end
end)

addEventHandler("onClientMouseLeave", getRootElement(),
function()
if source == s_buton_label then
guiSetAlpha(s_buton, 1)
elseif source == s_buton2_label then
guiSetAlpha(s_buton2, 1)
end
end)

function veriSifirla_c()
triggerServerEvent("veriSifirla_event", terimler.oyuncu, terimler.oyuncu)
end
addEventHandler("onClientResourceStart", root, veriSifirla_c)

addEventHandler("onClientGUIClick", getRootElement(), function()
if source == s_buton_label then
guiSetVisible(s_buton, false)
guiSetVisible(s_buton2, false)
guiSetProperty(s_panel, "ImageColours", panel.gorunmez_renk)
guiSetText(s_panel_label, "Lütfen bekleyiniz yükleriniz hazırlanıyor.")
setTimer(guiSetText, 1000, 1, s_panel_label, "Lütfen bekleyiniz yükleriniz hazırlanıyor..")
setTimer(guiSetText, 2000, 1, s_panel_label, "Lütfen bekleyiniz yükleriniz hazırlanıyor...")
setTimer(guiSetText, 3000, 1, s_panel_label, "Lütfen bekleyiniz yükleriniz hazırlanıyor.")
setTimer(guiSetText, 4000, 1, s_panel_label, "Lütfen bekleyiniz yükleriniz hazırlanıyor..")
setTimer(guiSetText, 5000, 1, s_panel_label, "Aracınız hazır yükleriniz taşınmak üzere sizi bekliyor.")
setTimer(guiLabelSetColor, 5000, 1, s_panel_label, 0, 255, 0)
setTimer(triggerServerEvent, 6500, 1, "gorev1_aktif_event", terimler.oyuncu, terimler.oyuncu)
setTimer(guiSetVisible, 6500, 1, s_panel, false)
setTimer(showCursor, 6500, 1, false)
elseif source == s_buton2_label then
guiSetVisible(s_panel, false)
showCursor(false)
end
end)

function s_panelac()
local oyuncu_adi = getPlayerName(getLocalPlayer())
guiSetText(s_panel_label, "Teslimat için hazırmısın "..oyuncu_adi:gsub("#%x%x%x%x%x%x", "").."?")
guiSetText(s_buton_label, "Evet")
guiSetText(s_buton2_label, "Daha Sonra")
guiSetProperty(s_panel, "ImageColours", panel.panel_renk)
guiLabelSetColor(s_panel_label, 255, 255, 255)
guiSetVisible(s_panel, true)
guiSetVisible(s_buton, true)
guiSetVisible(s_buton2, true)
showCursor(true)
end
addEvent("s_panel_event", true, s_panelac)
addEventHandler("s_panel_event", getRootElement(), s_panelac)

addEvent("gorev_bilgi1",true)
addEventHandler("gorev_bilgi1", getRootElement(),
function()
lsgmesaj("Görev başarıyla tamamlandı!","success")
setTimer(lsgmesaj, 3000, 1, "Toplam Kazanç: 10.000₺, 100xp", "info")
playSound("menu/ses.mp3")
end)

addEvent("gorev_bilgi2",true)
addEventHandler("gorev_bilgi2", getRootElement(),
function()
lsgmesaj("Göreve başladınız ödülünüzü almak için hedefe gidiniz.","info")
setTimer(lsgmesaj, 3000, 1, "Ödül: 10.000₺, 100xp", "info")
end)

addEvent("gorev_bilgi3",true)
addEventHandler("gorev_bilgi3", getRootElement(),
function()
lsgmesaj("Göreviniz iptal edilmiştir, ödül kazanamadınız.","info")
end)

addEvent("gorev_bilgi4",true)
addEventHandler("gorev_bilgi4", getRootElement(),
function()
lsgmesaj("Görev başarısız! Ödül kazanamadınız.","error")
end)

Server;
Kod
--[[
Markerler]]
gorev1_marker = createMarker(m.x, m.y, m.z, ayarlar.m_sekil, ayarlar.m_boyut, m.r, m.g, m.b, 170)

gorev1_marker2 = createMarker(m.x2, m.y2, m.z3, ayarlar.m_sekil, ayarlar.m_boyut, m.r, m.g, m.b, 170)
setElementVisibleTo(gorev1_marker2, getRootElement(), false)

gorev1_blip = createBlipAttachedTo(gorev1_marker2, 41, 3, 255, 0, 0, 255, 0, 65535, root)
setElementVisibleTo(gorev1_blip, getRootElement(), false)

function setGorevData(oyuncu, hesap, durum)
setElementData(oyuncu, ayarlar.data, durum)
setAccountData(hesap, ayarlar.data, durum)
end

function xpVer(oyuncu, oyuncu, xp)
triggerEvent("expver", oyuncu, oyuncu, xp)
end

function gorev(element, data, hesap, durum)
setElementVisibleTo(gorev1_marker2, element, durum)
setElementVisibleTo(gorev1_blip, element, durum)
setGorevData(element, hesap, data)
if isElement(araclar[element]) then destroyElement(araclar[element]) end
end

--[[
Fonksiyonlar]]
function gorev1_basla(oyuncu)
local hesap = getPlayerAccount(oyuncu)
if getAccountData(hesap, ayarlar.data) ~= "var" then
triggerClientEvent(oyuncu, "s_panel_event", oyuncu)
end
end
addEventHandler("onMarkerHit", gorev1_marker, gorev1_basla)

function gorev1_aktif(oyuncu)
local hesap = getPlayerAccount(oyuncu)
setGorevData(oyuncu, hesap, "var")
if araclar[oyuncu] and isElement(araclar[oyuncu]) then destroyElement(araclar[oyuncu]) araclar[oyuncu] = nil end
local zx, zy, zz = getElementRotation(oyuncu)
araclar[oyuncu] = createVehicle(413, 1325.4, -870.5, 39, zx, zy, zz)
setElementVisibleTo(gorev1_marker2, oyuncu, true)
setElementVisibleTo(gorev1_blip, oyuncu, true)
triggerClientEvent(oyuncu, "gorev_bilgi2", oyuncu)
outputChatBox("#777777Göreviniz başladı! eğer görevi terk etmek istiyorsanız #111111'/giptal' #777777komutunu yazmanız yeterli olacaktır.", oyuncu, 70, 70, 70, true)
end
addEvent("gorev1_aktif_event", true, gorev1_aktif)
addEventHandler("gorev1_aktif_event", getRootElement(), gorev1_aktif)

function gorev1_bitir(oyuncu)
if isElement(araclar[oyuncu]) then
local hesap = getPlayerAccount(oyuncu)
gorev(oyuncu, "yok", hesap, false)
triggerClientEvent(oyuncu, "gorev_bilgi1", oyuncu)
givePlayerMoney(oyuncu, 10000)
xpVer(oyuncu, oyuncu, 100)
end
end
addEventHandler("onMarkerHit", gorev1_marker2, gorev1_bitir)

function gorev_iptal(oyuncu)
local hesap = getPlayerAccount(oyuncu)
if getAccountData(hesap, ayarlar.data) == "var" then
triggerClientEvent(oyuncu, "gorev_bilgi3", oyuncu)
gorev(oyuncu, "yok", hesap, false)
else
outputChatBox("Görevde değilsiniz.", oyuncu, 20, 20, 20, true)
end
end
addCommandHandler("giptal", gorev_iptal)

function veriSifirla(oyuncu)
local hesap = getPlayerAccount(oyuncu)
if getAccountData(hesap, ayarlar.data) == "var" then
setGorevData(oyuncu, hesap, "yok")
end
end
addEvent("veriSifirla_event", true, veriSifirla)
addEventHandler("veriSifirla_event", root, veriSifirla)

function gorevBasarisiz()
for _,oyuncu in ipairs(getElementsByType("player")) do
local hesap = getPlayerAccount(oyuncu)
if getAccountData(hesap, ayarlar.data) ~= "var" then
elseif isElement(araclar[oyuncu]) then
gorev(oyuncu, "yok", hesap, false)
triggerClientEvent(oyuncu, "gorev_bilgi4", oyuncu)
end
end
end
addEventHandler("onVehicleExplode", root, gorevBasarisiz)

function gorevBasarisiz2()
for _,oyuncu in ipairs(getElementsByType("player")) do
local hesap = getPlayerAccount(oyuncu)
if getAccountData(hesap, ayarlar.data) == "var" then
gorev(oyuncu, "yok", hesap, false)
triggerClientEvent(oyuncu, "gorev_bilgi4", oyuncu)
end
end
end
addEventHandler("onPlayerWasted", root, gorevBasarisiz2)
« Son Düzenleme: 11 Nisan 2019, 08:16:15 Gönderen: Narkoz »
 


MTASATURK

[YARDIM] Görev Aracına Direk Işınlanma
« : 09 Nisan 2019, 19:29:35 »

Çevrimdışı MarkeloF

  • Admin
  • *
    • İleti: 901
  • Maybe later.
Yanıtla #1 : 10 Nisan 2019, 10:59:49
Server:
Kod
--[[
Markerler]]
gorev1_marker = createMarker(m.x, m.y, m.z, ayarlar.m_sekil, ayarlar.m_boyut, m.r, m.g, m.b, 170)

gorev1_marker2 = createMarker(m.x2, m.y2, m.z3, ayarlar.m_sekil, ayarlar.m_boyut, m.r, m.g, m.b, 170)
setElementVisibleTo(gorev1_marker2, getRootElement(), false)

gorev1_blip = createBlipAttachedTo(gorev1_marker2, 41, 3, 255, 0, 0, 255, 0, 65535, root)
setElementVisibleTo(gorev1_blip, getRootElement(), false)

function setGorevData(oyuncu, hesap, durum)
setElementData(oyuncu, ayarlar.data, durum)
setAccountData(hesap, ayarlar.data, durum)
end

function xpVer(oyuncu, oyuncu, xp)
triggerEvent("expver", oyuncu, oyuncu, xp)
end

function gorev(element, data, hesap, durum)
setElementVisibleTo(gorev1_marker2, element, durum)
setElementVisibleTo(gorev1_blip, element, durum)
setGorevData(element, hesap, data)
if isElement(araclar[element]) then destroyElement(araclar[element]) end
end

--[[
Fonksiyonlar]]
function gorev1_basla(oyuncu)
local hesap = getPlayerAccount(oyuncu)
if getAccountData(hesap, ayarlar.data) ~= "var" then
triggerClientEvent(oyuncu, "s_panel_event", oyuncu)
end
end
addEventHandler("onMarkerHit", gorev1_marker, gorev1_basla)

function gorev1_aktif(oyuncu)
local hesap = getPlayerAccount(oyuncu)
setGorevData(oyuncu, hesap, "var")
if araclar[oyuncu] and isElement(araclar[oyuncu]) then destroyElement(araclar[oyuncu]) araclar[oyuncu] = nil end
local zx, zy, zz = getElementRotation(oyuncu)
araclar[oyuncu] = createVehicle(413, 1325.4, -870.5, 39, zx, zy, zz)
    warpPlayerIntoVehicle (oyuncu, araclar[oyuncu])
setElementVisibleTo(gorev1_marker2, oyuncu, true)
setElementVisibleTo(gorev1_blip, oyuncu, true)
triggerClientEvent(oyuncu, "gorev_bilgi2", oyuncu)
outputChatBox("#777777Göreviniz başladı! eğer görevi terk etmek istiyorsanız #111111'/giptal' #777777komutunu yazmanız yeterli olacaktır.", oyuncu, 70, 70, 70, true)
end
 


Çevrimdışı sworn

  • Yeni Üye
  • *
    • İleti: 22
Yanıtla #2 : 10 Nisan 2019, 15:50:22
Linki görebilmek için Kayıt olun yada Giriş yapın.
Server:
Kod
--[[
Markerler]]
gorev1_marker = createMarker(m.x, m.y, m.z, ayarlar.m_sekil, ayarlar.m_boyut, m.r, m.g, m.b, 170)

gorev1_marker2 = createMarker(m.x2, m.y2, m.z3, ayarlar.m_sekil, ayarlar.m_boyut, m.r, m.g, m.b, 170)
setElementVisibleTo(gorev1_marker2, getRootElement(), false)

gorev1_blip = createBlipAttachedTo(gorev1_marker2, 41, 3, 255, 0, 0, 255, 0, 65535, root)
setElementVisibleTo(gorev1_blip, getRootElement(), false)

function setGorevData(oyuncu, hesap, durum)
setElementData(oyuncu, ayarlar.data, durum)
setAccountData(hesap, ayarlar.data, durum)
end

function xpVer(oyuncu, oyuncu, xp)
triggerEvent("expver", oyuncu, oyuncu, xp)
end

function gorev(element, data, hesap, durum)
setElementVisibleTo(gorev1_marker2, element, durum)
setElementVisibleTo(gorev1_blip, element, durum)
setGorevData(element, hesap, data)
if isElement(araclar[element]) then destroyElement(araclar[element]) end
end

--[[
Fonksiyonlar]]
function gorev1_basla(oyuncu)
local hesap = getPlayerAccount(oyuncu)
if getAccountData(hesap, ayarlar.data) ~= "var" then
triggerClientEvent(oyuncu, "s_panel_event", oyuncu)
end
end
addEventHandler("onMarkerHit", gorev1_marker, gorev1_basla)

function gorev1_aktif(oyuncu)
local hesap = getPlayerAccount(oyuncu)
setGorevData(oyuncu, hesap, "var")
if araclar[oyuncu] and isElement(araclar[oyuncu]) then destroyElement(araclar[oyuncu]) araclar[oyuncu] = nil end
local zx, zy, zz = getElementRotation(oyuncu)
araclar[oyuncu] = createVehicle(413, 1325.4, -870.5, 39, zx, zy, zz)
    warpPlayerIntoVehicle (oyuncu, araclar[oyuncu])
setElementVisibleTo(gorev1_marker2, oyuncu, true)
setElementVisibleTo(gorev1_blip, oyuncu, true)
triggerClientEvent(oyuncu, "gorev_bilgi2", oyuncu)
outputChatBox("#777777Göreviniz başladı! eğer görevi terk etmek istiyorsanız #111111'/giptal' #777777komutunu yazmanız yeterli olacaktır.", oyuncu, 70, 70, 70, true)
end

Çok teşekkür ederim Linki görebilmek için Kayıt olun yada Giriş yapın.  Birde görevde araçtan inmeyi nasıl engelleyebilirim bu konudada bana yardımcı olurmusun çok sevinirim...