Jump to content

تعديل بسيط


Recommended Posts

سلام عليكم

اليوم لوحه بتفتح من ف8 _rr

عاوزها تفتح بحرف ظ /

كلنت

-- M7mdAl7arthy -- 
-- Skype: M7mdAl7arthy -- 
-- Updated: 3NAD -- 
  
getTDByType = 
{ 
    --[[ { 'car name', car id, 'file Path' }; --]] 
    { 'Camry 2011', 566, 'xCar7' };  
    { 'Camry 2006', 585, 'xCar17' }; 
}; 
  
Languages = { 
    ["English"] = { 
        ["Information"] = "Welcome @ 6ArH Server's, \n\nIf you have a bad Video Card ' Law FPS '\nof Real Cars,\n\nYou can stop it by this script..\n\nIt's so easily :\n- Select any car.\n- Press \" Run / Stop Selected \".\n\nYou can open this window again\nby pressing ' / '\n\nWe hope you have fun : )"; 
        ["Run Or Stop"] = "Run / Stop Selected"; 
        ["Run All"] = "Run All"; 
        ["Stop All"] = "Stop All"; 
    }; 
    ["عربي"] = { 
        ["Information"] = "مرحباً بكم في سيرفرات طارهـ,\n\nإذا كآن لديك كرت شاشة سيء ' FPS منخفض '\nو تعاني من الـ ' لاق ' بـسبب السيارات\n\nيمكنك إيقاف السيارات بواسطة هذا السكربت\n\nتابع الخطوات :\n- أختر اي سيارة من القائمة.\n- أضغط ' إيقاف / تشغيل '.\n\nيمكنك فتح هذه النافذة مرة أخرى\nبواسطة الزر ' ظ '\n\n نتمنى لكم قضاء اوقات سعيدة"; 
        ["Run Or Stop"] = "تشغيل / إيقاف"; 
        ["Run All"] = "تشغيل الكل"; 
        ["Stop All"] = "إيقاف الكل"; 
    }; 
} 
  
Enad = { 
    button = {}, 
    window = {}, 
    gridlist = {}, 
    label = {}, 
    combobox = {}, 
} 
  
function centerWindow(center_window, x, y) 
    local screenW,screenH=guiGetScreenSize() 
    local windowW,windowH=guiGetSize(center_window,false) 
    local x,y = (screenW-windowW)/x,(screenH-windowH)/y 
    guiSetPosition(center_window,x,y,false) 
end 
  
load_ = true 
i = true 
  
Enad.window[1] = guiCreateWindow(200, 131, 425, 407, ":: Panel Systeam ::", false) 
guiWindowSetSizable(Enad.window[1], false) 
guiSetVisible ( Enad.window[1], false ) 
guiWindowSetSizable(Enad.window[1], false) 
guiSetAlpha(Enad.window[1], 1.00) 
centerWindow ( Enad.window[1], 2, 2 ) 
GUIEditor.combobox[1] = guiCreateComboBox(25, 64, 390, 88, "عربي", false, Enad.window[1]) 
guiComboBoxAddItem(GUIEditor.combobox[1], "English") 
guiComboBoxAddItem(GUIEditor.combobox[1], "عربي") 
GUIEditor.gridlist[1] = guiCreateGridList(63, 142, 352, 231, false, Enad.window[1]) 
guiGridListAddColumn(GUIEditor.gridlist[1], "#", 0.9) 
GUIEditor.button[1] = guiCreateButton(149, -8611, 92, 318, "", false, Enad.window[1]) 
guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA")     
--Enad.button[4] = guiCreateButton(218, 285, 72, 34, "Run All", false, Enad.window[1]) 
--guiSetProperty(Enad.button[4], "NormalTextColour", "FFAAAAAA") 
  
Column2 = guiGridListAddColumn( Enad.gridlist[1], 'ID', .25 ) 
Column2_ = guiGridListAddColumn( Enad.gridlist[1], 'Vehicle', .60 ) 
  
