mody134 Posted February 10, 2017 Share Posted February 10, 2017 (edited) السلام عليكم , لما اخش في الماركر يعطيني سيارة , ابي لما اخش بالسيارة في الماركر يغير السيارة local x, y, z =-3242.17968,-3061.01464,5.10613 local marker = createMarker( x, y, z - 2, "cylinder", 4, 200, 0, 0, 255 ) local vehicles = { } local IDs = { 436, 561, 587, 438, 46, 549, 540, 580, 489, 555, 602, 429, 402, 563, 603, 480, 565, 559 } addEventHandler( "onMarkerHit", marker, function( element ) if getElementType( element ) ~= "player" then return end if isPedInVehicle( element ) then return end if vehicles[ element ] then destroyElement( vehicles[ element ] ) vehicles[ element ] = nil end local pX, pY, pZ = getElementPosition( element ) local pRX, pRY, pRZ = getElementRotation( element ) local randomNum = math.random( #IDs ) local id = IDs[ randomNum ] vehicles[ element ] = createVehicle( id, pX, pY, pZ, pRX, pRY, pRZ ) if vehicles[ element ] then warpPedIntoVehicle( element, vehicles[ element ] ) end end ) addEventHandler( "onPlayerQuit", root, function( ) if vehicles[ source ] then destroyElement( vehicles[ source ] ) vehicles[ source ] = nil end end ) addEventHandler( "onVehicleExplode", root, function( ) setTimer( function( source ) for k, v in ipairs( vehicles ) do if source == v then table.remove( vehicles, k ) end end destroyElement( source ) end, 2000, 1 ) end ) Edited February 10, 2017 by mody134 Link to comment
!#NssoR_) Posted February 10, 2017 Share Posted February 10, 2017 (edited) addEventHandler( "onMarkerHit", marker, function( element ) if getElementType( element ) ~= "player" then return end if vehicles[ element ] then if isPedInVehicle( element ) then local randomNum = math.random( #IDs ) local id = IDs[ randomNum ] setElementModel(vehicles[ element ],id) return else destroyElement(vehicles[ element ]) vehicles[ element ] = nil end end local pX, pY, pZ = getElementPosition( element ) local pRX, pRY, pRZ = getElementRotation( element ) local randomNum = math.random( #IDs ) local id = IDs[ randomNum ] vehicles[ element ] = createVehicle( id, pX, pY, pZ, pRX, pRY, pRZ ) if vehicles[ element ] then warpPedIntoVehicle( element, vehicles[ element ] ) end end ) Edited February 10, 2017 by !#NssoR_) تعديل الاكواد 1 Link to comment
mody134 Posted February 10, 2017 Author Share Posted February 10, 2017 (edited) لما اخش في الماركر يعطيني سيارة بعدين لما اجي اخش بالسيارة ف الماركر ما يخش ! عايز لما اكون راكب سيارة ودخلت بيها ف الماركر يخش ويبدل السيارة الي انا راكبها بسيارة تانية Edited February 10, 2017 by mody134 Link to comment
!#NssoR_) Posted February 10, 2017 Share Posted February 10, 2017 انسخ الكود من جديد عدلته 1 Link to comment
mody134 Posted February 10, 2017 Author Share Posted February 10, 2017 (edited) ظبط تسلم Edited February 10, 2017 by mody134 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now