Jump to content

alexaxel705

Members
  • Posts

    24
  • Joined

  • Last visited

  • Days Won

    1

alexaxel705 last won the day on September 19 2022

alexaxel705 had the most liked content!

4 Followers

About alexaxel705

  • Birthday 09/04/1901

Recent Profile Visitors

4,631 profile views

alexaxel705's Achievements

Civilian

Civilian (7/54)

19

Reputation

  1. https://github.com/alexaxel705/Map
  2. function VehEnt(theVehicle, seat) if(getElementModel(theVehicle) == 411) then addEventHandler("onClientRender", root, Target) end end addEventHandler("onClientPlayerVehicleEnter", localPlayer, VehEnt) function VehExt(theVehicle, seat) if(getElementModel(theVehicle) == 411) then removeEventHandler("onClientRender", root, Target) end end addEventHandler("onClientPlayerVehicleExit", localPlayer, VehExt)
  3. local screenWidth, screenHeight = guiGetScreenSize() local scalex = (screenWidth/1920) local scaley = (screenHeight/1080) local PlayerBones = {1, 2, 3, 4, 5, 6, 7, 8, 21, 22, 23, 24, 25, 26, 31, 32, 33, 34, 35, 36, 41, 42, 43, 44, 51, 52, 53, 54} function Target() for _, thePlayer in pairs(getElementsByType("player", root, true)) do local minx, maxx, miny, maxy = screenWidth, 0, screenHeight, 0 for bones in pairs(PlayerBones) do local x,y,z = getPedBonePosition(thePlayer, PlayerBones[bones]) x,y = getScreenFromWorldPosition(x,y,z) if(x and y) then maxx = math.max(x, maxx) maxy = math.max(y, maxy) minx = math.min(x, minx) miny = math.min(y, miny) end end dxDrawLine(maxx, maxy, maxx, miny, tocolor(255,255,255,255), 2) dxDrawLine(maxx, miny, minx, miny, tocolor(255,255,255,255), 2) dxDrawLine(minx, miny, minx, maxy, tocolor(255,255,255,255), 2) dxDrawLine(minx, maxy, maxx, maxy, tocolor(255,255,255,255), 2) end for _, theVehicle in pairs(getElementsByType("vehicle", root, true)) do local VehicleBones = getVehicleComponents(theVehicle) local minx, maxx, miny, maxy = screenWidth, 0, screenHeight, 0 for bones in pairs(VehicleBones) do local x,y,z = getVehicleComponentPosition(theVehicle, bones, "world") x,y = getScreenFromWorldPosition(x,y,z) if(x and y) then maxx = math.max(x, maxx) maxy = math.max(y, maxy) minx = math.min(x, minx) miny = math.min(y, miny) end end local sizeBox = 10 dxDrawLine(maxx, maxy, maxx+sizeBox, maxy, tocolor(255,255,255,255), 2) dxDrawLine(maxx+sizeBox, maxy, maxx+sizeBox, maxy-sizeBox, tocolor(255,255,255,255), 2) dxDrawLine(maxx, miny, maxx+sizeBox, miny, tocolor(255,255,255,255), 2) dxDrawLine(maxx+sizeBox, miny, maxx+sizeBox, miny+sizeBox, tocolor(255,255,255,255), 2) dxDrawLine(minx, maxy, minx+sizeBox, maxy, tocolor(255,255,255,255), 2) dxDrawLine(minx, maxy, minx, maxy-sizeBox, tocolor(255,255,255,255), 2) dxDrawLine(minx, miny, minx+sizeBox, miny, tocolor(255,255,255,255), 2) dxDrawLine(minx, miny, minx, miny+sizeBox, tocolor(255,255,255,255), 2) end end function VehEnt() addEventHandler("onClientRender", root, Target) end addEventHandler("onClientPlayerVehicleEnter", localPlayer, VehEnt) function VehExt() removeEventHandler("onClientRender", root, Target) end addEventHandler("onClientPlayerVehicleExit", localPlayer, VehExt)
  4. alexaxel705

    Weather

    https://community.multitheftauto.com/index.php?p=resources&s=details&id=14553 Этот скрипт устанавливает свойственную регионам погоду. This script has its own regional weather base. local WeatherArr = { ["Los Santos"] = {0,1,2,3,4}, ["San Fierro"] = {5,6,7,8,9}, ["Las Venturas"] = {10,11,12}, ["Red County"] = {13,14,15,16}, ["Whetstone"] = {13,14,15,16}, ["Flint County"] = {13,14,15,16}, ["Bone County"] = {17,18,19}, ["Tierra Robada"] = {17,18,19}, ["UNDERWATER"] = {20}, ["Unknown"] = {21, 22}, }
  5. function RGBToHex(red, green, blue, alpha) if((red < 0 or red > 255 or green < 0 or green > 255 or blue < 0 or blue > 255) or (alpha and (alpha < 0 or alpha > 255))) then return nil end if(alpha) then return string.format("#%.2X%.2X%.2X%.2X", red,green,blue,alpha) else return string.format("#%.2X%.2X%.2X", red,green,blue) end end dxDrawText(RGBToHex(getTeamColor(getTeamFromName("Police"))).."Police", 450,40,64,20,tocolor(255,255,255,255),1.00,"default-bold","center","center", nil, nil, nil, true)
  6. function checkwater() if(isPedDoingTask(localPlayer, "TASK_COMPLEX_IN_WATER")) then setElementHealth(localPlayer, getElementHealth(localPlayer)-0.5) end end addEventHandler("onClientPreRender", root, checkwater) in client
  7. @Erema93 Теоретически, для этого необходимо единовременно загрузить более 211 уникальных моделей в радиусе 300 метров. На практике такое трудно представить, разве что какая нибудь пирамида из авто. Theoretically, for this it is necessary to simultaneously load more than 211 unique models within a radius of 300 meters. In practice, it’s hard to imagine, except perhaps some kind of pyramid from a car.
  8. Вот видео инструкция по запуску скрипта.
  9. alexaxel705

    Unlimit

    it's possible, using the same methods. for script Unlimited Object initial file size ~800 Mb. i'll try experementing with skins and objects in the future.
  10. alexaxel705

    Area name

    setPlayerHudComponentVisible("area_name", false) in client setPlayerHudComponentVisible(thePlayer, "area_name", false) in server
  11. Thomas_Nightfire GetMarrot return Angle in the range from -180 to 180 on which we need to turn wheel. -180 right, +180 left. if active reverse +180 right, -180 left function setPedAnalogControlState takes values from 0.0 to 1.0 therefore, we lower the angle concentration at an acceptable level
  12. Thomas_Nightfire function getPointInFrontOfPoint(x, y, z, rZ, dist) local offsetRot = math.rad(rZ) local vx = x + dist * math.cos(offsetRot) local vy = y + dist * math.sin(offsetRot) return vx, vy, z end function GetMarrot(angle, rz) local marrot = 0 if(angle > rz) then marrot = -(angle-rz) else marrot = rz-angle end if(marrot > 180) then marrot = marrot-360 elseif(marrot < -180) then marrot = marrot+360 end return marrot end function findRotation(x1, y1, x2, y2) local t = -math.deg(math.atan2(x2 - x1, y2 - y1)) return t < 0 and t + 360 or t end local px,py,pz = getElementPosition(localPlayer) local prx,pry,prz = getElementRotation(localPlayer) local vx,vy,vz = getPointInFrontOfPoint(px,py,pz, prz+90, 15) local thePed = createPed(299, vx,vy,vz+1, prz+180) local theVehicle = createVehicle(404, vx,vy,vz+1, 0,0,prz+180) warpPedIntoVehicle(thePed, theVehicle) function UpdateBot() px,py,pz = getElementPosition(localPlayer) prx,pry,prz = getElementRotation(localPlayer) vx,vy,vz = getElementPosition(theVehicle) local vrx,vry,vrz = getElementRotation(theVehicle) local brakes = false local maxspd = 40 local MaxDist = 4 local vehreverse = false if(getDistanceBetweenPoints2D(px,py, vx, vy) < MaxDist) then brakes = true end if(brakes) then setPedAnalogControlState(thePed, "accelerate", 0) setPedAnalogControlState(thePed, "brake_reverse", 0) setPedControlState(thePed, "handbrake", true) setElementVelocity (theVehicle, 0,0,0) else local vxv, vyv, vzv = getElementVelocity(theVehicle) local s = (vxv^2 + vyv^2 + vzv^2)^(0.5)*156 -- Speed local rot = GetMarrot(findRotation(vx,vy,px,py),vrz) if(rot > 80) then if(rot > 100) then vehreverse = true end rot = 20 elseif(rot < -20) then if(rot < -80) then vehreverse = true end rot = -20 end if(vehreverse) then setPedAnalogControlState(thePed, "brake_reverse", 1-(s*1/maxspd)) setPedAnalogControlState(thePed, "accelerate", 0) setPedControlState(thePed, "handbrake", false) if(s > 10) then setPedControlState(thePed, "handbrake", true) else if(rot > 0) then setPedAnalogControlState(thePed, "vehicle_left", (rot)/20) else setPedAnalogControlState(thePed, "vehicle_right", -(rot)/20) end end else if(rot > 0) then setPedAnalogControlState(thePed, "vehicle_right", (rot)/20) else setPedAnalogControlState(thePed, "vehicle_left", -(rot)/20) end setPedAnalogControlState(thePed, "brake_reverse", 0) setPedControlState(thePed, "handbrake", false) if(s < maxspd) then setPedAnalogControlState(thePed, "accelerate", 1-(s*1/maxspd)) else setPedAnalogControlState(thePed, "accelerate", 0) setPedAnalogControlState(thePed, "brake_reverse", (s/maxspd)-1) end end end end setTimer(UpdateBot, 50, 0) Demo
  13. function scriptCreateTank ( commandName ) local luckyBugger = getLocalPlayer() -- get the local player local x, y, z = getElementPosition ( luckyBugger ) -- retrive the player's position local theVehicle = createVehicle ( 404, x, y, z + 10 ) -- create the tank 10 units above them setElementData(theVehicle, "model", 737) outputChatBox ( "You got Tank'd!", 255, 0, 0) end --Attach the 'scriptCreateTank' function to the "tank" command addCommandHandler ( "tank", scriptCreateTank ) [M]Province Надо указать новый ID модели setElementData(theVehicle, "model"). Модель которая указывается в createVehicle значения не имеет, главное чтобы была в диапазоне от 400 до 611. Во время события onClientElementStreamIn он читает новую модель, и занимает свободный слот в диапазоне игровых моделей от 400 до 611 с учетом типа транспортного средства, в данном случае "Automobile". При событии onClientElementStreamOut он освобождает раннее занятый слот.
  14. Для добавления новой модели, например на ID 737. Надо закинуть файлы txd и dff новой модели в папку models/ Добавить в meta.xml <file src="models/NewModel.dff" type="client" download="false" /> <file src="models/NewModel.txd" type="client" download="false" /> И добавить название модели в client.lua local ModelsName = { ... [736] ... [737] = {"models/NewModel", "Automobile"}, } Перед запуском скрипт надо распаковать. Ну и скачивать его соответственно с https://github.com/alexaxel705/Unlimited-Vehicle Для спауна авто используй функцию CreateVehicle() в server.lua Демонстрация работы скрипта: http://109.227.228.4/Unlimited-Vehicle-System.mp4
  15. local wind = false function checkTime() local h, _ = getTime() if(h == 6) then if(not isElement(wind)) then wind = createObject(1337,2321.5, -1659.5,13.5) outputChatBox("Object created") end else if(isElement(wind)) then destroyElement(wind) outputChatBox("Object destroyed") end end end addEventHandler("onClientRender", getRootElement(), checkTime)
×
×
  • Create New...