for _, type in ipairs( getTDByType )do 
    local gRow = guiGridListAddRow( Enad.gridlist[1] ) 
    guiGridListSetItemText( Enad.gridlist[1], gRow, Column2, tostring( type[ 2 ] ), false, false    )    
    guiGridListSetItemText( Enad.gridlist[1], gRow, Column2_, tostring( type[ 1 ] ), false, false ) 
    t = guiGridListSetItemData( Enad.gridlist[1], gRow, Column2_, tostring( type[ 3 ] ) ) 
    guiGridListSetItemColor ( Enad.gridlist[1], gRow, Column2, 0, 255, 0 ) 
end 
         
addEventHandler ( "onClientGUIClick", root, 
    function ( ) 
        if source == Enad.button[1] then 
            local iRow, iCol = guiGridListGetSelectedItem( Enad.gridlist[1] ) 
            if( iRow and iCol and iRow ~= -1 and iCol ~= -1 )then 
                local ID = tonumber( guiGridListGetItemText( Enad.gridlist[1], iRow, 1 ) ) 
                local CN = tostring( guiGridListGetItemText( Enad.gridlist[1], iRow, 2 ) ) 
                local filePath = tostring( guiGridListGetItemData( Enad.gridlist[1], iRow, 2 ) ) 
                if( ID ~= '' )then 
                    if fileExists( ':'.. filePath ..'/'.. ID ..'.txd' ) and fileExists( ':'.. filePath ..'/'.. ID ..'.dff', ID ) then 
                        if not( engineRestoreModel( ID ) )then 
                            engineImportTXD( engineLoadTXD( ':'.. filePath ..'/'.. ID ..'.txd' ), ID ) 
                            engineReplaceModel( engineLoadDFF( ':'.. filePath ..'/'.. ID ..'.dff', ID ), ID ) 
                            guiGridListSetItemColor ( Enad.gridlist[1], iRow, 1, 0, 255, 0 ) 
                            load_ = true 
                        else 
                            guiGridListSetItemColor ( Enad.gridlist[1], iRow, 1, 255, 0, 0 ) 
                            load_ = false 
                        end 
                        guiSetEnabled ( source, false ) 
                        setTimer ( guiSetEnabled, 3000, 1, source, true ) 
                    else 
                        if i == true then 
                        guiGridListSetItemColor ( Enad.gridlist[1], iRow, 1, 255, 255, 0 ) 
                        i = false 
                        setTimer( function( ) i = true end, 5000, 1 ) 
                        end 
                    end 
                end 
            end  
        elseif source == Enad.button[2] then 
            guiSetVisible ( Enad.window[1], false ) 
            showCursor ( false ) 
            executeCommandHandler ( "onStartPlay_" ) 
            bindKey( '/', 'down', 'rr_' ) 
        elseif source == Enad.button[3] then 
            guiSetEnabled ( source, false ) 
            setTimer ( guiSetEnabled, 10000, 1, source, true ) 
            if not load_ then return end 
            load_ = false            
            for i, type in ipairs( getTDByType )do 
                if fileExists( ':'.. type[3] ..'/'.. type[2] ..'.txd' ) and fileExists( ':'.. type[3] ..'/'.. type[2] ..'.dff', type[2] ) then 
                    engineRestoreModel( type[2] ) 
                end 
            end 
            guiGridListClear ( Enad.gridlist[1] ) 
            for _, type in ipairs( getTDByType )do 
                local gRow = guiGridListAddRow( Enad.gridlist[1] ) 
                guiGridListSetItemText( Enad.gridlist[1], gRow, Column2, tostring( type[ 2 ] ), false, false    )    
                guiGridListSetItemText( Enad.gridlist[1], gRow, Column2_, tostring( type[ 1 ] ), false, false ) 
                t = guiGridListSetItemData( Enad.gridlist[1], gRow, Column2_, tostring( type[ 3 ] ) ) 
                guiGridListSetItemColor ( Enad.gridlist[1], gRow, Column2, 255, 0, 0 ) 
            end  
        elseif source == Enad.button[4] then 
            guiSetEnabled ( source, false ) 
            setTimer ( guiSetEnabled, 10000, 1, source, true ) 
            if load_ then return end 
            load_ = true 
            if isTimer ( loadTimer ) then killTimer ( loadTimer ) end 
            loadTimer = setTimer (  
                function ( ) 
                    for i, type in ipairs( getTDByType )do 
                        if fileExists( ':'.. type[3] ..'/'.. type[2] ..'.txd' ) and fileExists( ':'.. type[3] ..'/'.. type[2] ..'.dff', type[2] ) then 
                            engineImportTXD( engineLoadTXD( ':'.. type[3] ..'/'.. type[2] ..'.txd' ), type[2] ) 
                            engineReplaceModel( engineLoadDFF( ':'.. type[3] ..'/'.. type[2] ..'.dff', type[2] ), type[2] ) 
                        end 
                    end 
                end 
            , 1500, 1 ) 
            guiGridListClear ( Enad.gridlist[1] ) 
            for _, type in ipairs( getTDByType )do 
                local gRow = guiGridListAddRow( Enad.gridlist[1] ) 
                guiGridListSetItemText( Enad.gridlist[1], gRow, Column2, tostring( type[ 2 ] ), false, false    )    
                guiGridListSetItemText( Enad.gridlist[1], gRow, Column2_, tostring( type[ 1 ] ), false, false ) 
                t = guiGridListSetItemData( Enad.gridlist[1], gRow, Column2_, tostring( type[ 3 ] ) ) 
                guiGridListSetItemColor ( Enad.gridlist[1], gRow, Column2, 0, 255, 0 ) 
            end 
            if isTimer ( Timer ) then killTimer ( Timer ) end 
            resetProgress_ ( pp_ ) 
            fadeCamera ( false ) 
            Timer = setTimer ( upgradeValues_, 50, 0, pp_ )          
        end 
    end 
) 
  
