Jump to content

Search the Community

Showing results for tags 'farmspawn'.

  • 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
    • General
    • Multi Theft Auto 0.5r2
    • Third party GTA mods
  • Archive
    • Archived Items
    • Trash

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Gang


Location


Occupation


Interests

Found 1 result

  1. Hello Community, i would like to have some support here, the code works fine on this script which once the Vehicle damage is below "350", it gets Destroyed in a couple of seconds and then once the script calls this : setTimer( sec, 6000, 0 ) It doesn't spawn a single Vehicle as i wish to, it Spawns an infinate Vehicles on the same place. i just need help to make it spawn Only One. Here is the full code : function sec () local car = createVehicle ( 428, 2317.0588378906,2408.1867675781,10.8203125) setElementData(car,"sec",true) setVehicleDamageProof(car,true) end addEventHandler("onResourceStart", resourceRoot,sec) function checkDamage(player) for _,vehicle in ipairs ( getElementsByType ( "vehicle" ) ) do if getElementData(source,"sec") then else return end if getElementHealth(source) > 350 then setVehicleDamageProof(source,false) setVehicleEngineState(source,true) else setVehicleDamageProof(source,true) setVehicleEngineState(source,false) for i,player in pairs(getVehicleOccupants(source)) do setControlState(souce,"enter_exit",true) --setTimer(respawnVehicle, 6000, 1, source) --------------------------------------------- x, y, z = getElementPosition(source) setTimer ( function() bag = createPickup( x-6, y, z, 3, 1550 ) setElementCollisionsEnabled( bag, false ) end, 4000, 1) -------------------------------------------- setTimer( destroyElement, 1000, 1, source) --setTimer( destroyElement, 50, 1, source) setTimer( sec, 6000, 0 ) end end end end addEventHandler("onVehicleDamage",getRootElement(),checkDamage)
×
×
  • Create New...