[YARDIM] Spawn Bölgesi Ayarlama

0 Üye ve 1 Ziyaretçi konuyu incelemekte.

Çevrimdışı Clover

  • Yeni Üye
  • *
    • İleti: 2
: 17 Mart 2021, 12:41:17
Herkese Selamlar Dostlar.
Kullanıyor Olduğum Spawn Sisteminde Öldükten Sonra Tek Bir Yere Spawn Gerçekleştiriyor,
Ben De İkinci Bir Spawn Bölgesi Yaptım Fakat Maalesef İkinci Spawn Yerini Scriptin İçine Ne Şekilde Yerleştireçeğimi Bilmiyorum.
Bu Konuda Bana Yardımcı Olabilir Misiniz. Şimdiden Teşekkürlerimi Sunuyorum.

Kod Bu :

function onWasted(totalAmmo, killer, killerWeapon, bodypart, stealth)
  if not( isGuestAccount (getPlayerAccount(source)) ) then
    local theWeapon = getPedWeapon (source)
    local weaponAmmo = getPedTotalAmmo (source)
    fadeCamera (source, false)
    setTimer (spawnPlayer, 2000, 1, source, -1980.51184, 883.51471, 45.20313, 270, getPedSkin (source), 0, 0, getPlayerTeam(source))
    setTimer (setCameraTarget, 1250, 1, source, source)
    setTimer (fadeCamera, 2000, 1, source, true)
    setTimer (giveWeapon, 2000, 1, source, theWeapon, weaponAmmo, true)
  end
end
addEventHandler ("onPlayerWasted", getRootElement(), onWasted)


Eksik Attığım Biryer Varsa Lütfen Belirtin.
Konuyu Yanlış Yere Açtıysam Özür Dilerim.

« Son Düzenleme: 17 Mart 2021, 12:46:21 Gönderen: Clover »
 


MTASATURK

[YARDIM] Spawn Bölgesi Ayarlama
« : 17 Mart 2021, 12:41:17 »

Çevrimdışı Cassè

  • Acemi Üye
  • *
    • İleti: 110
Yanıtla #1 : 17 Mart 2021, 13:37:58
Bu işini görür. Yazdığın konumlar arasından rastgele seçip spawnlıyor.

Kod
spawnLocations = {
{-1980.51184, 883.51471, 45.20313},
{2. spawn koordinatları},
}

function onWasted(totalAmmo, killer, killerWeapon, bodypart, stealth)
if not( isGuestAccount (getPlayerAccount(source)) ) then
  local theWeapon = getPedWeapon (source)
  local weaponAmmo = getPedTotalAmmo (source)
local x, y, z = unpack(spawnLocations[math.random(1, #spawnLocations)])
  fadeCamera (source, false)
  setTimer (spawnPlayer, 2000, 1, source, x, y, z, 270, getPedSkin (source), 0, 0, getPlayerTeam(source))
  setTimer (setCameraTarget, 1250, 1, source, source)
  setTimer (fadeCamera, 2000, 1, source, true)
  setTimer (giveWeapon, 2000, 1, source, theWeapon, weaponAmmo, true)
end
end
addEventHandler ("onPlayerWasted", getRootElement(), onWasted)
 


Çevrimdışı Clover

  • Yeni Üye
  • *
    • İleti: 2
Yanıtla #2 : 17 Mart 2021, 13:52:00
Linki görebilmek için Kayıt olun yada Giriş yapın.
Bu işini görür. Yazdığın konumlar arasından rastgele seçip spawnlıyor.

Kod
spawnLocations = {
{-1980.51184, 883.51471, 45.20313},
{2. spawn koordinatları},
}

function onWasted(totalAmmo, killer, killerWeapon, bodypart, stealth)
if not( isGuestAccount (getPlayerAccount(source)) ) then
  local theWeapon = getPedWeapon (source)
  local weaponAmmo = getPedTotalAmmo (source)
local x, y, z = unpack(spawnLocations[math.random(1, #spawnLocations)])
  fadeCamera (source, false)
  setTimer (spawnPlayer, 2000, 1, source, x, y, z, 270, getPedSkin (source), 0, 0, getPlayerTeam(source))
  setTimer (setCameraTarget, 1250, 1, source, source)
  setTimer (fadeCamera, 2000, 1, source, true)
  setTimer (giveWeapon, 2000, 1, source, theWeapon, weaponAmmo, true)
end
end
addEventHandler ("onPlayerWasted", getRootElement(), onWasted)

Yardımın İçin Teşekkür Ederim Dostum , Kodlar İşime Yaradı.
Konu Kilitlenebilir.