Hello! Azt szeretném kérdezni ,hogy hogyan tudnám beállítani, hogy ne cska a biciklit tudja lefoglalni hanem a kocsikat is?
-- Command to impound Bikes:
function setbikeimpound(player, matchingDimension)
local leader = tonumber( getElementData(player, \"factionleader\") ) or 0
local rank = tonumber( getElementData(player, \"factionrank\") ) or 0
local veh = getPedOccupiedVehicle(player)
if (getElementData(player,\"faction\")) == 30 then
if (isPedInVehicle(player)) then
if (getVehicleType(veh) == \"Bike\") or (getVehicleType(veh) == \"BMX\") then
local owner = getElementData(veh, \"owner\")
local faction = getElementData(veh, \"faction\")
local dbid = getElementData(veh, \"dbid\")
local impounded = getElementData(veh, \"Impounded\")
if (owner > 0) then
if (faction > 3 or faction < 0) then
if (source == towSphere2) then
--PD make sure its not marked as impounded so it cannot be recovered and unlock/undp it
setVehicleLocked(veh, false)
exports[\'anticheat-system\']:changeProtectedElementDataEx(veh, \"Impounded\", 0)
exports[\'anticheat-system\']:changeProtectedElementDataEx(veh, \"enginebroke\", 0, false)
setVehicleDamageProof(veh, false)
setVehicleEngineState(veh, false)
outputChatBox(\"((A járművet parkold le: /park és húzd be a kéziféket: /kezifek.))\", player, 255, 194, 14)
else
if rank >= 5 then
if (getElementData(veh, \"faction\") ~= 30) then
if (impounded == 0) then
exports[\'anticheat-system\']:changeProtectedElementDataEx(veh, \"Impounded\", getRealTime().yearday)
setVehicleLocked(veh, false)
exports[\'anticheat-system\']:changeProtectedElementDataEx(veh, \"enginebroke\", 1, false)
setVehicleEngineState(veh, false)
outputChatBox(\"(( A bicikli sikeresen lefoglalva. ))\", player, 50, 205, 50)
outputChatBox(\"((A járművet parkold le: /park és húzd be a kéziféket: /kezifek.))\", player, 255, 194, 14)
isin = false
exports.logs:logMessage(\"[iMPOUNDED BIKE] \" .. getPlayerName(player) .. \" impounded vehicle #\" .. dbid .. \", owned by \" .. tostring(exports[\'cache\']:getCharacterName(owner)) .. \", in \" .. table.concat({exports.global:getElementZoneName(veh)}, \", \") .. \" (pos = \" .. table.concat({getElementPosition(veh)}, \", \") .. \", rot = \".. table.concat({getVehicleRotation(veh)}, \", \") .. \", health = \" .. getElementHealth(veh) .. \")\", 14)
end
end
else
local factionRanks = getElementData(getPlayerTeam(player), \"ranks\")
local factionRank = factionRanks[ 5 ] or \"awesome dudes\"
outputChatBox(\"A parancs kizárólag ettöl a rangtól használható: \" .. factionRank, player, 255, 194, 14)
end
end
else
outputChatBox(\"Ez a frakció jármű nem lefoglalható.\", player, 255, 194, 14)
end
end
else
outputChatBox(\"Ezt a parancsot csak lefoglalt bicikliknél és BMXeknél használhatod.\", player, 255, 194, 14)
end
else
outputChatBox(\"Nem vagy járműben.\", player, 255, 0, 0)
end
end
end
addCommandHandler(\"impoundbike\", setbikeimpound)