[YARDIM] Patlayan Araçları Silme

0 Üye ve 1 Ziyaretçi konuyu incelemekte.

Çevrimdışı burnumacidi55

  • Yeni Üye
  • *
    • İleti: 10
: 18 Ekim 2019, 19:42:12
Selamun Aleyküm, Patlayan bir araç 2-3 saniye sonra kaybolduktan sonra, ardından bu hatayı alıyorum konsolum da yardımcı olabileek var mı;

WARNING: Blowedcars\sv_explosion.lua:6: Bad argument @ 'destroyElement' {Expected element at argument 1]

Spoiler for Hiden:
local blowTimers = {}

function destroyBlownVehicle()
   if source and getElementType(source) == "vehicle" then
      local veh = source
      setTimer(function() destroyElement( veh ) end,3000,1)
   end
end

addEventHandler("onVehicleExplode", getRootElement(), destroyBlownVehicle)

function destroyOldVehicle ( ply,seat )
    if #getVehicleOccupants(source) == 0 then
      local veh = source
      blowTimers[source] = setTimer(function() destroyElement( veh ) end,1800000,1)
   end
end
addEventHandler ( "onVehicleExit", getRootElement(), destroyOldVehicle )

function destroyTimerForOldVehicle ( ply,seat )
    if #getVehicleOccupants(source) == 0 then
      if blowTimers[source] then
         killTimer(blowTimers[source])
      end
   end
end
addEventHandler ( "onVehicleEnter", getRootElement(), destroyTimerForOldVehicle )
« Son Düzenleme: 18 Ocak 2020, 16:58:09 Gönderen: Narkoz »
 


MTASATURK

[YARDIM] Patlayan Araçları Silme
« : 18 Ekim 2019, 19:42:12 »

Çevrimdışı Ky

  • Uzman Üye
  • *
    • İleti: 614
Yanıtla #1 : 18 Ekim 2019, 20:25:12
Kod
local blowTimers = {}

function destroyBlownVehicle()
if source and getElementType(source) == "vehicle" then
local veh = source
setTimer(function() destroyElement( veh ) end,3000,1)
end
end
addEventHandler("onVehicleExplode", getRootElement(), destroyBlownVehicle)
 


Çevrimdışı burnumacidi55

  • Yeni Üye
  • *
    • İleti: 10
Yanıtla #2 : 18 Ekim 2019, 22:18:26
Linki görebilmek için Kayıt olun yada Giriş yapın.
Kod
local blowTimers = {}

function destroyBlownVehicle()
if source and getElementType(source) == "vehicle" then
local veh = source
setTimer(function() destroyElement( veh ) end,3000,1)
end
end
addEventHandler("onVehicleExplode", getRootElement(), destroyBlownVehicle)
Eyw