Jump to content

I need some help


Recommended Posts

Hello all i want to make a carshop, like in the picture, but in the DayZ version.

i start the script and its looks like this :mta-screen_2015-08-10_15-10-42_www.kepfeltoltes.hu_.png

A képet a Képfeltöltés.hu tárolja. http://www.kepfeltoltes.hu

function SpawnDayZPatriot(thePlayer) 
  accountname = getAccountName(getPlayerAccount(thePlayer)) 
  if isObjectInACLGroup("user." .. accountname, aclGetGroup("Admin")) then 
    do 
      local x, y, z = getElementPosition(thePlayer) 
      veh = createVehicle(470, x +5, y, z) 
      vehCol = createColSphere(x +5, y, z, 2.5) 
      attachElements(vehCol, veh, 0, 0, 0) 
      setElementData(vehCol, "parent", veh) 
      setElementData(veh, "parent", vehCol) 
      setElementData(vehCol, "vehicle", true) 
      setElementData(vehCol, "MAX_Slots", 10) 
      local tires, engine, parts = getVehicleAddonInfos(getElementModel(veh)) 
      setElementData(vehCol, "Tire_inVehicle", 0) 
      setElementData(vehCol, "Engine_inVehicle", 1) 
      setElementData(vehCol, "Parts_inVehicle", 1) 
      setElementData(vehCol, "spawn", { 
        470, 
        x, 
        y, 
        z 
      }) 
      setElementData(vehCol, "fuel", 100) 
      setTimer(outputChatBox, 50, 1, "#6002B1[VSC]#FFFFFF-Patriot has been spawned!", thePlayer, 171, 205, 239, true) 
    end 
  else 
    outputChatBox("#6002B1[VSC]#FF0000-You are not a admin!", thePlayer, 171, 205, 239, true) 
  end 
end 
addEventHandler("spawnpatriot", SpawnDayZPatriot) 
vehicleAddonsInfo = { 
  { 
    470, 
    4, 
    1, 
    1 
  } 
} 
function getVehicleAddonInfos(id) 
  for i, veh in ipairs(vehicleAddonsInfo) do 
    if veh[1] == id then 
      return veh[2], veh[3], veh[4] 
    end 
  end 
end 
vehicleFuelInfo = { 
  {470, 0.1} 
} 
function getVehicleAddonInfos(id) 
  for i, veh in ipairs(vehicleAddonsInfo) do 
    if veh[1] == id then 
      return veh[2], veh[3], veh[4] 
    end 
  end 
end 
vehicleFuelTable = { 
  {470, 100} 
} 
function getVehicleMaxFuel(loot) 
  local modelID = getElementModel(getElementData(loot, "parent")) 
  for i, vehicle in ipairs(vehicleFuelTable) do 
    if modelID == vehicle[1] then 
      return vehicle[2] 
    end 
  end 
  return false 
end 
function onPlayerEnterDayzVehicle(veh, seat) 
  local col = getElementData(dayZVeh, "parent") 
  local id = getElementModel(dayZVeh) 
  if not seat == 1 then 
    return 
  end 
  local tires, engine, parts = getVehicleAddonInfos(id) 
  setVehicleEngineState(dayZVeh, false) 
  setElementData(dayZVeh, "maxfuel", getVehicleMaxFuel(col)) 
  setElementData(dayZVeh, "needtires", tires) 
  setElementData(dayZVeh, "needengines", engine) 
  setElementData(dayZVeh, "needparts", parts) 
  if getElementData(col, "Tire_inVehicle") or 0 < tonumber(tires) then 
    setVehicleEngineState(dayZVeh, false) 
    return 
  end 
  if getElementData(col, "Engine_inVehicle") or 0 < tonumber(engine) then 
    setVehicleEngineState(dayZVeh, false) 
    return 
  end 
  if not getElementData(col, "Parts_inVehicle") then 
    setElementData(col, "Parts_inVehicle", math.random(0, parts)) 
  end 
  if getElementData(col, "fuel") or 1 >= 0 and not getElementModel(dayZVehBob) == 509 then 
    triggerClientEvent(source, "displayClientInfo", source, "Vehicle", "No tank left in this vehicle!", 22, 255, 0) 
    setVehicleEngineState(dayZVehBob, false) 
    return 
  end 
end 
  

And i want to change this to a x, y,z kordinates to spawn and not to commandspawn and when the car was spawn its need to be froozen and when some player was sit on it then one panel was pop up and tell the car price if he can pay for the price then the car was out of froze then the player can use it ÉD

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...