Szerző Téma: Kocsi lefoglalás  (Megtekintve 919 alkalommal)

Kocsi lefoglalás
« Dátum: 2014. december 09. - 20:26:43 »
0 Show voters
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)

Kocsi lefoglalás
« Válasz #1 Dátum: 2014. december 09. - 20:30:36 »
0 Show voters
Háát ebbe a scriptbe csak úgy tudod beírni ha ebbe a sorba beírod az összes kocsi \"típusát\" amit leszeretnél foglalni:
 
if (getVehicleType(veh) == \"Bike\") or (getVehicleType(veh) == \"BMX\") then

 
szóval pl.:
 
if (getVehicleType(veh) == \"Bike\") or (getVehicleType(veh) == \"BMX\") or (getVehicleType(veh) == \"Infernus\") or (getVehicleType(veh) == \"Admiral\")then

 
stb.

Kocsi lefoglalás
« Válasz #2 Dátum: 2014. december 09. - 21:26:19 »
0 Show voters
Úgyis lehet ahogyan Koko leírta, de ha nagyobb csoportot akarsz, mint pl.: autók, motorok stb. Akkor itt levan írva https://wiki.multitheftauto.com/wiki/GetVehicleType

Nem elérhető Toxic

  • 798
  • #elfújalágyszellő
    • Profil megtekintése
Kocsi lefoglalás
« Válasz #3 Dátum: 2015. január 01. - 16:03:21 »
0 Show voters
[gmod]Elavult, zárom.[/gmod]

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal