Jocker-dan Posted March 15, 2014 Share Posted March 15, 2014 السلآم عليكم والله اني حاولت اصلح هذا الكود عجزت لا اصلحه ابيه اذا لمس الماركر ياخذ سيارة واذا جا مرة ثانية ولمسه يسحب السيارة اللي قبلها ويعطيه سيارة المشكلة انه يكرر المواتر وما يسحب car = {} carmarker = createMarker ( .... ) function d( source ) if ( isElement(car [source]) ) then destroyElement(car [source]) end car [source] = createVehicle ( .... ) warpPedIntoVehicle(thePlayer,car [source]) end addEventHandler( "onMarkerHit", carmarker , d ) addEventHandler("onPlayerQuit",root, function() destroyElement(car [source]) car [source] = nil end ) Link to comment
jafar Posted March 15, 2014 Share Posted March 15, 2014 car = { }; carmarker = createMarker ( x, y, z, "cylinder", 1.5, 255, 0, 0, 255 ); function d ( player ) if getElementType ( player ) == "player" and not isPedInVehicle ( player ) then if isElement ( car [ player ] ) then destroyElement ( car [ player ] ); end car [ player ] = createVehicle ( x, y, z ); warpPedIntoVehicle ( player, car [ player ] ); end end addEventHandler ( "onMarkerHit", carmarker, d ); addEventHandler ( "onPlayerQuit", root, function ( ) if isElement ( car [ source ] ) then destroyElement ( car [ source ] ); end car [ source ] = nil end ); Link to comment
Jocker-dan Posted March 15, 2014 Author Share Posted March 15, 2014 مششكور يالغالي لكن ابيه اذا لمس الماركر وهو داخل السيارة تنسحب السيارة اللي هو راكبها ويعطيه وحدة جديدة مو اذا كان داخل السيارة ما يقدر ياخذ موتر Link to comment
jafar Posted March 15, 2014 Share Posted March 15, 2014 car = { }; carmarker = createMarker ( x, y, z, "cylinder", 1.5, 255, 0, 0, 255 ); function d ( player ) if getElementType ( player ) == "player" then if isElement ( car [ player ] ) then destroyElement ( car [ player ] ); end if isPedInVehicle ( player ) then local vehicle = getPedOccupiedVehicle ( player ); if vehicle then destroyElement ( vehicle ); end end car [ player ] = createVehicle ( x, y, z ); warpPedIntoVehicle ( player, car [ player ] ); end end addEventHandler ( "onMarkerHit", carmarker, d ); addEventHandler ( "onPlayerQuit", root, function ( ) if isElement ( car [ source ] ) then destroyElement ( car [ source ] ); end car [ source ] = nil end ); Link to comment
Jocker-dan Posted March 15, 2014 Author Share Posted March 15, 2014 car = { }; carmarker = createMarker ( x, y, z, "cylinder", 1.5, 255, 0, 0, 255 ); function d ( player ) if getElementType ( player ) == "player" then if isElement ( car [ player ] ) then destroyElement ( car [ player ] ); end if isPedInVehicle ( player ) then local vehicle = getPedOccupiedVehicle ( player ); if vehicle then destroyElement ( vehicle ); end end car [ player ] = createVehicle ( x, y, z ); warpPedIntoVehicle ( player, car [ player ] ); end end addEventHandler ( "onMarkerHit", carmarker, d ); addEventHandler ( "onPlayerQuit", root, function ( ) if isElement ( car [ source ] ) then destroyElement ( car [ source ] ); end car [ source ] = nil end ); مششششكور ويعطيك الف الف الف عآفية 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