-- M7mdAl7arthy --
-- Skype: M7mdAl7arthy --
-- Updated: 3NAD --
getTDByType =
{
--[[ { 'car name', car id, 'file Path' }; --]]
{ '1sHiLuX_Khli-909-2014', 491, 'xCar7' };
{ 'Camry 2006', 585, 'xCar17' };
{ 'Taho', 502, 'xCar20' };
};
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 guiCreateWindow( x2, y2, width2, height2, titleBarText2, relative2 )
local mainBackground = guiCreateStaticImage ( x2, y2, width2, height2, "Back.png", relative2 )
local mainBackgroundLabel = guiCreateLabel ( 91, 29, 611, 544, titleBarText2, false, mainBackground )
guiSetFont ( mainBackgroundLabel, newFont2 )
guiSetEnabled ( mainBackgroundLabel, false )
return mainBackground
end
load_ = true
i = true
addEventHandler("onClientResourceStart", resourceRoot,
function()
Enad.window[1] = guiCreateWindow(120, 138, 571, 328, "", false)
guiWindowSetSizable(Enad.window[1], false)
guiSetVisible (Enad.window[1],false )
Enad.gridlist[1] = guiCreateGridList(18, 28, 264, 252, false, Enad.window[1])
Enad.label[1] = guiCreateLabel(294, 59, 266, 252, "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 : )", false, Enad.window[1])
Enad.button[1] = guiCreateButton(36, 285, 126, 34, "Run / Stop Selected", false, Enad.window[1])
guiSetProperty(Enad.button[1], "NormalTextColour", "FFAAAAAA")
Enad.combobox[1] = guiCreateComboBox(307, 28, 197, 100, "English", false, Enad.window[1])
Enad.button[2] = guiCreateButton(516, 25, 32, 25, "X", false, Enad.window[1])
guiSetProperty(Enad.button[2], "NormalTextColour", "FFAAAAAA")
Enad.button[3] = guiCreateButton(166, 285, 90, 34, "Stop All", false, Enad.window[1])
guiSetProperty(Enad.button[3], "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 )
end
)
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
)
addCommandHandler( 'rr_',
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
)]]
setTimer(function()
guiLabelSetColor(Enad.label[1], math.random(0,255), math.random(0,255), math.random(0,255))
end, 800, 0)
function say()
outputChatBox ("~| (m) آلي عنده مشكلهمن ضعف كرد شاشة اطغط m لايقاف سيرات |~" ,255, 255,0,true )
end
setTimer ( say, 60000, 0)