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
    • Open Source Contributors
    • Suggestions
  • General MTA
    • News
    • Media
    • Site/Forum/IRC/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • community.mtasa.com
    • Scripting
    • Maps
    • Resources
    • Other Creations
    • Competitive gameplay
    • Servers
  • Other
    • General
    • Multi Theft Auto 0.5r2
    • Third party GTA mods
  • Archive
    • Archived Items
    • Trash
  • Private Bugtracker

Found 28 results

  1. Tudo bem? Bom não sei se to fazendo algo de errado desse script e tbm não sei se isso funciona. Eu estou tentando pegar o marker de um script.lua e levar para outro .lua exemplo crio o Marker do exemplo.lua e queria leva ele para o exemplo2.lua so que nao sei . Aqui esta o meu script de como estou fazendo Pegar o marker desse script. addEvent("opengui",true) function opengui_func() AgenciaT = guiCreateWindow(412, 90, 546, 486, "Agencia de Empregos", false) Aceitar = guiCreateButton(78, 436, 130, 27, "Aceitar", false, AgenciaT) Cancelar = guiCreateButton(348, 436, 130, 27, "Cancelar", false, AgenciaT) Lista = guiCreateGridList(53, 170, 451, 253, false, AgenciaT) guiGridListAddColumn(Lista, "Empregos", 0.3) guiGridListAddColumn(Lista, "Salários", 0.3) guiGridListAddColumn(Lista, "Cidades", 0.3) for i = 1, 2 do guiGridListAddRow(Lista) end guiGridListSetItemText(Lista, 0, 1, "Piloto", false, false) guiGridListSetItemText(Lista, 0, 2, "1500", false, false) guiGridListSetItemText(Lista, 0, 3, "Los Santos", false, false) guiGridListSetItemText(Lista, 1, 1, "Fazendeiro", false, false) guiGridListSetItemText(Lista, 1, 2, "1000", false, false) guiGridListSetItemText(Lista, 1, 3, "Los Santos", false, false) Messager = guiCreateMemo(48, 38, 451, 124, "Seja Bem Vindo a Prefeitura do Servidor, BRASIL TOP RPG para você começar a trabalhar precisa selecionar o emprego que você deseja trabalhar e apertar em Aceitar. Boa Sorte com seu novo emprego", false, AgenciaT) guiMemoSetReadOnly ( Messager, true) showCursor(true) addEventHandler("onClientGUIClick", Cancelar, function() destroyElement(AgenciaT) showCursor(false) end, false) function onGridListClick(source) local itemrow,itemcolumn = guiGridListGetSelectedItem(Lista) if itemrow ~= -1 then if guiGridListGetItemText( Lista, itemrow, 1 ) == "Piloto" then blip = createBlip ( 2003.5859375, -2401.1025390625, 13.546875, 42) outputDebugString("Blip visible distance: "..getBlipVisibleDistance(blip)) setBlipVisibleDistance(blip, 10000) -- Distancia Aeroporto LS outputChatBox("Local marcador vá até o [T]", source) destroyElement(AgenciaT) showCursor(false) else if itemrow ~= -1 then if guiGridListGetItemText( Lista, itemrow, 1 ) == "Fazendeiro" then Carro = createMarker (1482.3427734375, -1729.4150390625, 13.3828125 -1, "cylinder", 2, 255 ,0 ,0, 255) --Quero levar esse marker para outro .lua para pode spawna o veiculo triggerServerEvent(source, "trabalho", source, true) -- e aqui é quando leva para o script servidor bom nao se se é aqui o erro outputChatBox("Local marcador vá até o [T]", source) destroyElement(AgenciaT) showCursor(false) end end end end end addEventHandler("onMarkerHit",Carro,onGridListClick) -- o evento addEventHandler("onClientGUIClick", Aceitar, onGridListClick) end addEventHandler("opengui", root, opengui_func) E levar para esse script. local marker = createMarker(362.8115234375, 173.8154296875, 1008.3828125 -1, "cylinder", 1.5, 255, 0, 0) setElementInterior(marker, 3) function guioeffnen(player) triggerClientEvent(player, "opengui", player, true) end addEventHandler("onMarkerHit",marker,guioeffnen) function pegar (source) -- quero usar o marker de la para fazer essa função if isElementWithinMarker(source, Carro) then if veh[source] and isElement( veh[source] ) then destroyElement ( veh[source] ) veh[source] = nil end x,y,z = getElementPosition(source) Islamico = true veh[source] = createVehicle(422,1481.083984375, -1730.6201171875, 13.3828125, 0, 0, 109.58242797852) warpPedIntoVehicle( source, veh[source] ) end addEvent("trabalho",true) end addEventHandler( "onMarkerHit",Carro, pegar )
  2. help me pls **sorry for my bad English**
  3. I'm trying to create a blip with a icon id of 51 in all the cars in my server, but as soon as I add more cars it starts lagging, how can I iterate through all of them without lagging?!
  4. [HELP]Vehicle Move

    How can I move a vehicle up to a certain point by having it follow the mta streets?
  5. VehicleExhaustPosition

    Hello, I would be that many servers that include modifications on vehicles, would agree with this suggestion. getVehicleExhaustPosition would get the current position of exhaust on vehicle, setVehicleExhaustPosition would change the position to correct place (to fit modifications on vehicles, such as adding custom bumpers or so), also setVehicleExhaustType for changing type, for example Infernus has only "exhaust" node in DFF file, but displays as two exhausts on each side, mirrored by axis of car. By changing type it would change to only one exhaust, or two. I don't really know how this works in handling, maybe it could be worked on somehow. Cheers, NoHear.
  6. function addPaintjob(commandName,paintjobID) me = getLocalPlayer() if isPedInVehicle ( me ) then triggerServerEvent ( "addPJ", resourceRoot, tonumber(paintjobID), me ) end end addCommandHandler ("addpaintjob",addPaintjob) function addPaintjob2(paintjobID,player) if paintjobID == 1 then myTexture = dxCreateTexture( "paintjob1.png" ) elseif paintjobID == 2 then myTexture = dxCreateTexture( "paintjob2.png" ) elseif paintjobID == 3 then myTexture = dxCreateTexture( "paintjob3.png" ) elseif paintjobID == 4 then myTexture = dxCreateTexture( "paintjob4.png" ) elseif paintjobID == 5 then myTexture = dxCreateTexture( "paintjob5.png" ) elseif paintjobID == 6 then myTexture = dxCreateTexture( "paintjob6.png" ) else if player == getLocalPlayer() then outputChatBox ("There is no such paintjob ID!") return end end engineRemoveShaderFromWorldTexture ( shader_cars, "vehiclegrunge256", getPedOccupiedVehicle(player) ) shader_cars, tec = dxCreateShader ( "shader.fx" ) engineApplyShaderToWorldTexture ( shader_cars, "vehiclegrunge256", getPedOccupiedVehicle(player) ) dxSetShaderValue ( shader_cars, "TX0", myTexture ) end addEvent( "addPJ2", true ) addEventHandler( "addPJ2", getLocalPlayer(), addPaintjob2 ) function removePaintjob2(player) if engineApplyShaderToWorldTexture ( shader_cars, "vehiclegrunge256", getPedOccupiedVehicle(player) ) then me = getLocalPlayer() engineRemoveShaderFromWorldTexture ( shader_cars, "vehiclegrunge256", getPedOccupiedVehicle(player) ) removePaintjob2(player) end end addEvent( "removePJ2", true ) addEventHandler( "removePJ2", getLocalPlayer(), removePaintjob2 ) function removePaintjob() triggerServerEvent ( "removePJ", resourceRoot, getLocalPlayer() ) end addCommandHandler ("removepaintjob",removePaintjob) It works everything to wonder, but when it comes to paintjob for certain imported vehicles you can not. How could you apply a paintjob to these vehicles? I do not want to change color, but have multiple skin... Thanks for you Attention
  7. Hey, When you're not moving your mouse while driving a vehicle, your camera will start to move back to the original "behind the vehicle" view. Is there any way I could cancel out that camera movement? I was working on something that allows the player to target a hydra while flying one himself (kinda like the GTA5 target/focus one), so it would be easier to fight each other. I made a small video explaining my problem, I hope that explains it a bit better. I really appreciate any help you can provide.
  8. vehicle reboot

    Üdv. Elkezdtem irni egy vehicle-systemet es amikor ujra inditom a resourcet akkor ugye lekene menteni ujbol az adatokat hogy a kocsihozz kosse. Bovebben, sql -bol kene a kocsihoz kotni egy id-t de nincs ra otletem igy oldottam meg amikor elkeszitem az autot. if isElement(cars) then local vehicleQuery = dbQuery(connect,"INSERT INTO vehicle SET owner= ? , type = ? , r=?, g=? , b=?, x= ? ,y = ? ,z = ? ", owner, vehicleModel, r,g,b,px,py,pz) local vehicleQueryResult, _, beszurtID = dbPoll(vehicleQuery, -1) if vehicleQueryResult then setElementData(cars, "kocsi:id", beszurtID) local kocsiID = getElementData(cars, "kocsi:id") for k,v in ipairs(result) do if v["id"] == tonumber(owner) then owner_name = v["charname"]:gsub("_", " ") owner_id = v["id"] setElementData(cars, "kocsi:owner", owner_name) setElementData(cars, "kocsi:owner:id",owner_id) end end end end Ilyesmivel probalkoztam.(nem jott be) function res_resource(resource) local qh_v = dbQuery(connect, "SELECT * FROM vehicle") local result_v = dbPoll(qh_v,-1) for k,v in pairs(result_v) do local car = createVehicle(v["type"],v["sx"],v["sy"],v["sz"]) local color = setVehicleColor(car,v["r"],v["g"],v["b"]) if isElement(car) then local vehicleQueryResult, _, beszurtID = dbPoll(result_v[k], -1) if vehicleQueryResult then setElementData(cars, "kocsi:id", beszurtID) local kocsiID = getElementData(cars, "kocsi:id") outputChatBox(tostring(kocsiID),source) end end end end addEventHandler("onResourceStart", root , res_resource)
  9. vehicles reboot

    Üdv. Elkezdtem irni egy vehicle-systemet es amikor ujra inditom a resourcet akkor ugye lekene menteni ujbol az adatokat hogy a kocsihozz kosse. Bovebben, sql -bol kene a kocsihoz kotni egy id-t de nincs ra otletem igy oldottam meg amikor elkeszitem az autot. if isElement(cars) then local vehicleQuery = dbQuery(connect,"INSERT INTO vehicle SET owner= ? , type = ? , r=?, g=? , b=?, x= ? ,y = ? ,z = ? ", owner, vehicleModel, r,g,b,px,py,pz) local vehicleQueryResult, _, beszurtID = dbPoll(vehicleQuery, -1) if vehicleQueryResult then setElementData(cars, "kocsi:id", beszurtID) local kocsiID = getElementData(cars, "kocsi:id") for k,v in ipairs(result) do if v["id"] == tonumber(owner) then owner_name = v["charname"]:gsub("_", " ") owner_id = v["id"] setElementData(cars, "kocsi:owner", owner_name) setElementData(cars, "kocsi:owner:id",owner_id) end end end end Ilyesmivel probalkoztam.(nem jott be) function res_resource(resource) local qh_v = dbQuery(connect, "SELECT * FROM vehicle") local result_v = dbPoll(qh_v,-1) for k,v in pairs(result_v) do local car = createVehicle(v["type"],v["sx"],v["sy"],v["sz"]) local color = setVehicleColor(car,v["r"],v["g"],v["b"]) if isElement(car) then local vehicleQueryResult, _, beszurtID = dbPoll(result_v[k], -1) if vehicleQueryResult then setElementData(cars, "kocsi:id", beszurtID) local kocsiID = getElementData(cars, "kocsi:id") outputChatBox(tostring(kocsiID),source) end end end end addEventHandler("onResourceStart", root , res_resource)
  10. Hi, I will doing job, but I always have got problem with arguments in trigger I read Elements Tree on wiki, but I still do not know what this is about When player hit marker then s-side must create vehicle. C-side StartJobM = createMarker (-165.35049, 1059.69141, 18.74219, 'cylinder', 1.0, 22, 38, 199, 255) function StartJob (hitPlayer, matchingDimension) if isPedInVehicle (hitPlayer) then outputChatBox ("You can't hit marker when u are in vehicle!") cancelEvent () if getElementType(hitPlayer) == getlocalPlayer then triggerServerEvent ("poj", localPlayer ) outputChatBox ("Created vehicle!") end end end addEventHandler ("onClientMarkerHit", StartJobM, StartJob) StartJobM = createMarker (-165.35049, 1059.69141, 18.74219, 'cylinder', 1.0, 22, 38, 199, 255) function StartJob (hitPlayer, matchingDimension) if isPedInVehicle (hitPlayer) then outputChatBox ("You can't hit marker when u are in vehicle!") cancelEvent () if getElementType(hitPlayer) == getlocalPlayer then triggerServerEvent ("poj", localPlayer ) outputChatBox ("Created vehicle!") end end end addEventHandler ("onClientMarkerHit", StartJobM, StartJob) S-side: function VehicleC() lcvehi = createVehicle (422, -158.49141, 1051.20691, 19.75892) end addEvent("poj") addEventHandler("poj", getRootElement(), VehicleC) Please, explain me how i Can triggering
  11. I created a Brown Streak mod. And the dff&txd working fine, but the .col does not working. I got a warning in debugscript 3: mod.lua:14: Bad 'number' pointer @ engineReplaceCOL'(2) This is the mod.lua code: function replaceModel() local txd colsok = engineLoadCOL ( "v43.col" ) engineReplaceCOL ( colsok, 538) txd = engineLoadTXD ( "v43.txd" ) engineImportTXD ( txd, 538 ) dff = engineLoadDFF ( "v43.dff" ) engineReplaceModel ( dff, 538 ) end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceModel) addCommandHandler ( "reloadcar", replaceModel ) What wrong? How to fix this?
  12. help

    in my server when the vehicle is blast or destroy, that destroy vehicle is been for long time. i want a script which removes destroyed vehicle in 3 or 4 second . please help me
  13. how to block vehcile?

    help! can anyone tell me how to block rino and some vehicle. please......
  14. Well, this is recent, it was working fine, but now it stopped working, any solution? (arguments are right) no error in debug !
  15. Hello there, I've been trying to create a weapon (uzi) and attach it on a vehicle (hydra) the weapon should fire when I click the left mouse button. I am stuck at the very beginning of the script (trying to get the uzi to spawn) and I just cannot progress any further. function hydraGuns() local vehicle = getPedOccupiedVehicle(localPlayer) if(vehicle)then if getElementModel(vehicle) == 520 then local x, y, z = getElementPosition(vehicle) local weapon = createWeapon("uzi", x, y, z) outputChatBox ("Hydra guns are installed") end end end What am I doing wrong?
  16. Problema MTA DAYZ

    Hola chicos, bueno ocupo una pequeña ayuda con este script del dayz el problema es el siguiente: Los autos funcionan perfecto y todo el problema es que no hay sonido únicamente quien maneja el vehículo lo escucha. --Esto es lo que tengo en el survivorSystem_client.lua function toggleEngine() if getPedOccupiedVehicleSeat(getLocalPlayer()) ~= 0 then return end veh = getPedOccupiedVehicle(getLocalPlayer()) vehCol = getElementData(veh,"parent") needengine = getElementData(vehCol,"needengines") needtires = getElementData(vehCol,"needtires") needrotor = getElementData(vehCol,"needrotor") needparts = getElementData(vehCol,"needparts") needglass = getElementData(vehCol,"needglass") engine = getElementData(vehCol,"Engine_inVehicle")or 0 tires = getElementData(vehCol,"Tire_inVehicle")or 0 rotor = getElementData(vehCol,"Rotor_inVehicle")or 0 parts = getElementData(vehCol,"Parts_inVehicle")or 0 fuel = getElementData(vehCol,"fuel") if needengine == engine and needtires == tires and needrotor == rotor and (fuel > 0) and needparts == parts then setVehicleEngineState(veh,not getVehicleEngineState(veh)) end if getVehicleEngineState(veh)== true then triggerEvent("displayClientInfo",getLocalPlayer(),"Vehicle","Engine started!",22,255,0) else triggerEvent("displayClientInfo",getLocalPlayer(),"Vehicle","Engine stopped!",255,22,0) end end bindKey("k","down",toggleEngine) Y esto -- Esto es lo de vehicle_spawns.lua function onPlayerEnterDayzVehicle(veh,seat) if seat == 0 then setVehicleEngineState(veh,false) outputChatBox("Press 'K' to turn the engine on/off!",source,255,255,255) end end addEventHandler("onPlayerVehicleEnter",getRootElement(),onPlayerEnterDayzVehicle) function onPlayerExitDayzVehicle(veh,seat) if seat == 0 then setVehicleEngineState(veh,false) end end addEventHandler("onPlayerVehicleExit",getRootElement(),onPlayerExitDayzVehicle) Gracias desde ya
  17. Alright so I'm trying to make vehicles more deadly. When a player or bot get hit by a vehicle I don't want the vehicle to bounce away but the player to fall 100% of the times (just by a simple touch) and then in some realistic sense loose health depending on the collision force. What function would you recommend? Are any of these properties useful for my needs? I'm thinking of collisionDamageMultiplier and onVehicleCollission for instance, would those be a good approach? have anyone done anything like this before?
  18. Request 5 HELP

    Can someone make me a script that on explode for example - plane wont disappear , but just on explode plane will become wreck....
  19. Vehicle cap position

    Hi! I want to create a fuel system. But I don't know how to calculate the cap's position. I know, that I can do it with getElementPosition, getElementRotation and Offset. But how?
  20. Hey, anyone knows how to make the function https://wiki.multitheftauto.com/wiki/GetElementBoundingBox work with a rotated vehicle/object? If I get the position of a vehicle and add the values returned by this function, they are only at the correct position if the vehicle isn't rotated. How do I make it take the rotation into account? Bonsai
  21. Request 2

    Hi ! Can someone do me a favor and make a script that vehicle that has 3000 health like in gta 5 because im angry at gta san andreas because cars explode too fast...
  22. Hello everyone. I need to destroy a vehicle that is idle for 60 seconds (Freeroam already has this function, so this part is unnecessary to make.) It starts counting when the vehicle becomes totally empty, (with no driver and no passengers), if someone enters in it before 60 seconds (as passenger or driver), the counting stops and restarts when the vehicle becomes empty again.) (Freeroam already works like this.) BUT If the car is from a .map, it need to be respawned to its original position on the map. Else if the car was created by a player (F1, command, Admin Panel, scripts, etc) so it will be destroyed. How can I differentiate the vehicles created by the .map from those created by the players? Also, when the vehicle gets exploded: if it is from a .map it will respawn after 10 seconds, else if was created by a player it will be destroyed after 10 seconds. I have a little script that respawn all vehicles that have been exploded. But it respawns all the vehicles created by players too... -- 1 second = 1000 function respawnExplodedVehicle() setTimer(respawnVehicle, 10000, 1, source) end addEventHandler("onVehicleExplode", getRootElement(), respawnExplodedVehicle)
  23. Get vehicle from a label

    Hi! I have a faction panel, and I want to do that I have a list of faction vehicles with label, and when I click one of these, give me informations of the clicked vehicle. With the members(players) I can do it, because there is a getPlayerFromName. But with vehicles how can I do this?
  24. Hey guys! I've a problem with setVehicleEngineState. When I use it to turn off the engine, the engine immediately turns on and I don't know why. I hope you can help me. (Sorry for my bad english:S)