Jump to content

Search the Community

Showing results for tags 'every'.

  • 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. I created "RepairMarkers" and when player hits any of them, their car's health must to increase. But I don't know, how to check every marker here: if isElementWithinMarker( getLocalPlayer(), RepairMarker[1] ) then Instead of "RepairMarker[1]" I want to check every marker Source: function CreateMarkers( thePlayer, seat ) if thePlayer == getLocalPlayer() and seat == 0 then BaysideRM = createMarker( -2259.027, 2386.142, 3.897, "cylinder", 3, 233, 96, 21, 100 ) Area69SkyRM = createMarker( 307.876, 2051.747, 16.587, "cylinder", 5, 233, 96, 21, 100 ) RepairMarker = { BaysideRM, Area69SkyRM } end end function RepairVehicle( hitPlayer, matchingDimension ) if hitPlayer == getLocalPlayer() and matchingDimension == true then local theVehicle = getPedOccupiedVehicle( getLocalPlayer() ) local VehicleHealth = getElementHealth( theVehicle ) local RepairHealth = math.floor( VehicleHealth ) function Repair() if isElementWithinMarker( getLocalPlayer(), RepairMarker[1] ) then if RepairHealth < 1000 then RepairHealth = RepairHealth + 1 setElementHealth( theVehicle, RepairHealth ) else fixVehicle( theVehicle ) playSFX( "script", 11, 1, false ) end else killTimer( RepairTimer ) end end if VehicleHealth < 1000 then RepairTimer = setTimer( Repair, 100, 1001 - math.floor( VehicleHealth ) ) end end end function DestroyMarkers( thePlayer, seat ) if thePlayer == getLocalPlayer() and seat == 0 then for i, v in ipairs( RepairMarker ) do destroyElement( RepairMarker[i] ) end end end addEventHandler( "onClientMarkerHit", getRootElement(), RepairVehicle ) addEventHandler( "onClientVehicleEnter", getRootElement(), CreateMarkers ) addEventHandler( "onClientVehicleExit", getRootElement(), DestroyMarkers )
×
×
  • Create New...