for i, v in pairs ( Languages ) do 
    guiComboBoxAddItem ( Enad.combobox[1], tostring ( i ) ) 
end 
  
addEventHandler ( "onClientGUIComboBoxAccepted", Enad.combobox[1], 
    function ( ) 
        local text = tostring ( guiComboBoxGetItemText ( source, guiComboBoxGetSelected ( source ) ) ) 
        if text == "" then return end 
        if text == "عربي" then 
            guiLabelSetHorizontalAlign ( Enad.label[1], "right" ) 
        else 
            guiLabelSetHorizontalAlign ( Enad.label[1], "left" )     
        end 
        guiSetText ( Enad.label[1], Languages[text]["Information"] ) 
        guiSetText ( Enad.button[1], Languages[text]["Run Or Stop"] ) 
        guiSetText ( Enad.button[4], Languages[text]["Run All"] ) 
        guiSetText ( Enad.button[3], Languages[text]["Stop All"] ) 
    end 
, false ) 
  
addCommandHandler( 'openOptionsCar', 
    function( ) 
        if not guiGetVisible ( Enad.window[1] ) then 
            guiSetVisible( Enad.window[1], true ) 
            showCursor( true ) 
            guiBringToFront( Enad.window[1] ) 
            guiSetVisible ( Enad.button[2], true ) 
        end 
    end 
) 
  
bindKey( "/", "down", 
    function ( ) 
        if not guiGetVisible ( Enad.window[1] ) then 
            guiSetVisible( Enad.window[1], true ) 
            showCursor( true ) 
            guiBringToFront( Enad.window[1] ) 
            guiSetVisible ( Enad.button[2], false ) 
        else 
            guiSetVisible( Enad.window[1], false ) 
            showCursor( false )          
        end  
    end 
) 
  
