Jump to content

تصحيح كود


Recommended Posts

ابيه اذا ضغط حرف

x

يصلح السيارة

  
    bindKey ( "x", "down", 
        function (player) 
    if getElementType ( player ) == "player" then 
        if isPedInVehicle ( player ) then 
        local vehicle = getPedOccupiedVehicle ( player ); 
            if vehicle then 
    fixVehicle ( player, vehicle ) 
    end 
        end 
            end 
                end 

Link to comment

طيب يخوي

ابي بس السايق يسوي اصلاح

يعني الحين لو واحد يركب معك يضغط حرف x

يقدر يسوي اصلاح ويسوي انقلاب ويخرب عليكك

كيف اخليه بس السايق يقدر يسوي انقلاب او اصلاح

؟

Link to comment
طيب يخوي

ابي بس السايق يسوي اصلاح

يعني الحين لو واحد يركب معك يضغط حرف x

يقدر يسوي اصلاح ويسوي انقلاب ويخرب عليكك

كيف اخليه بس السايق يقدر يسوي انقلاب او اصلاح

؟

getVehicleController 

Link to comment

addEventHandler( "onResourceStart", resourceRoot, function( ) 
  for _,plrs in ipairs( getElementsByType( "player" ) ) do 
         bindKey( plrs, "x", "down", FixVehicle ) 
      end 
end )    
  
addEventHandler( "onPlayerJoin", root, function ( ) 
    bindKey( source, "x", "down", FixVehicle ) 
end )    
  
  
function FixVehicle ( player ) 
        local vehicle = getPedOccupiedVehicle( player ) 
        if ( vehicle and player == getVehicleController( vehicle ) ) then 
           fixVehicle ( vehicle ) 
      end 
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...