[KilleR] Posted July 4, 2016 Share Posted July 4, 2016 السلام عليكم ابي مثال على [url=https://wiki.multitheftauto.com/wiki/FixVehicle]https://wiki.multitheftauto.com/wiki/FixVehicle[/url] Link to comment
shwaeki Posted July 4, 2016 Share Posted July 4, 2016 مثال الويكي -- 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
' A F . Posted July 4, 2016 Share Posted July 4, 2016 addCommandHandler("fix_" , function ( player ) local aVehicle = getPedOccupiedVehicle ( player ) -- نجيب سيارة الاعب if ( aVehicle ) then -- نتحقق لو الاعب راكب السيارة fixVehicle ( aVehicle ) -- نصلح السيارة end end ) Link to comment
[KilleR] Posted July 4, 2016 Author Share Posted July 4, 2016 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
#Soking Posted July 4, 2016 Share Posted July 4, 2016 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
#Soking Posted July 4, 2016 Share Posted July 4, 2016 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
[KilleR] Posted July 4, 2016 Author Share Posted July 4, 2016 طيب وين الامر يوم يضغط يصلح؟ Link to comment
#Soking Posted July 4, 2016 Share Posted July 4, 2016 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
#1Topro Posted July 4, 2016 Share Posted July 4, 2016 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
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