--[[ 
addCommandHandler( 'reall', 
    function( ) 
        for i, type in ipairs( getTDByType )do 
            if fileExists( ':'.. type[3] ..'/'.. type[2] ..'.txd' ) and fileExists( ':'.. type[3] ..'/'.. type[2] ..'.dff', type[2] ) then 
                if not( engineRestoreModel( type[2] ) )then 
                    engineImportTXD( engineLoadTXD( ':'.. type[3] ..'/'.. type[2] ..'.txd' ), type[2] ) 
                    engineReplaceModel( engineLoadDFF( ':'.. type[3] ..'/'.. type[2] ..'.dff', type[2] ), type[2] ) 
                end 
            end 
        end 
    end 
)]] 
  

سرفر

-- 

Link to comment

جرب

-- M7mdAl7arthy -- 
-- Skype: M7mdAl7arthy -- 
-- Updated: 3NAD -- 
  
getTDByType = 
{ 
    --[[ { 'car name', car id, 'file Path' }; --]] 
    { 'Camry 2011', 566, 'xCar7' };  
    { 'Camry 2006', 585, 'xCar17' }; 
}; 
  
Languages = { 
    ["English"] = { 
        ["Information"] = "Welcome @ 6ArH Server's, \n\nIf you have a bad Video Card ' Law FPS '\nof Real Cars,\n\nYou can stop it by this script..\n\nIt's so easily :\n- Select any car.\n- Press \" Run / Stop Selected \".\n\nYou can open this window again\nby pressing ' / '\n\nWe hope you have fun : )"; 
        ["Run Or Stop"] = "Run / Stop Selected"; 
        ["Run All"] = "Run All"; 
        ["Stop All"] = "Stop All"; 
    }; 
    ["عربي"] = { 
        ["Information"] = "مرحباً بكم في سيرفرات طارهـ,\n\nإذا كآن لديك كرت شاشة سيء ' FPS منخفض '\nو تعاني من الـ ' لاق ' بـسبب السيارات\n\nيمكنك إيقاف السيارات بواسطة هذا السكربت\n\nتابع الخطوات :\n- أختر اي سيارة من القائمة.\n- أضغط ' إيقاف / تشغيل '.\n\nيمكنك فتح هذه النافذة مرة أخرى\nبواسطة الزر ' ظ '\n\n نتمنى لكم قضاء اوقات سعيدة"; 
        ["Run Or Stop"] = "تشغيل / إيقاف"; 
        ["Run All"] = "تشغيل الكل"; 
        ["Stop All"] = "إيقاف الكل"; 
    }; 
} 
  
Enad = { 
    button = {}, 
    window = {}, 
    gridlist = {}, 
    label = {}, 
    combobox = {}, 
} 
  
function centerWindow(center_window, x, y) 
    local screenW,screenH=guiGetScreenSize() 
    local windowW,windowH=guiGetSize(center_window,false) 
    local x,y = (screenW-windowW)/x,(screenH-windowH)/y 
    guiSetPosition(center_window,x,y,false) 
end 
  
load_ = true 
i = true 
  
Enad.window[1] = guiCreateWindow(200, 131, 425, 407, ":: Panel Systeam ::", false) 
guiWindowSetSizable(Enad.window[1], false) 
guiSetVisible ( Enad.window[1], false ) 
guiWindowSetSizable(Enad.window[1], false) 
guiSetAlpha(Enad.window[1], 1.00) 
centerWindow ( Enad.window[1], 2, 2 ) 
GUIEditor.combobox[1] = guiCreateComboBox(25, 64, 390, 88, "عربي", false, Enad.window[1]) 
guiComboBoxAddItem(GUIEditor.combobox[1], "English") 
guiComboBoxAddItem(GUIEditor.combobox[1], "عربي") 
GUIEditor.gridlist[1] = guiCreateGridList(63, 142, 352, 231, false, Enad.window[1]) 
guiGridListAddColumn(GUIEditor.gridlist[1], "#", 0.9) 
GUIEditor.button[1] = guiCreateButton(149, -8611, 92, 318, "", false, Enad.window[1]) 
guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA")     
--Enad.button[4] = guiCreateButton(218, 285, 72, 34, "Run All", false, Enad.window[1]) 
--guiSetProperty(Enad.button[4], "NormalTextColour", "FFAAAAAA") 
  
