Jump to content

AngelAlpha

Members
  • Posts

    190
  • Joined

  • Last visited

  • Days Won

    5

Everything posted by AngelAlpha

  1. setTimer (function() function () local h, m = getTime() if tonumber(h) >= 12 and tonumber(h) < 13 then create () outputChatBox( "works", 255, 0, 255 ) end end end, 10*1000, 0)
  2. local pjob = createPickup(-2425.17236, -591.79901, 132.18718, 3, 1275, 50) function animPochta (hitElement) setPedAnimation(hitElement, "BOM_Plant_Loop", 10000, true) end function pickupJobTrudoustroistvo (hitElement) if not getPedOccupiedVehicle(hitElement) then local veh = createVehicle(402, -2434.04785, -593.96906, 131.95361) warpPedIntoVehicle(hitElement, veh) outputChatBox("Вы устроились работать почтальоном! Ваша задача - доставлять письма в определенные точки на карте", hitElement, 0,255,255) local m1 = createMarker(-2521.41650, -623.82672, 131.77835, "cylinder", 1.0, 0,255,0,100) local m2 = createMarker(-2384.37646, -586.83795, 131.11719, "cylinder", 1.0, 0,255,0,100) local m3 = createMarker(-2224.95654, -725.03088, 64.29856, "cylinder", 1.0, 0,255,0,100) local m4 = createMarker(-2244.37109, -171.33820, 34.31252, "cylinder", 1.0, 0,255,0,100) local m5 = createMarker(-2268.78076, -155.74817, 34.32031, "cylinder", 1.0, 0,255,0,100) local b1 = createBlip(-2521.41650, -623.82672, 131.77835,0,2,255,0,0,255,0,200) local b2 = createBlip(-2384.37646, -586.83795, 131.11719,0,2,255,0,0,255,0,200) local b3 = createBlip(-2224.95654, -725.03088, 64.29856,0,2,255,0,0,255,0,200) local b4 = createBlip(-2244.37109, -171.33820, 34.31252,0,2,255,0,0,255,0,200) local b5 = createBlip(-2268.78076, -155.74817, 34.32031,0,2,255,0,0,255,0,200) addEventHandler("onMarkerHit", m1, m1hit) end end addEventHandler("onPickupHit", pjob, pickupJobTrudoustroistvo) function m1hit (hitElement) if not getPedOccupiedVehicle(hitElement) then outputChatBox("Вы доставили письмо!", hitElement, 0,255,0) destroyElement(m1) destroyElement(b1) end end
  3. Пример кода -- Клиент -- addEventHandler ("onClientElementStreamIn", root, function() if getElementType(source) ~= "vehicle" then return end triggerServerEvent ("onVehicleSpawn", resourceRoot, source) end) -- Сервер -- addEvent ("onVehicleSpawn", true) addEventHandler ("onVehicleSpawn", resourceRoot, function (veh) if not handlings[getElementModel(veh)] then return end setVehicleHandlingFromText (veh, handlings[getElementModel(veh)]) end) addEventHandler ("onElementModelChange", resourceRoot, function () if not handlings[getElementModel(source)] then return end setVehicleHandlingFromText (source, handlings[getElementModel(source)]) end) local countHandlingTable = { [1] = "mass", [2] = "turnMass", [3] = "dragCoeff", [4] = "centerOfMassX", [5] = "centerOfMassY", [6] = "centerOfMassZ", [7] = "percentSubmerged", [8] = "tractionMultiplier", [9] = "tractionLoss", [10] = "tractionBias", [11] = "numberOfGears", [12] = "maxVelocity", [13] = "engineAcceleration", [14] = "engineInertia", [15] = "driveType", [16] = "engineType", [17] = "brakeDeceleration", [18] = "brakeBias", [19] = "ABS", [20] = "steeringLock", [21] = "suspensionForceLevel", [22] = "suspensionDamping", [23] = "suspensionHighSpeedDamping", [24] = "suspensionUpperLimit", [25] = "suspensionLowerLimit", [26] = "suspensionFrontRearBias", [27] = "suspensionAntiDiveMultiplier", [28] = "seatOffsetDistance", [29] = "collisionDamageMultiplier", [30] = "monetary", [31] = "modelFlags", [32] = "handlingFlags", [33] = "headLight", [34] = "tailLight", [35] = "animGroup", } local driveTypes = { ["4"] = "awd", ["r"] = "rwd", ["f"] = "fwd", } function setVehicleHandlingFromText (vehicle, text) local t = {} local carID = vehicle.model local tText = split(text, " ") table.remove (tText, 1) local countHandling = 1 for i, v in ipairs (tText) do t[countHandlingTable[i]] = v end local acceptCenterMass = false local centerMass = {x = nil, y = nil, z = nil} for i, v in pairs (t) do if i == "centerOfMassX" then centerMass.x = tonumber(v) elseif i == "centerOfMassY" then centerMass.y = tonumber(v) elseif i == "centerOfMassZ" then centerMass.z = tonumber(v) else if centerMass.x and centerMass.y and centerMass.z and not acceptCenterMass then setVehicleHandling (vehicle, "centerOfMass", {centerMass.x, centerMass.y, centerMass.z}) acceptCenterMass = true end if i == "modelFlags" or i == "handlingFlags" then setVehicleHandling (vehicle, i, "0x"..tostring(v)) elseif i == "driveType" then setVehicleHandling (vehicle, i, driveTypes[v]) else setVehicleHandling (vehicle, i, tonumber(v) or tostring(v)) end end end end -- Общий (Shared) -- handlings = { [411] = "LANDSTAL 1700.0 5008.3 2.5 0.0 0.0 -0.3 85 0.75 0.85 0.5 5 160.0 25.0 20.0 4 d 6.2 0.60 0 35.0 2.4 0.08 0.0 0.28 -0.14 0.5 0.25 0.27 0.23 25000 20 500002 0 1 0", [502] = "PRIMO 1700.0 5008.3 2.5 0.0 0.0 -0.3 85 0.75 0.85 0.5 5 160.0 25.0 20.0 4 d 6.2 0.60 0 35.0 2.4 0.08 0.0 0.28 -0.14 0.5 0.25 0.27 0.23 25000 20 500002 0 1 0", } Короче делаешь свой хендлинг через hedit, потом его экспортируешь и вставляешь в shared. P.S. Функцию setVehicleHandlingFromText писал сам
  4. Можешь показать как это происходит, а то я не совсем понимаю
  5. На сколько я знаю, если ты хочешь полноценную карту, то лучше иметь свой клиент с которым идет сама гта (по типу провинции). И уже в файлах гта менять IPL\IDE файлы на свои. А если же тебе надо небольшой кусок города загрузить на сервер, то можешь просто из 3ds max экспортировать dff\txd\col файлы и заменить их как объекты. И с помощью Map Editor разместить их на карте как тебе надо
  6. При открытии панели сделай guiSetInputMode ("no_binds") И при закрытии guiSetInputMode ("no_binds_when_editing")
  7. outputChatBox ("Your message", root, r, g, b)
  8. local myGate2 = createObject (2957, 386.48864746094,-1526.0137939453,32.323436737061 , 0, 0, 45) --gate 2 function openMyGate() moveObject ( myGate2, 3000, 386.48864746094,-1526.0137939453,35.323436737061 ) end addCommandHandler("*1abrir",openMyGate) function movingMyGateBack() moveObject ( myGate2, 3000, 386.48864746094,-1526.0137939453,32.323436737061) end addCommandHandler("*1cerrar",movingMyGateBack) setTimer(function() local time = getRealTime() if time.hour >= 1 and time.hour < 3 then movingMyGateBack() else openMyGate() end end, 10000, 0)
  9. function updateBtnColor () for i, v in ipairs (ButtonRegister) do v.borderColor = tocolor(255, 167, 0, Alpha) end end function pressRegisterBut() Alpha = 0 updateBtnColor () addEventHandler("onClientRender", getRootElement(), movePanelOut) end function pressBack() Alpha = 0 updateBtnColor () addEventHandler("onClientRender", getRootElement(), movePanelIn) end function movePanelOut() Alpha = math.min(Alpha + 5, 255) updateBtnColor () PageId = 2 if tonumber(Alpha) == 255 then removeEventHandler("onClientRender", getRootElement(), movePanelOut) end end function movePanelIn() Alpha = math.min(Alpha + 5, 255) updateBtnColor () PageId = 1 if tonumber(Alpha) == 255 then removeEventHandler("onClientRender", getRootElement(), movePanelIn) end end
  10. local keyCount = 0 local prevTick = 0 bindKey ("p", "down", function() if keyCount < 3 then if getTickCount()-prevTick < 200 then keyCount = keyCount + 1 else keyCount = 0 end else openPanel() end end)
×
×
  • Create New...