Search the Community

Showing results for tags 'vehicle'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Multi Theft Auto: San Andreas 1.x
    • Support for MTA:SA 1.x
    • User Guides
    • Open Source Contributors
    • Suggestions
    • Ban appeals
  • General MTA
    • News
    • Media
    • Site/Forum/Discord/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • MTA Community
    • Scripting
    • Maps
    • Resources
    • Other Creations & GTA modding
    • Competitive gameplay
    • Servers
  • Other
  • Archive
  • Private Bugtracker

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


About Me


Gang


Location


Occupation


Interests

Found 53 results

  1. Tem como usar o setVehicleComponentScale para aumentar peças do veiculo para todos os players?Tem que usar triggerClientEvent?Tentei usar mas n consegui,n sei usar essa função
  2. Estou querendo fazer um script que quando clico no carro,me mostre as coordenadas da roda,mas a função getVehicleComponentPosition é somente do lado client e não sei jogar elas pro lado serve
  3. This is my first post, so forgive me if i make any mistakes! I'm creating a Police Script where i get to a random Ped and type a command(i'll change it to bind later) and it creates a Marker attached(0,1,0) to the Source that if it touches the Ped will activate a function that makes him follow the Marker. And this is the function so far: Everything is Server-Side (because i suck at Client-Side) function func1(p) local x,y,z = getElementPosition(p) Marker = createMarker(x, y, z, "cylinder", 1, 255, 0, 0, 170) attachElements(Marker,p, 0,1,0) addEventHandler("onMarkerHit", Marker, func2) addEventHandler("onMarkerHit", Marker, func3) end addCommandHandler("render", func1) function fun2(p,_) if getElementType ( p ) == "ped" then x2,y2,z2 = getElementPosition(Marker) x1,y1,z1 = getElementPosition(p) rx,ry,rz = findRotation3D(x1,y1,z1,x2,y2,z2) setElementRotation(p, rx+0,ry+0,rz+0) setPedAnimation(p, "ped", "walk_player") setTimer(function() bunda(p,_) end, 999, 1) end end And then here's the devil: function func3(p, ped) if not getElementType ( ped ) == "ped" then return end --else return end --carro = getElementType ( carro ) carro = getElementsByType("vehicle") --psha = getElementColShape(p) --elements = getElementsWithinColShape(psha) --if elements == carro == "vehicle" then --local vee = getElementsByType(carro) -- and getElementType ( carro ) == "vehicle" then --if getElementType(p2) == "player" then --local vei = getPedOccupiedVehicle(p2) --addEventHandler("onColShapeHit", psha, function(hit) --if carro == "vehicle" then addEventHandler("onVehicleEnter", root, function() setTimer(function() setPedAnimation(ped, false) vei = getPedOccupiedVehicle(p) warpPedIntoVehicle ( ped, root, math.random(2,4) ) end, 999, 1) timers = getTimers ( 1000) for timerKey, timerValue in ipairs(timers) do killTimer ( timerValue ) end destroyElement(Marker) --end end) end --end --end I tried everything my :~ty skills allowed me to and now i'm out of ideas on how to solve this without Client-Side. The idea is when the Ped approaches the car, it chooses between seats 2 or 3 and enters the car, but as i'm not creating the car in the script, instead you should be able to spawn any vehicle and as a Cop you could arrest people and take them to the car. Sorry for the ugly-ass code. EDIT: Making the Ped follow the Player and when the Player enters a Vehicle the Ped is warped into the back seat is fine too.
  4. I created a script to set texture when player joins the car, (EngineApplyShaderToWorldTexture), but work only client-side, i wanna other players see the texture from the car, not only the local player see self texture. How i can create a script like this?
  5. Estou tentando criar uma função que faça com que a porta do veículo em que o Player estava seja fechada assim que ele deixar o carro. Não sei se isso é possível, mas tentei da seguinte maneira, porém sem sucesso: local theVehicle = getPedOccupiedVehicle ( source ) function SairVeiculo (theVehicle, leftSeat, jackerPlayer) if leftSeat == 0 and not jackerPlayer then setVehicleDoorOpenRatio ( theVehicle, 2, 0, 2500) setVehicleDoorOpenRatio ( theVehicle, 4, 0, 2500) end end addEventHandler("onPlayerVehicleExit", root, SairVeiculo) Se houver alguma maneira e puderem me ajudar, agradeço!
  6. Hello guys i have an idea but i cant make the script because im new in scripting I want to get vehicules into marker and the i will press a button and then a countdown will display in screen (2 minutes) and then the car will be deleted and i get 5000 dollars
  7. Hello all! Please help, I need to make a driving ped. So I've tried to create ped and create a vehicle and make ped drive to me, but soon I'm understood that I don't know how to make ped choose right direction (turning left or right) and go forward to me... Tried to investigate CrystalMV's NPC HLC scripts, but cannot understand how it works... So, please, somebody, help me code and understand how ur code works. I need a simple NPC turning into the right side and accelerate then stop using handbrake or brake_reverse and that's all. I've spend many hours thinking how to code it, but decision still not found, so I'm here..
  8. I created some handling with handling editor script, and i want set some cars default handling to these handlings with a script, when a player spawn this car, the handling in the car automatic set to the edited hand.. But how can i do this?
  9. Regeneration (health) This resource lets you regenerate player and vehicle* health. It is not an unique idea, I know... but there weren't good implementations for it at the community resource list. So that's why I share this with YOU. * Vehicle regeneration for the driver only. Version 1.0.0 Not compiled! Smooth health regeneration No UI, just the manager Settings (Admin panel) Settings Regeneration [on/off] (player/vehicle) Regeneration value (player/vehicle) Regeneration delay (player/vehicle) Regeneration [on/off] while the vehicle is burning Download link: https://community.multitheftauto.com/?p=resources&s=details&id=15757 Take a quick look into the source code (v1.0.0) Client Server Meta
  10. I need help to do an script that makes any car ID turn up and down the lights like the ZR350 does, but i dont know how the :O do it, pls someone help me with this.
  11. Alguém pode me ajudar com um script? eu consegui criar um veiculo para a acl "admin" através do comando "carro". Porém não consigo fazer para que respawne apenas um carro por vez. Toda vez que digita o comando "carro" ele continua spawnando o veiculo um do lado do outro. function veiculodayz(thePlayer) accountname = getAccountName(getPlayerAccount(thePlayer)) if isObjectInACLGroup("user." .. accountname, aclGetGroup("Admin")) then do local x, y, z = getElementPosition(thePlayer) veh = createVehicle(489, x+3, y, z) setVehicleColor(veh,0,0,0) vehCol = createColSphere(x, y, z, 2.5) attachElements( vehCol, veh, 0, 0, 0 ) setElementData(vehCol,"parent",veh) setElementData(veh,"parent",vehCol) setElementData(vehCol,"vehicle",true) setElementData(vehCol,"Tire_inVehicle",4) setElementData(vehCol,"Engine_inVehicle",1) setElementData(vehCol,"Parts_inVehicle",1) setElementData(vehCol,"fuel",10000) end end end addCommandHandler("carro", veiculodayz)
  12. I want the car to go in col and it will be ghostmode. if player create new cars and go in col. both car can Surpass - Sorry for my english I use web translator
  13. I am looking for a script that removes selected parts from the car. PL Szukam skryptu, który usuwa wybrane części z samochodu. Sorry for my bad English
  14. Hi there person, I need some help figuring out how to progress and finish up a script (idea to reality), but i can't find a way to do it on my own, So can sombady help me out, Here's the code. CLIENT: addEventHandler("onClientVehicleEnter", getRootElement(), function (thePlayer, seat) if thePlayer == getLocalPlayer() then triggerServerEvent ("Freeze", resourceRoot) end end ) addEventHandler("onClientVehicleExit", getRootElement(), function (thePlayer, seat) if thePlayer == getLocalPlayer() then triggerServerEvent ("Freeze", resourceRoot) end end ) SERVER: function FreezeHandler() end addEvent("Freeze", true) addEventHandler("Freeze", resourceRoot, FreezeHandler) So my intention is first of all to freeze every vehicle when it respawns/spawns, and for example if 1 does respawn/spawn then only that 1 get's frozen. And whenever the Event "onClientVehicleEnter" get's triggered, then the vehicle the player is going to unfreeze's, and for "onClientVehicleExit" it's inverted, so it has to freeze the vehicle again until another player interaction would occur. is anyone willing to help me out on this one, because i can't find it.. Gr.xboxxxxd.
  15. Do you have a code that will automatically revive the public vehicles?
  16. I try to setup a server and i did it. But when i go in a house or building with interiors and exit the building, i cannot enter any vehicles. Than when i use command "restart interior-system" on console, everything is ok. I tried 3 or 4 scripts today and everyone is looking same.. Pls help me i stucked with it..
  17. Hello there. Me and my friend tried to make a script that makes a spoiler on a vehicle moving. If the vehicle is going above 100km/h the spoiler will change its position. We are using setVehicleComponentPosition. The problem is that only the player who's driving the car can see it moving. Is there any way that it will be visible for everybody on the server?
  18. I have a function that gets the information of all the cars that has been bought for ingame money and it can spawn the cars when the resource is started but when a player disconnects and the vehicle data is changed when the player reconnects he is not able to see the changes to the car as I looked over other scripts they only using server side. This is the only function that gets the vehicles data from the database but it only does when the resource starts function spawnAllCars() local query = mysql:query("SELECT * FROM vehicles") local rows = mysql:fetch_assoc(query) if rows then while true do local veh = nil local rows = mysql:fetch_assoc(query) if not rows then break end if tonumber(rows["locX"]) ~= 0 and tonumber(rows["locY"]) ~= 0 and tonumber(rows["locZ"]) ~= 0 and tonumber(rows["rotX"]) ~= 0 and tonumber(rows["rotY"]) ~= 0 and tonumber(rows["rotZ"]) ~= 0 then local veh = createVehicle(tonumber(rows["modelID"]), rows["locX"], rows["locY"], rows["locZ"], rows["rotX"], rows["rotY"], rows["rotZ"]) else local veh = createVehicle(tonumber(rows["modelID"]), rows["spawnLocX"], rows["spawnLocY"], rows["spawnLocZ"], rows["spawnRotX"], rows["spawnRotY"], rows["spawnRotZ"]) end setVehColor(veh, rows["color1"], rows["color2"], rows["color3"], rows["color4"]) setElementHealth(veh, rows["damage"]) setElementInterior(veh, tonumber(rows["interior"])) setElementDimension(veh, tonumber(rows["dimension"])) table.insert(vehTable, {["id"] = rows["id"], ["health"] = rows["damage"]}) end end end addEventHandler("onResourceStart", getResourceRootElement(), spawnAllCars) Do I need to add something in client side or just need to change something in this?
  19. السلام عليكم ورحمة الله وبركاته حبيت استفسر عن شي في الجداول وانا اسوي لوحة الادمن في اعطاء مركبة allVehicleIDS = {400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611 } for i,v in ipairs(allVehicleIDS) do local row = guiGridListAddRow(vehiclelist) guiGridListSetItemText(vehiclelist, row, 1, getVehicleNameFromID(v), false, false) guiGridListSetItemColor(vehiclelist, row, 1, math.random(0,255), math.random(0,255), math.random(0,255), 255) guiGridListSetItemData(vehiclelist, row, 1, v) end كل ما اجي اعطي مركبة يعطيني سيارة وحدا اسمها Landstalker وما يعطيني غيرها حتي لما احدد سيارة ثانية
  20. Okey, so. There is this function called: getElementBoundingBox() But, is there any way to get the bounding box of a vehicle component? For example the bounding box of the wheel. Thanks for da' answers in advance.
  21. Hello MTA community! I need help with random vehicle spawner or marker. How can i make script, where i example drive through marker and it gives random vehicle to me? Please reply.
  22. Bella rega. Sono un vero appassionato di Battle Bots. Ho trovato Tombstone in 3D ma devo editarlo tutto. Dal modello 3D alle Textures. Il modello originale e stato fatto con Sketchup, mancano tutte le textures ed altro. Ovviamente a lavoro ultimato la lama sarà scriptata in Lua
  23. function showText() if not showing then if getKeyState('lalt') then showNearbyVehicleDescriptions() end return false end if not getKeyState('lalt') and getElementData(localPlayer, "enableOverlayDescriptionVehPin") ~= "1" then removeVD() return end for i = 1, #vehiculars, 1 do local theVehicle = vehiculars[i] if isElement(theVehicle) then local x,y,z = getElementPosition(theVehicle) local cx,cy,cz = getCameraMatrix() if getDistanceBetweenPoints3D(cx,cy,cz,x,y,z) <= viewDistance then --Within radius viewDistance local px,py,pz = getScreenFromWorldPosition(x,y,z+heightOffset,0.05) if px and isLineOfSightClear(cx, cy, cz, x, y, z, true, false, false, true, true, false, false) then --FETCH FONT IN REAL TIME local fontString = getElementData(localPlayer, "cFontVeh") or "default" local fontElement = fontString if fontElement == "BizNoteFont18" then if not BizNoteFont18 then BizNoteFont18 = dxCreateFont ( ":resources/BizNote.ttf" , 18 ) end fontElement = BizNoteFont18 end --INITIAL :~ local toBeShowed = "" local fontWidth = 90 local toBeAdded = "" local lines = 0 local textColor = tocolor(255,255,255,255) if getElementData(theVehicle, "carshop") then local brand, model, year = false, false, false brand = getElementData(theVehicle, "brand") or false if brand then model = getElementData(theVehicle, "maximemodel") year = getElementData(theVehicle, "year") local line = year.." "..brand.." "..model local len = dxGetTextWidth(line) if len > fontWidth then fontWidth = len end if toBeShowed == "" then toBeShowed = toBeShowed..line.."\n" lines = lines + 1 else toBeShowed = toBeShowed.."-~-\n"..line.."\n" lines = lines + 2 end else if toBeShowed == "" then toBeShowed = toBeShowed..getVehicleName(theVehicle).."\n" lines = lines + 1 else toBeShowed = toBeShowed.."-~-\n"..getVehicleName(theVehicle).."\n" lines = lines + 2 end end local price = getElementData(theVehicle, "carshop:cost") or 0 local taxes = getElementData(theVehicle, "carshop:taxcost") or 0 toBeShowed = toBeShowed.."Price: $"..exports.global:formatMoney(price).."\n Taxes: $"..exports.global:formatMoney(taxes) lines = lines+ 2 else --GET DESCRIPTIONS + SIZE local descToBeShown = "" local job = getElementData(theVehicle, "job") if job == 1 then descToBeShown = "RS Haul - We'll dump your load." lines = lines + 1 elseif job == 2 then descToBeShown = "Yellow Cab Co.\nCall #8294 for a pickup!" lines = lines + 2 elseif job == 3 then descToBeShown = "Los Santos Bus" lines = lines + 1 else for j = 1, 5 do local desc = getElementData(theVehicle, "description:"..j) if desc and desc ~= "" and desc ~= "\n" and desc ~= "\t" then local len = dxGetTextWidth(desc) if len > fontWidth then fontWidth = len end descToBeShown = descToBeShown..desc.."\n" lines = lines + 1 end end end if descToBeShown ~= "" then descToBeShown = "-~-\n"..descToBeShown lines = lines + 1 end --GET BRAND, MODEL, YEAR local brand, model, year = false, false, false brand = getElementData(theVehicle, "brand") or false if brand then model = getElementData(theVehicle, "maximemodel") year = getElementData(theVehicle, "year") local line = year.." "..brand.." "..model local len = dxGetTextWidth(line) if len > fontWidth then fontWidth = len end toBeShowed = toBeShowed..line.."\n" lines = lines + 1 end --GET VIN+PLATE local fiyatt = getElementData(theVehicle, "fiyat") local plate = "" local vin = getElementData(theVehicle, "dbid") if vin < 0 then plate = getVehiclePlateText(theVehicle) else plate = getElementData(theVehicle, "plate") end --Following edited by Adams 27/01/14 to accomodate VIN/PLATE hiding. if not noPlateVehs[getElementModel(theVehicle)] then if getElementData(theVehicle, "show_plate") == 0 then if getElementData(localPlayer, "duty_admin") == 1 then toBeShowed = toBeShowed.."((Plate: "..fiyatt.."))\n" lines = lines + 1 else --toBeShowed = toBeShowed.."* NO PLATE *\n" end else toBeShowed = toBeShowed.."Plate: "..fiyatt.."\n" lines = lines + 1 end end if getElementData(theVehicle, "show_vin") == 0 then if getElementData(localPlayer, "duty_admin") == 1 then toBeShowed = toBeShowed.."((VIN: "..vin.."))" lines = lines + 1 else --toBeShowed = toBeShowed.."* NO VIN *" end else toBeShowed = toBeShowed.."VIN: "..vin lines = lines + 1 end --GET IMPOUND if (exports["vehicle-system"]:isVehicleImpounded(theVehicle)) then local days = getRealTime().yearday-getElementData(theVehicle, "Impounded") toBeShowed = toBeShowed.."\n".."Impounded: " .. days .. " days" lines = lines + 1 end local vowner = getElementData(theVehicle, "owner") or -1 local vfaction = getElementData(theVehicle, "faction") or -1 if vowner == getElementData(localPlayer, "account:id") or exports.global:isStaffOnDuty(localPlayer) or exports.integration:isPlayerScripter(localPlayer) or exports.integration:isPlayerVCTMember(localPlayer) then toBeShowed = toBeShowed.."\nShop ID: "..(getElementData(theVehicle, "vehicle_shop_id") or "None") lines = lines + 1 local ownerName = 'No-one' if vowner > 0 then ownerName = exports.cache:getCharacterNameFromID(vowner) elseif vfaction > 0 then ownerName = exports.cache:getFactionNameFromId(vfaction) end local line = "\nOwner: "..(ownerName or "Loading..") local len = dxGetTextWidth(line) if len > fontWidth then fontWidth = len end toBeShowed = toBeShowed..line lines = lines + 1 --Activity / MAXIME local protectedText, inactiveText = nil if vowner > 0 then local protected, details = exports['vehicle-system']:isProtected(theVehicle) if protected then textColor = tocolor(0, 255, 0,255) protectedText = "[Inactivity protection remaining: "..details.."]" local toBeAdded = "\n"..protectedText toBeShowed = toBeShowed..toBeAdded local len = dxGetTextWidth(toBeAdded) if len > fontWidth then fontWidth = len end lines = lines + 1 else local active, details2, secs = exports['vehicle-system']:isActive(theVehicle) if active and (powner == getElementData(localPlayer, "dbid") or exports.integration:isPlayerStaff(localPlayer)) then --textColor = tocolor(150,150,150,255) inactiveText = "[Active | " local owner_last_login = getElementData(theVehicle, "owner_last_login") if owner_last_login and tonumber(owner_last_login) then local owner_last_login_text, owner_last_login_sec = exports.datetime:formatTimeInterval(owner_last_login) inactiveText = inactiveText.." Owner last seen "..owner_last_login_text.." " else inactiveText = inactiveText.." Owner last seen is irrelevant | " end local lastused = getElementData(theVehicle, "lastused") if lastused and tonumber(lastused) then local lastusedText, lastusedSeconds = exports.datetime:formatTimeInterval(lastused) inactiveText = inactiveText.."Last used "..lastusedText.."]" else inactiveText = inactiveText.."Last used is irrelevant]" end local toBeAdded = "\n"..inactiveText toBeShowed = toBeShowed..toBeAdded local len = dxGetTextWidth(toBeAdded) if len > fontWidth then fontWidth = len end lines = lines + 1 elseif not active then textColor = tocolor(150,150,150,255) inactiveText = "["..details2.."]" local toBeAdded = "\n"..inactiveText toBeShowed = toBeShowed..toBeAdded local len = dxGetTextWidth(toBeAdded) if len > fontWidth then fontWidth = len end lines = lines + 1 end end end end toBeShowed = toBeShowed.."\n"..descToBeShown end if fontWidth < 90 then fontWidth = 90 end --START DRAWING local marg = 5 local oneLineHeight = dxGetFontHeight(1, fontElement) local fontHeight = oneLineHeight * lines fontWidth = fontWidth*fontType[fontString][2] --Fix custom fonts px = px-(fontWidth/2) if getElementData(localPlayer, "bgVeh") ~= "0" then dxDrawRectangle(px-marg, py-marg, fontWidth+(marg*2), fontHeight+(marg*2), tocolor(0, 0, 0, 10)) end if getElementData(localPlayer, "borderVeh") ~= "0" then dxDrawRectangleBorder(px-marg, py-marg, fontWidth+(marg*2), fontHeight+(marg*2), 1, tocolor(255, 255, 255, 10), true) end dxDrawText(toBeShowed, px, py, px + fontWidth, (py + fontHeight), textColor, 1, fontElement, "center") end end end end end Problem Line : 117 local fiyatt = getElementData(theVehicle, "fiyat") ERROR : attempt to concatenate loca 'fiyatt' (a boolean value) Helpme pls.
  24. Saludos a todos. Hace dos días que tengo el mismo problema y no puedo solucionarlo.. Resulta que tengo dos ordenadores, uno lo utilizo para mis creaciones y testear el servidor (PC sobremesa) Y el otro lo utilizo unicamente como host para el servidor. Dentro del ordenador de testeo todo funciona bien y sin errores. Pero al momento de transladar el servidor al ordenador que utilizo como host, aparece el siguiente error: ERROR: DayZ\Vehicle_spawns.lua:1805: attemp to call global 'getvehicleMaxFuel' <a nil value> Sé que es un error conocido por muchos, se forma cuando intentas spawnear un vehiculo desde el panel de admin (P) Esto genera que se malogre la base de datos del servidor (Internal.db) El problema es que como dije antes, en el servidor de testeo todo funciona perfectamente. Entonces, ¿Porque me aparece este error solo en el ordenador que utilizo como Host? He intentado con Eliminar, reemplazar y hasta reparar el Internal.db, pero hasta ahora nada ha funcionado, el error sigue apareciendo .. ¿Alguna idea?
  25. I've created my first server just little over a while ago and I was wondering is there any way for me to implement better vehicle collisions between 2 players? Example: I'm in a car chasing another player in a car. I want to stop him so I try to perform a pit maneuver (ram my car into his car so that I would unsettle his car and spin him out) What's happening now: I ram my car into his car, he drives off as if nothing happened and I spin out, it's as if his car wasn't even in that position. Bad collisions between 2 player cars, as if the server doesn't sync vehicles properly. What I want to happen: I ram my car into his and he spins out. Good collisions between 2 players. Everything I see on my screen should appear the same on his screen. Server syncs vehicles properly and displays them as they are for all clients. I know that this is possible to do as I played on several servers that has this implemented. Talk to me like to a complete newbie, so far I have only started my server and added createVehicle, noblur and hedit scripts.