Column2 = guiGridListAddColumn( Enad.gridlist[1], 'ID', .25 ) 
Column2_ = guiGridListAddColumn( Enad.gridlist[1], 'Vehicle', .60 ) 
  
for _, type in ipairs( getTDByType )do 
    local gRow = guiGridListAddRow( Enad.gridlist[1] ) 
    guiGridListSetItemText( Enad.gridlist[1], gRow, Column2, tostring( type[ 2 ] ), false, false    )    
    guiGridListSetItemText( Enad.gridlist[1], gRow, Column2_, tostring( type[ 1 ] ), false, false ) 
    t = guiGridListSetItemData( Enad.gridlist[1], gRow, Column2_, tostring( type[ 3 ] ) ) 
    guiGridListSetItemColor ( Enad.gridlist[1], gRow, Column2, 0, 255, 0 ) 
end 
        
addEventHandler ( "onClientGUIClick", root, 
    function ( ) 
        if source == Enad.button[1] then 
            local iRow, iCol = guiGridListGetSelectedItem( Enad.gridlist[1] ) 
            if( iRow and iCol and iRow ~= -1 and iCol ~= -1 )then 
                local ID = tonumber( guiGridListGetItemText( Enad.gridlist[1], iRow, 1 ) ) 
                local CN = tostring( guiGridListGetItemText( Enad.gridlist[1], iRow, 2 ) ) 
                local filePath = tostring( guiGridListGetItemData( Enad.gridlist[1], iRow, 2 ) ) 
                if( ID ~= '' )then 
                    if fileExists( ':'.. filePath ..'/'.. ID ..'.txd' ) and fileExists( ':'.. filePath ..'/'.. ID ..'.dff', ID ) then 
                        if not( engineRestoreModel( ID ) )then 
                            engineImportTXD( engineLoadTXD( ':'.. filePath ..'/'.. ID ..'.txd' ), ID ) 
                            engineReplaceModel( engineLoadDFF( ':'.. filePath ..'/'.. ID ..'.dff', ID ), ID ) 
                            guiGridListSetItemColor ( Enad.gridlist[1], iRow, 1, 0, 255, 0 ) 
                            load_ = true 
                        else 
                            guiGridListSetItemColor ( Enad.gridlist[1], iRow, 1, 255, 0, 0 ) 
                            load_ = false 
                        end 
                        guiSetEnabled ( source, false ) 
                        setTimer ( guiSetEnabled, 3000, 1, source, true ) 
                    else 
                        if i == true then 
                        guiGridListSetItemColor ( Enad.gridlist[1], iRow, 1, 255, 255, 0 ) 
                        i = false 
                        setTimer( function( ) i = true end, 5000, 1 ) 
                        end 
                    end 
                end 
            end  
        elseif source == Enad.button[2] then 
            guiSetVisible ( Enad.window[1], false ) 
            showCursor ( false ) 
            executeCommandHandler ( "onStartPlay_" ) 
            bindKey( '/', 'down', 'rr_' ) 
        elseif source == Enad.button[3] then 
            guiSetEnabled ( source, false ) 
            setTimer ( guiSetEnabled, 10000, 1, source, true ) 
            if not load_ then return end 
            load_ = false           
            for i, type in ipairs( getTDByType )do 
                if fileExists( ':'.. type[3] ..'/'.. type[2] ..'.txd' ) and fileExists( ':'.. type[3] ..'/'.. type[2] ..'.dff', type[2] ) then 
                    engineRestoreModel( type[2] ) 
                end 
            end 
            guiGridListClear ( Enad.gridlist[1] ) 
            for _, type in ipairs( getTDByType )do 
                local gRow = guiGridListAddRow( Enad.gridlist[1] ) 
                guiGridListSetItemText( Enad.gridlist[1], gRow, Column2, tostring( type[ 2 ] ), false, false    )    
                guiGridListSetItemText( Enad.gridlist[1], gRow, Column2_, tostring( type[ 1 ] ), false, false ) 
                t = guiGridListSetItemData( Enad.gridlist[1], gRow, Column2_, tostring( type[ 3 ] ) ) 
                guiGridListSetItemColor ( Enad.gridlist[1], gRow, Column2, 255, 0, 0 ) 
            end  
        elseif source == Enad.button[4] then 
            guiSetEnabled ( source, false ) 
            setTimer ( guiSetEnabled, 10000, 1, source, true ) 
            if load_ then return end 
            load_ = true 
            if isTimer ( loadTimer ) then killTimer ( loadTimer ) end 
            loadTimer = setTimer ( 
                function ( ) 
                    for i, type in ipairs( getTDByType )do 
                        if fileExists( ':'.. type[3] ..'/'.. type[2] ..'.txd' ) and fileExists( ':'.. type[3] ..'/'.. type[2] ..'.dff', type[2] ) then 
                            engineImportTXD( engineLoadTXD( ':'.. type[3] ..'/'.. type[2] ..'.txd' ), type[2] ) 
                            engineReplaceModel( engineLoadDFF( ':'.. type[3] ..'/'.. type[2] ..'.dff', type[2] ), type[2] ) 
                        end 
                    end 
                end 
            , 1500, 1 ) 
            guiGridListClear ( Enad.gridlist[1] ) 
            for _, type in ipairs( getTDByType )do 
                local gRow = guiGridListAddRow( Enad.gridlist[1] ) 
                guiGridListSetItemText( Enad.gridlist[1], gRow, Column2, tostring( type[ 2 ] ), false, false    )    
                guiGridListSetItemText( Enad.gridlist[1], gRow, Column2_, tostring( type[ 1 ] ), false, false ) 
                t = guiGridListSetItemData( Enad.gridlist[1], gRow, Column2_, tostring( type[ 3 ] ) ) 
                guiGridListSetItemColor ( Enad.gridlist[1], gRow, Column2, 0, 255, 0 ) 
            end 
            if isTimer ( Timer ) then killTimer ( Timer ) end 
            resetProgress_ ( pp_ ) 
            fadeCamera ( false ) 
            Timer = setTimer ( upgradeValues_, 50, 0, pp_ )         
        end 
    end 
) 
  
