Jump to content

سباون كار


Recommended Posts

السلآم عليكم

والله اني حاولت اصلح هذا الكود

عجزت لا اصلحه

ابيه اذا لمس الماركر ياخذ سيارة

واذا جا مرة ثانية ولمسه

يسحب السيارة اللي قبلها ويعطيه سيارة

المشكلة انه يكرر المواتر

وما يسحب

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
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

مششكور يالغالي

لكن ابيه اذا لمس الماركر وهو داخل السيارة

تنسحب السيارة اللي هو راكبها ويعطيه وحدة جديدة

مو اذا كان داخل السيارة ما يقدر ياخذ موتر

Link to comment
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
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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...