0 Üye ve 1 Ziyaretçi konuyu incelemekte.
alincaklar = { [4] = true,--knife [9] = true,--chainsaw}zone1 = createColCuboid ( 96.42160, 1799.00146, 16.64063, 207.82876586914, 164.90344238281, 43.681719207764 )addEventHandler("onColShapeHit", zone1, function(giren) -- alana girildiğinde if getElementType(giren) == "player" then -- eğer giren elementin tipi player ise for i,id in pairs( getPedWeapons(giren)) do -- oyuncunun silahlrını döndür if alincaklar[id] then -- eğer oyuncunun silahlarında alincaklar tablosundakiler varsa takeWeapon(giren, id) -- oyuncudan silahı al end end endend) --useful function getPedWeapons(ped) local playerWeapons = {} if ped and isElement(ped) and getElementType(ped) == "ped" or getElementType(ped) == "player" then for i=1,9 do local wep = getPedWeapon(ped,i) if wep and wep ~= 0 then table.insert(playerWeapons,wep) end end else return false end return playerWeaponsend
local silahlar = {}alincaklar = { [4] = true,--knife [9] = true,--chainsaw} zone1 = createColCuboid ( 96.42160, 1799.00146, 16.64063, 207.82876586914, 164.90344238281, 43.681719207764 ) addEventHandler("onColShapeHit", zone1, function(giren) -- alana girildiğinde if getElementType(giren) == "player" then -- eğer giren elementin tipi player ise for i,id in pairs(getPedWeapons(giren)) do -- oyuncunun silahlrını döndür if alincaklar[id] then -- eğer oyuncunun silahlarında alincaklar tablosundakiler varsa if not silahlar[giren] then silahlar[giren] = {} end silahlar[giren][id] = getPedTotalAmmo(giren,getSlotFromWeapon(id)) takeWeapon(giren, id) -- oyuncudan silahı al end end endend)addEventHandler("onColShapeLeave", zone1, function(cikan) if getElementType(cikan) == "player" then -- eğer cikan elementin tipi player ise local silah = silahlar[cikan] if silah then for id,v in pairs(silah) do giveWeapon(giren,id,v,true) end silahlar[cikan] = nil end endend)addEventHandler("onPlayerQuit", root, function() if silahlar[source] then silahlar[source] = nil end end) --useful function getPedWeapons(ped) local playerWeapons = {} if ped and isElement(ped) and getElementType(ped) == "ped" or getElementType(ped) == "player" then for i=1,9 do local wep = getPedWeapon(ped,i) if wep and wep ~= 0 then table.insert(playerWeapons,wep) end end else return false end return playerWeaponsend