Jump to content

x[ مساعدة ]x في FixVehicle


Recommended Posts

مثال الويكي

-- Retrieve a table containing all the vehicles that exist 
vehicles = getElementsByType ( "vehicle" ) 
-- Loop through the list, storing the vehicle from the table in the variable vehicleValue 
for vehicleKey, vehicleValue in ipairs(vehicles) do 
    -- fix the vehicle 
    fixVehicle ( vehicleValue ) 
end 
Link to comment

addCommandHandler("fix_" , function ( player ) 
local aVehicle = getPedOccupiedVehicle ( player ) -- نجيب سيارة الاعب 
if ( aVehicle ) then -- نتحقق لو الاعب راكب السيارة 
fixVehicle ( aVehicle ) -- نصلح السيارة 
    end 
end ) 
Link to comment
GUIEditor = { 
    button = {}, 
    window = {} 
} 
addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
        GUIEditor.window[1] = guiCreateWindow(259, 178, 255, 221, "Fix", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
  
        GUIEditor.button[1] = guiCreateButton(81, 76, 109, 63, "Fix", false, GUIEditor.window[1])     
    end 
) 
  
    addCommandHandler("fix_" , function ( player ) 
    local aVehicle = getPedOccupiedVehicle ( player ) -- نجيب سيارة الاعب 
    if ( aVehicle ) then -- نتحقق لو الاعب راكب السيارة 
    fixVehicle ( aVehicle ) -- نصلح السيارة 
    if source == GUIEditor.button[1] 
        end 
    end ) 

كذا؟ اذا فيه اخطاء قولولي

Link to comment

Example 1

  
addCommandHandler('FixAll',  
function ( ) 
    for _ , VehicleValue in ipairs( getElementsByType ( "vehicle" ) ) do 
        fixVehicle ( VehicleValue ) 
    end 
end ) 

Example 2

addCommandHandler('Me',  
function ( ) 
    if ( isPedInVehicle(localPlayer) ) then 
        fixVehicle ( getPedOccupiedVehicle(localPlayer) ) 
    end 
end ) 

Example 3

addEventHandler('onClientVehicleStartEnter',getRootElement ( ) ,  
function ( ) 
    if ( isPedInVehicle(localPlayer) ) then 
        fixVehicle ( getPedOccupiedVehicle(localPlayer) ) 
    end 
end ) 
  
Link to comment

GUIEditor = { button = { }, window = { }  } 
GUIEditor.window[1] = guiCreateWindow(259, 178, 255, 221, "Fix", false) 
guiWindowSetSizable(GUIEditor.window[1], false) 
GUIEditor.button[1] = guiCreateButton(81, 76, 109, 63, "Fix", false, GUIEditor.window[1])     
  
addCommandHandler("fix_" ,  
function ( ) 
    if ( isPedInVehicle ( localPlayer ) ) then 
        fixVehicle ( getPedOccupiedVehicle ( localPlayer ) ) 
    end 
end ) 
Link to comment

GUIEditor = { button = { }, window = { }  } 
GUIEditor.window[1] = guiCreateWindow(259, 178, 255, 221, "Fix", false) 
guiWindowSetSizable(GUIEditor.window[1], false) 
GUIEditor.button[1] = guiCreateButton(81, 76, 109, 63, "Fix", false, GUIEditor.window[1])     
  
addEventHandler("onClientGUIClick" , GUIEditor.button[1] ,  
function ( ) 
    if ( isPedInVehicle ( localPlayer ) ) then 
        fixVehicle ( getPedOccupiedVehicle ( localPlayer ) ) 
    end 
end , false ) 
Link to comment
GUIEditor = { button = { }, window = { }  } 
GUIEditor.window[1] = guiCreateWindow(259, 178, 255, 221, "Fix", false) 
guiWindowSetSizable(GUIEditor.window[1], false) 
GUIEditor.button[1] = guiCreateButton(81, 76, 109, 63, "Fix", false, GUIEditor.window[1])     
  
addEventHandler("onClientGUIClick" , GUIEditor.button[1] ,  
function ( ) 
    if ( isPedInVehicle ( localPlayer ) ) then 
        fixVehicle ( getPedOccupiedVehicle ( localPlayer ) ) 
    end 
end , false ) 

أرحب #

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