for i, v in pairs ( Languages ) do 
    guiComboBoxAddItem ( Enad.combobox[1], tostring ( i ) ) 
end 
  
addEventHandler ( "onClientGUIComboBoxAccepted", Enad.combobox[1], 
    function ( ) 
        local text = tostring ( guiComboBoxGetItemText ( source, guiComboBoxGetSelected ( source ) ) ) 
        if text == "" then return end 
        if text == "عربي" then 
            guiLabelSetHorizontalAlign ( Enad.label[1], "right" ) 
        else 
            guiLabelSetHorizontalAlign ( Enad.label[1], "left" )    
        end 
        guiSetText ( Enad.label[1], Languages[text]["Information"] ) 
        guiSetText ( Enad.button[1], Languages[text]["Run Or Stop"] ) 
        guiSetText ( Enad.button[4], Languages[text]["Run All"] ) 
        guiSetText ( Enad.button[3], Languages[text]["Stop All"] ) 
    end 
, false ) 
  
  
  
     guiSetVisible (Enad.window[1] , false)   
function OpenWin() 
    if guiGetVisible ( Enad.window[1] ) then 
       guiSetVisible ( Enad.window[1] , false ) 
       showCursor(false) 
       guiSetInputEnabled(false) 
    else 
        guiSetVisible ( Enad.window[1] , true ) 
        showCursor(true) 
        guiSetInputEnabled(true) 
  
    end 
end 
bindKey("/", "down", OpenWin) 
  

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