[ISTEK] Belli bir süre kullanılmayan aracları respawnlama

0 Üye ve 1 Ziyaretçi konuyu incelemekte.

Çevrimdışı Kivanc_Beta

  • Yeni Üye
  • *
    • İleti: 2
Öncelikle Selamun Aleyküm herkese elinde belli bir süre kullanılmayan aracları respawnlama scripti ve galeri için
arac test etme scripti olan varmı
« Son Düzenleme: 09 Ağustos 2022, 23:21:29 Gönderen: Chearbhall »
 


MTASATURK


Çevrimdışı Strong

  • Deneyimli Üye
  • *
    • İleti: 455
  • After Roleplay Developer
Oyun modu nedir?
 


Çevrimdışı Chearbhall

  • Hasan
  • Moderatör
  • *
    • İleti: 128
Konu başlığı düzeltildi.
 


Çevrimdışı Kivanc_Beta

  • Yeni Üye
  • *
    • İleti: 2
Linki görebilmek için Kayıt olun yada Giriş yapın.
Oyun modu nedir?

MTA Roleplay sunucuma istiyorum
 


Çevrimdışı Strong

  • Deneyimli Üye
  • *
    • İleti: 455
  • After Roleplay Developer
server.lua
Kod
function respawnTheVehicle(vehicle)
setElementCollisionsEnabled(vehicle, true)
respawnVehicle(vehicle)
end

function aracResle(thePlayer, seat,jacked)
if (exports.integration:isPlayerTrialAdmin(thePlayer)) then
local vehicles = exports.pool:getPoolElementsByType("vehicle")
local counter = 0
local theVehicle = getPedOccupiedVehicle(thePlayer)
local dbid = getElementData(theVehicle, "dbid")
if dbid and dbid > 0 then
if getElementData(theVehicle, "owner") == 1 or getElementData(theVehicle, "owner") > 1 then
local driver = getVehicleOccupant(theVehicle)
local pass1 = getVehicleOccupant(theVehicle, 1)
local pass2 = getVehicleOccupant(theVehicle, 2)
local pass3 = getVehicleOccupant(theVehicle, 3)

if not pass1 and not pass2 and not pass3 and not driver and not getVehicleTowingVehicle(theVehicle) and #getAttachedElements(theVehicle) == 0 then
if isElementAttached(theVehicle) then
detachElements(theVehicle)
end
setTimer(function()
exports.anticheat:changeProtectedElementDataEx(theVehicle, 'i:left')
exports.anticheat:changeProtectedElementDataEx(theVehicle, 'i:right')
respawnTheVehicle(theVehicle)
setVehicleLocked(theVehicle, false)
setElementInterior(theVehicle, getElementData(theVehicle, "interior"))
setElementDimension(theVehicle, getElementData(theVehicle, "dimension"))
exports.anticheat:changeProtectedElementDataEx(theVehicle, "vehicle:radio", 0, true)
counter = counter + 1
end,120000,1,thePlayer)
end
end
end
end
end
addEventHandler("onVehicleStartExit",root,aracResle)

Sadece sahibi olanlara ayarlıdır. araçtan indikten 2 dakika sonra gerçekleşicektir. 2 dakika sonra aracı respawnlar. kodu test etmedim. Hata falan çıkarsa yazarsın gene buraya.
 


Çevrimdışı Chearbhall

  • Hasan
  • Moderatör
  • *
    • İleti: 128
Aynı konudan iki kez açıldığı için, bu konu çöpe taşınmıştır.
 


MTASATURK

Ynt: [ISTEK] Belli bir süre kullanılmayan aracları respawnlama
« Yanıtla #5 : 10 Ağustos 2022, 13:49:01 »